Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Fix for meso exploit with shops

Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Most meso exploits have something to do with overflow.
 
I'm sexy and I know it :)
Joined
Oct 21, 2008
Messages
811
Reaction score
350
well done flav. Even though thats fixed by most unstupid coders :D.

Not really, seeing as it was in nearly every public server.

I bet he fixed it earlier. He just now released it boy :)

Nope he found out about it not long ago.

This made me giggle. Careful what you say, The almighty eye is watching.

OT: Thanks Flav, Nice Release.

---------- Post added at 06:15 PM ---------- Previous post was at 06:14 PM ----------



lolwut?

The almighty eye? really now? :ehh:

just wondering why are you using long and not just stick to an int?

If you stick to the int the players get a negative amount of mesos after you multiple the price of an item and the amount of items. Therefore you need to make sure that total amount of mesos after multiplying isn't negative.

Most meso exploits have something to do with overflow.

cntrl + f meso
 
Junior Spellweaver
Joined
Aug 2, 2010
Messages
190
Reaction score
90
I never tried but Lai says it's not. I prefer the converting to long method, though it wastes 4 bytes.



But you have to multiply the price with the quantity before you check for the price being >= 0.

just wondering why are you using long and not just stick to an int?

@flav Honestly, its smarter to use a long that way its guaranteed that the int won't become negative.

@mertjuh Using an integer defeats the entire purpose of this fix. What usually happens when you exceed (2^31 -1) the integer value becomes negative. However using a long expands the capacity of the value making the cap (2^63 -1). Besides, not many arithmetic operations can exceed (2^63 -1) unless your doing the very thing.
 
Junior Spellweaver
Joined
Sep 19, 2009
Messages
138
Reaction score
92
@flav Honestly, its smarter to use a long that way its guaranteed that the int won't become negative.

@mertjuh Using an integer defeats the entire purpose of this fix. What usually happens when you exceed (2^31 -1) the integer value becomes negative. However using a long expands the capacity of the value making the cap (2^63 -1). Besides, not many arithmetic operations can exceed (2^63 -1) unless your doing the very thing.

That's not very smart of you to waste 4 bytes.
Afterall, it's all to your personal preference.

// int * short = int
Code:
if (price * quantity < 0)

OR

Code:
if (((long) price * quantity > Integer.Max_Value)
 
Back
Top