EOSERV Bug Tracker > Bug #326: Fake Trades

Bug #326: Fake Trades

Fake Trades
ID #326
Submitter callum
Product EOSERV
Severity Normal
Status CLOSED, FIXED
Submitted 4th Mar 2015
Updated 11th Mar 2015
Related SVN Revisions
Rev# Date Description
r454 11 Mar 2015 05:05:53 UTC Re-order trade amount clamping to reject offering 0 of items you don't have (bug #326)
callum Submitter 9 years, 10 weeks ago

EOServ doesn't check if the item amount is <= 0 like when dropping items, It lets players trade x0 of an item.

Comments

Apollo 9 years, 9 weeks ago

Pretty sure the bug referenced here is bug #313 which was fixed in r442 which probably invalidates this new bug report.

jimmy 9 years, 9 weeks ago

The bug #313 is referring to when you're dropping items. This bug is referring to when you're trading items. Sausage may have added a check for both already, but I think these would be considered two different bugs :o

callum Submitter 9 years, 9 weeks ago

@Apollo There were x0 items traded on my r450, but adding an amount <=0) return fixed it..

Apollo 9 years, 9 weeks ago

Looks like the checks are missing in the official build. This should be more proper:

In Trade.cpp function Trade Add line 218 in r450:

UTIL_FOREACH(character->trade_inventory, item)

{

if (item.id == itemid && item.amount > 0)

{

offered = true;

break;

}

}

And in function Trade Agree insert this at line 128:

UTIL_FOREACH(character->trade_inventory, item)

{

if (character->HasItem(item.id, true) < item.amount && item.amount > 0) return;

}

UTIL_FOREACH(character->trade_partner->trade_inventory, item)

{

if (character->trade_partner->HasItem(item.id, true) < item.amount && item.amount > 0) return;

}

This should prevent any trade that is improper from passing as legit, but please don't consider this an official fix and do replace this with an official one should this particular bug get resolved.

Sausage Developer 9 years, 9 weeks ago

Can't reproduce. Amount of 0 is always rejected in Character::AddTradeItem.

Updated Status to CLOSED, INVALID

Cirras 9 years, 9 weeks ago

Now, I know that the bug said 0, but did you try a null value or a less-than-0 value?

Sausage Developer 9 years, 9 weeks ago

Turns out it happens because it clamps the value to the amount you have after checking for zero, which results in zero items if you don't have any of them.

Updated Status to OPEN, CONFIRMED

Sausage Developer 9 years, 9 weeks ago

Fixed in r454.

Updated Status to CLOSED, FIXED

Add Comment

Please don't post unless you have something relevant to the bug to say.
Do not comment to say "thanks" or "fix this please".

Please log in to add comments. EOSERV Bug Tracker > Bug #326: Fake Trades