Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   is there a limit on the number of flags an account can have? (https://forums.graalonline.com/forums/showthread.php?t=134263553)

Cubical 06-14-2011 02:56 AM

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?

fowlplay4 06-14-2011 03:27 AM

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.

Cubical 06-14-2011 03:32 AM

so it doesn't hinder performance at all?

cbk1994 06-14-2011 03:48 AM

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).

Cubical 06-14-2011 04:06 AM

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.

Cubical 03-01-2012 01:22 AM

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?

BlueMelon 03-01-2012 02:09 AM

What if you store ItemID's in arrays depending on what type of item it is?

Cubical 03-01-2012 02:20 AM

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

fowlplay4 03-01-2012 02:42 AM

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.

Cubical 03-01-2012 04:39 AM

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

xXziroXx 03-01-2012 06:42 AM

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.

BlueMelon 03-01-2012 07:22 PM

Quote:

Originally Posted by Cubical (Post 1686525)
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

All of the item info can be stored in a DB yea, like image/thumbnail/weight/etc.

And just store the item ID and quantity in the client flags like explained above.

Cubical 03-01-2012 08:18 PM

Quote:

Originally Posted by BlueMelon (Post 1686554)
All of the item info can be stored in a DB yea, like image/thumbnail/weight/etc.

And just store the item ID and quantity in the client flags like explained above.

I don't think you get what I'm attempting to do. I'm trying to make every item have it's own unique I'd for easy item tracking so quantity would be irrelevant. My initial question was involving the amount of flags one can store my second question was asking if calling a request to the server everyone an item is equipped was a good idea or not. I already know how to store the information I just wanted to know the best way to implement it.

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

BlueMelon 03-01-2012 09:52 PM

Quote:

Originally Posted by Cubical (Post 1686555)
I don't think you get what I'm attempting to do. I'm trying to make every item have it's own unique I'd for easy item tracking so quantity would be irrelevant. My initial question was involving the amount of flags one can store my second question was asking if calling a request to the server everyone an item is equipped was a good idea or not. I already know how to store the information I just wanted to know the best way to implement it.

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

Unique ID for every single new item? Like for example the same weapon, but different IDs for it?

Cubical 03-01-2012 10:12 PM

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.