Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2011, 02:47 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default Bad LDON bug

Well had to sell stuff and zone over and over until I could basically figure out what was going on here but essentially LDON points are resetting to ZERO after it reaches between 65,450 and 65,604 the exact number would be 65535 where it breaks. Is that the Cap for LDOn points now or something..

Anyway I Sold items all the way up until i had 65,450, zoned around a few times, checked merchant everything was fine, then when i sold another item and my points jumped to 65,604 I then zoned and after I zoned and clicked the LDON merchant there was yellow text on the chat window that said.

"You have spent 65604 Adventure points." <----Exactly like that

After checking merchant I did confirm that I had ZERO points .. Anyway does anyone know about this or have a fix for this perhaps ? Not sure if it was a Linux Related issue or whatever that's why I posted it here.

Let me know and thank you folks in advance !

Morty
Reply With Quote
  #2  
Old 06-01-2011, 04:10 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Sounds like an int16 issue, but all of the structs and stuff I just checked all showed as int32 which allows for much higher numbers than 65k. Maybe there is a function somewhere that uses int16 instead of int32, but I didn't see it in the brief review that I did. Either that, or maybe the client can't handle more than 65kish due to the same issue, but hard coded into the client. Have you tried checking the point value with a quest command to verify it matches the message you are seeing in the client?
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 06-01-2011, 04:41 AM
Leere
Sarnak
 
Join Date: Sep 2008
Location: Home
Posts: 31
Default

zone\client_packet.cpp, starting line 8303 (part of Client::FinishConnState2(...))

Code:
    //validate adventure points, this cap is arbitrary
    if(m_pp.ldon_points_guk < 0 || m_pp.ldon_points_guk > 0xFFFF) m_pp.ldon_points_guk = 0;
    if(m_pp.ldon_points_mir < 0 || m_pp.ldon_points_mir > 0xFFFF) m_pp.ldon_points_mir = 0;
    if(m_pp.ldon_points_mmc < 0 || m_pp.ldon_points_mmc > 0xFFFF) m_pp.ldon_points_mmc = 0;
    if(m_pp.ldon_points_ruj < 0 || m_pp.ldon_points_ruj > 0xFFFF) m_pp.ldon_points_ruj = 0;
    if(m_pp.ldon_points_tak < 0 || m_pp.ldon_points_tak > 0xFFFF) m_pp.ldon_points_tak = 0;
    if(m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 0xFFFF) m_pp.ldon_points_available = 0;
Comment says arbitrary, and 0xffff is 65535.

As an aside, there's also an automatic skillup for swimming to 100 just below that.
Reply With Quote
  #4  
Old 06-01-2011, 04:57 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

So like if i set it to 0XA0000 or 655,350 , would that work or ? btw does OXA0000= 655,350 or am I wrong ? lol
Reply With Quote
  #5  
Old 06-01-2011, 05:47 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

It really depends on what you wish to achieve. Yes, you can set it to a larger arbitrary number, or you can just remove the second check completely and let it roll over to a negative number past 0x7FFFFFFF where it will get set to 0 by the first check.

If the reason for the original check was to keep it 5 digits so it will fit in the UI then setting it to 0 for negative numbers and 99999 for anything higher than 99999 seems like a better solution. You can use plain integer numbers for the check, you don't need to convert it to hex.

0xA0000 = 655360 btw.
Reply With Quote
  #6  
Old 06-01-2011, 06:05 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

So this should work right? If so is this the only place I have to do this or is there other files I need to change :

Code:
	//validate adventure points, this cap is arbitrary
	if(m_pp.ldon_points_guk < 0 || m_pp.ldon_points_guk > 0xFFFFFFFF) m_pp.ldon_points_guk = 0;
	if(m_pp.ldon_points_mir < 0 || m_pp.ldon_points_mir > 0xFFFFFFFF) m_pp.ldon_points_mir = 0;
	if(m_pp.ldon_points_mmc < 0 || m_pp.ldon_points_mmc > 0xFFFFFFFF) m_pp.ldon_points_mmc = 0;
	if(m_pp.ldon_points_ruj < 0 || m_pp.ldon_points_ruj > 0xFFFFFFFF) m_pp.ldon_points_ruj = 0;
	if(m_pp.ldon_points_tak < 0 || m_pp.ldon_points_tak > 0xFFFFFFFF) m_pp.ldon_points_tak = 0;
	if(m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 0xFFFFFFFF) m_pp.ldon_points_available = 0;
Reply With Quote
  #7  
Old 06-01-2011, 06:49 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

That may "work", but it isn't correct. The type of those variables is sint32, so they can never be larger than 0x7FFFFFFF and the second check is meaningless.

Do you really expect someone to accumulate over 2 billion points? If they somehow do that, do you want them to lose them all when they accumulate too many?

If it was me, I'd prefer capping the points rather than setting them to 0.

Something like this and adjusting the number to be the maximum you want them to have saved or to fit the UI:
Code:
if(m_pp.ldon_points_guk < 0) m_pp.ldon_points_guk = 0;
if(m_pp.ldon_points_guk > 999999) m_pp.ldon_points_guk = 999999;
That is the only place you would need to make this particular change as far as I can see, but you would need to test with numbers approaching and exceeding whatever limit you decide on to see if there are any other issues.
Reply With Quote
  #8  
Old 06-01-2011, 07:22 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

From the looks of things whoever coded this was afraid that the points would be skewed so bad (how?) that the numbers would go wack either in the negative or high positive... I think thats why these checks were there. Are they relevant anymore? I would hope not.
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #9  
Old 06-01-2011, 01:06 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 541
Default

Another issue that had you searched your own posts or checked your old code ,would have been fixed(ie it was fixed by somebody else a long time ago, which you promptly forgot about).
Reply With Quote
  #10  
Old 06-01-2011, 05:15 PM
ojamajoe
Fire Beetle
 
Join Date: Jan 2009
Location: Central USA
Posts: 8
Default

Quote:
As an aside, there's also an automatic skillup for swimming to 100 just below that.
Sweet! I've been looking for that for a while...
Reply With Quote
  #11  
Old 06-02-2011, 06:27 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Alright so yeah will set it up like this then..

Quote:
//validate adventure points, this cap is arbitrary
if(m_pp.ldon_points_guk < 0 || m_pp.ldon_points_guk > 9999999) m_pp.ldon_points_guk = 0;
if(m_pp.ldon_points_mir < 0 || m_pp.ldon_points_mir > 9999999) m_pp.ldon_points_mir = 0;
if(m_pp.ldon_points_mmc < 0 || m_pp.ldon_points_mmc > 9999999) m_pp.ldon_points_mmc = 0;
if(m_pp.ldon_points_ruj < 0 || m_pp.ldon_points_ruj > 9999999) m_pp.ldon_points_ruj = 0;
if(m_pp.ldon_points_tak < 0 || m_pp.ldon_points_tak > 9999999) m_pp.ldon_points_tak = 0;
if(m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 9999999) m_pp.ldon_points_available = 0;

PS: Carytalis , quit de-railing and trolling my posts, it's against the Geneva Convention
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:43 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3