Page 1 of 1

Long (2^63) item amount.

Posted: Fri Jan 11, 2013 7:59 am
by Arantir
Why does exactly this:

Code: Select all

long max = getItemId() == ADENA_ID ? MAX_ADENA : Integer.MAX_VALUE;
?!
Is it mistake? All the count variable have a long type. Client works with 999,999,999,999,999 amount of item without any problems. So why? Why does count is cutting off to integer?

Re: Long (2^63) item amount.

Posted: Fri Jan 11, 2013 11:56 am
by Zoey76
I have never tested if client support long, but I'm almost sure back in the day, at Interlude times, it wasn't possible more that 2kkk~.

Probably those are just left overs from previous implementation, I remember Nik did some rework related to Adena amount support.

Let's wait for UnAfraid/Nikto comment about it.

Re: Long (2^63) item amount.

Posted: Fri Jan 11, 2013 12:00 pm
by UnAfraid
Client supports unsigned long value but retail server limit the max adena to 99 bilions
Not sure about other items but we can test that :)

Re: Long (2^63) item amount.

Posted: Fri Jan 11, 2013 12:22 pm
by Arantir
I changed it lo long max. Now I have 13,000,000,000,001,023 Festival Adenas in inventory and don't feel any troubles. I can correct drop some of them, or pick up one more item.

Retail is just retail. Many free servers have high rates, so you can easy collect more than 2kkk of some item.

Seems like 99bill limit was just for cheaters =)) It is something like "theoretically limit of amount player can physically reach with honest playing".

Re: Long (2^63) item amount.

Posted: Fri Jan 11, 2013 6:27 pm
by UnAfraid
Nik made config about this here Changeset 5193

Re: Long (2^63) item amount.

Posted: Fri Jan 11, 2013 8:24 pm
by Arantir
UnAfraid wrote:Nik made config about this here Changeset 5193
But I talking about item amount limit.
Don't you see that for everything besides Adena it is Integer.MAX_VALUE?

Re: Long (2^63) item amount.

Posted: Sat Jan 12, 2013 1:20 am
by UnAfraid
Do you really need them to be over 2147483647 ?
I've never had item except adena that over Integer.MAX_VALUE..

Re: Long (2^63) item amount.

Posted: Sat Jan 12, 2013 4:58 am
by Arantir
With x250 drop rate players can collect more than 2^31-1 Seal Stones relatively easy.

UnAfraid, I didn't say it is bug. And in most cases you are right than 2KKK is enough. I just was intrigued by an integer limit among long variables. And a special after problem with Seal Stones.

Re: Long (2^63) item amount.

Posted: Sat Jan 12, 2013 5:45 am
by Okari
If the client indeed supports values up to unsigned long for item amounts, then I think this limit should be increased to long max value. First because we can, and second because it makes the server more customisable, and more likely to work properly at higher rates without encountering problems like the one Arantir pointed out.

Re: Long (2^63) item amount.

Posted: Sat Jan 12, 2013 12:00 pm
by UnAfraid
Well we use the same limits as retail server does.
We could commit new config for the rest of the items just like Nik did with Adena.

Re: Long (2^63) item amount.

Posted: Sat Jan 12, 2013 12:52 pm
by jurchiks
A config would be better than nothing.