Page 1 of 1

Old SecureTrade bug

Posted: Tue Jan 02, 2007 12:49 am
by Bracco
me again :P

Affected cores:
both 096 and 097, all versions, only when using >=aos accounts

bug:
when you trade an item to someone, pol does not send the 0xD6 packet relative to the item's name.

for example:
A trades B "a robe"
in the trade window A sees the name "a robe" when single clicking it, B does not see the name when clicking.
this happens because if the client has not seen this item before, pol does not send the item name (the aos way) when showing it in the secure trade window

here is how i fixed it with packethooks. downside is that packet is sent to both client (one of them does not really need the data) but that's not a great problem :P

Code: Select all

//Packet Hook for Secure Trade fix with AOS Tooltips

Packet 0x25
{
 Length 20
 SendFunction packethooks:s_AddSingleItemToContainer
}

Code: Select all

exported function s_AddSingleItemToContainer(char, byref packet)
if((char.acct.uo_expansion == "AOS") || (char.acct.uo_expansion == "SE") || (char.acct.uo_expansion == "ML"))
   var container := SystemFindObjectBySerial(packet.getint32(14));
   if (container.objtype==0xFF01)
         var seriale := packet.getint32(1);
         var item := SystemFindObjectBySerial(seriale);
         var i;
         // conversion from string to unicode array
         var name:=cascz(item.desc);
         for (i:=1;i<=name.size();i:=i+1)
            name[i]:=CInt(name[i])*256;
         endfor
       
         //Size precalculated because of a bug in variable length packets ?
         var size:=25+((name.size())*2);
         var tooltip:=CreatePacket(0xD6, size);
         tooltip.setint16(3,1);
         tooltip.setint32(5,Cint(seriale));
         tooltip.setint16(9,0);
         tooltip.setint32(11,1);
         tooltip.setint32(15,1042971); // constant for POL's tooltip?
         tooltip.setint16(19,((name.size())*2));
         tooltip.setunicodestring(21,name,0);
         tooltip.setint32(size,0);
         tooltip.setint16(1,size);
         tooltip.sendpacket(char);    

   endif
endif   
return 0;
endfunction

Posted: Tue Jan 02, 2007 12:58 am
by MuadDib
HA!

We fixed several Secure trade bugs involving tooltips................ but obviously this one got overlooked, or created, when fixing the tooltips :D

Will look into it while in the mood :)

Posted: Tue Jan 02, 2007 1:08 am
by MuadDib
Hrm. Could have sworn this was fixed........................

Now, is this single clicking (oldschool), or tooltip (aos) method that is broke? or, is both broke with it?

Posted: Tue Jan 02, 2007 1:11 am
by Bracco
edit: OMG, sorry, its fixed :| was just my friend that did not properly set his account to aos/se/ml (using client 5)

so sorry :oops:

Posted: Tue Jan 02, 2007 1:17 am
by MuadDib
OK, I'll try to look into it soon as I get a chance

Posted: Tue Jan 02, 2007 1:17 am
by Bracco
nope my fault, it works, read above :oops:

Posted: Tue Jan 02, 2007 1:24 am
by MuadDib
lol, ok. So I'm not going insane, good :D