![]() |
is there a limit on the number of flags an account can have?
Is there a limit to the number of flags a player can have saved in their account file? and if not is there a limit to the number of flags that would make saving them to the player not a feasible option?
|
There is no limit but after 64k (or so) of data it disconnects people's RC when they attempt to open someone with too much flag data.
This is a (fairly rare) problem on Zodiac due to limitless-bag type inventory. |
so it doesn't hinder performance at all?
|
It's going to hinder performance to the extent that it's stored in memory and it saves on logout (possibly while logged in, not sure). Unless you have a ridiculous amount of flags you should be fine (Kingdoms is using over 500 flags without problems).
|
I'm currently storing items like this
clientr.item.(@realname).(@itemid) = {temp.iteminfo}; i could see it loading the account file up quickly with a flag saved for each item. |
Going to bump because I don't remember how I ended up handling it last time. If I were to save every item as a flag with a unique ID similar to what I was doing above after a while I could see someone accumulating enough items to cause this issue. Is there anyway to work around this? I know I had tested before and it was quite a bit of flags I added to my account before I started getting errors however I want to cut out the possibility of it even happening while still keeping it so all itemids are unique. Any suggestions?
|
What if you store ItemID's in arrays depending on what type of item it is?
|
That could cause the array itself to get too big. I know there is a limit on how much you can store in one I just don't remember what it is
|
How it's done on Zodiac...
clientr.item-Item Name={quantity, arc} clientr.mud_Item Name={itemdata} If you want to use item ids you could use: clientr.item.itemid = {quantity, item_data} My Zodiac V2 used a hybrid of the above.. clientr.item.itemid = quantity clientr.mud.itemid = {item_data} However my clientr flags were merely a 'cached' version of what was stored in the SQL DB. I also had a 'stackable' property so when I added an item, if it was stackable I would look for a stack to place it in, if there was no stack I would create a new one and assign it's own unique id. To keep the amount of items to a minimum I would impose a bag limit. |
is it stupid to update the item information everytime it is equipped like say i cached every item into a DBNPC from flat files and every time someone equips something it pulls the item information from that? or would it be better just to store all the item data in a clientr variable instead of just the itemid and name of the item. it would allow for more flags but would also make more request to the server.
edit: also my item id is a unique id for the actual item ex; Potion itemid-> 47288 weapon -> 47289 randomly dropped item in dungeon lets say its a pair of gloves -> 52920 I basically want it for item tracking |
I don't store any item data directly on clients on Maloria. What I do is that everytime I need to read the data of an item, I do a query from a weapon NPC called "CACHE" that retrieves the data from the SQL table, saves it on both clientside and serverside, and then returns said data with the query. If item data has already been queried by a player during the session and tries to query it again, I simply return the stored data.
Everytime the SQL database is updated with my item database tool, which only happens when I edit items, it sends a query to CACHE to update the data for all players that are online who have said item. When it comes to owned items, I store them in a TStaticVar. Stackable items (non-unique): player.items.ITEMIDENTIFIER Non-stackable items (unique): player.items.UNIQUEITEMID Subvars to each item includes identifier, id, quantity and some other misc. things - usually data that is unique to this particular item, such as skin, special properties added by crafting etc. Cubes, if you want to study it indepth, just poke me when I'm online and I'll set you up. |
Quote:
And just store the item ID and quantity in the client flags like explained above. |
Quote:
Thanks for the replies, I think I'll just go ahead and give things like potions and gold non unique ids and other items unique ids @ziro, I'll message you on maloria later |
Quote:
|
Yes an item would have an Id that would reference the item information And another that would reference that specific item. Like a monster drops 2 of the same item each would have a unique id and an id that would identify the item
|
| All times are GMT +2. The time now is 01:29 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.