Prices - BigInt

This forum is for problems that arise with the Database Schema as it is developed, or questions you have regarding how to utilize the database.

Moderator: Team Members

Forum rules
Make sure your questions are detailed, intelligent, and relating to the default EQ2Emulator Database Schema.

Questions about how to build your own custom server content will not be addressed here.
Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Prices - BigInt

Post by Gangrenous » Tue Sep 13, 2016 7:35 pm

I ran into something today that may be of note. While importing in prices from EQ1 I started getting overflow errors. I starting looking into why and had some thoughts. I could be wrong though.

Lets say in EQemu 1,000,000 plat would be stored like this ....

plat gold silver copper
1000000 0 0 0

In Eq2Emu I am pretty sure it is stored like this, because you use an extra integer for gold, silver and copper
plat gold silver copper
1000000 00 00 00

So because of the need of the extra zeros, we get quite a large number
1,000,000,000,000

So if we are using an unsigned int I think the max is 4294967295, quite a few digits off. Looking at the items table I noticed the sell price is int(10) unsigned. I changed mine, but I have not tested any C++ goings on yet to see if there will be a problem when a BigInt transfers over to the actual game.
Resident Dirty Hippy

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Prices - BigInt

Post by John Adams » Thu Sep 15, 2016 3:49 pm

If you change the database to bigint(20), the C++ would have to be changed as well to int64's. I can't remember how EQ2Emu does it, but pretty sure the values would get trunc'd in code, too. Or, just explode.

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: Prices - BigInt

Post by xinux » Thu Sep 15, 2016 4:42 pm

This is also assuming the client and the packet structs support Uint64.
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Prices - BigInt

Post by Gangrenous » Thu Sep 15, 2016 5:26 pm

Well I will be finding out pretty quick.

If a black hole opens up, you may know if you do not hear from me again.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Prices - BigInt

Post by Jabantiz » Thu Sep 15, 2016 5:56 pm

Quick glance at a couple structs shows the price in merchant is an int64, on the char sheet the characters coins are stored as separate int32 for the 4 types, so I don't think there will be a problem client side, not sure about all the server code yet.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests