[DEV REV 4] Can't Trade Zuly

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[DEV REV 4] Can't Trade Zuly

Postby hasan38 on Fri Jun 27, 2014 8:25 am

So basically two players are unable to trade zuly. For example:

Player X: gives 30,000 zuly to Player Y.
Player Y: accepts the trade.
Player X: agrees and accepts the trade.

End Result: Both players end up with the same amount of zuly. Player Y never gets the 30,000 zuly that he was supposed to get from Player X.

After looking through the code, I have a feeling that the fix might be somewhere here:

In worldpackets.cpp

  1. // Update the zuly
  2.                 //LMA: anti hack...
  3.                 long long zulythis=0;
  4.                 long long zulyother=0;
  5.                 zulythis=thisclient->CharInfo->Zulies;
  6.                 zulyother=otherclient->CharInfo->Zulies;
  7.  
  8.                 thisclient->CharInfo->Zulies -= thisclient->Trade->trade_count[0x0a];
  9.                 otherclient->CharInfo->Zulies -= otherclient->Trade->trade_count[0x0a];
  10.                 thisclient->CharInfo->Zulies += otherclient->Trade->trade_count[0x0a];
  11.                 otherclient->CharInfo->Zulies += thisclient->Trade->trade_count[0x0a];
  12.  
  13.                 unsigned tucount = 0;
  14.                 unsigned oucount = 0;
  15.  
  16.                 // Begin this clients inventory update
  17.                 BEGINPACKET( pakt, 0x717 );
  18.                 ADDQWORD( pakt, thisclient->CharInfo->Zulies );
  19.                 ADDBYTE( pakt, 0 );
  20.  
  21.                 // Begin the other clients inventory update
  22.                 BEGINPACKET( pako, 0x717 );
  23.                 ADDQWORD( pako, otherclient->CharInfo->Zulies );
  24.                 ADDBYTE( pako, 0 );
hasan38
Rackie
Rackie
 
Posts: 246
Joined: Wed Apr 22, 2009 1:43 am

Re: [DEV REV 4] Can't Trade Zuly

Postby PurpleYouko on Fri Jun 27, 2014 2:49 pm

No. That bit of code is just fine. It has been the same since the first osrose servers were released over 8 years ago and it worked fine in every version up to dev rev 4

The reason dev rev 4 was discontinued at RoseZA was because at that time NARose were deliberately changing random bits of their packet structures every week in order to stop private servers from keeping up.
With that in mind it is far more likely that they transposed a couple of data bits in the associated packet so we have the wrong information stored in our trade variables

My guess is that the problem could be in a completely different function
// Trade action
bool CWorldServer::pakTradeAdd ( CPlayer* thisclient, CPacket* P )

That is where the actual values are added to the trade array

In fact I think the error might be that the specific slot used for zuly may have been renumbered due to the addition of other stuff (like mounts and/or costumes) to the slot counts in the client. The zuly slot has always been defined as OxOa (10 in decimal) but I'm betting that it isn't any more in DR4

You would have to do some digging around to figure out which slot it should be in and would most likely have to change the size of the thisclient->Trade->trade_count[] array in CharTypes.h to make room for all the new stuff.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [DEV REV 4] Can't Trade Zuly

Postby hasan38 on Sun Jun 29, 2014 6:16 am

okay thank you for that very informative post PY. I will take a look at what you have suggested.
hasan38
Rackie
Rackie
 
Posts: 246
Joined: Wed Apr 22, 2009 1:43 am


Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 6 guests

cron