Long (2^63) item amount.

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Arantir
Posts: 151
Joined: Wed Jan 04, 2012 7:10 pm

Long (2^63) item amount.

Post 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?
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: Long (2^63) item amount.

Post 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.
Powered by Eclipse 4.30 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Long (2^63) item amount.

Post 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 :)
Image
Arantir
Posts: 151
Joined: Wed Jan 04, 2012 7:10 pm

Re: Long (2^63) item amount.

Post 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".
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Long (2^63) item amount.

Post by UnAfraid »

Nik made config about this here Changeset 5193
Image
Arantir
Posts: 151
Joined: Wed Jan 04, 2012 7:10 pm

Re: Long (2^63) item amount.

Post 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?
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Long (2^63) item amount.

Post by UnAfraid »

Do you really need them to be over 2147483647 ?
I've never had item except adena that over Integer.MAX_VALUE..
Image
Arantir
Posts: 151
Joined: Wed Jan 04, 2012 7:10 pm

Re: Long (2^63) item amount.

Post 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.
Okari
Posts: 56
Joined: Mon Feb 08, 2010 1:56 pm

Re: Long (2^63) item amount.

Post 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.
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Long (2^63) item amount.

Post 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.
Image
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Long (2^63) item amount.

Post by jurchiks »

A config would be better than nothing.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Post Reply