Old SecureTrade bug

Report core bugs regarding the Ultima Online Emulator Core release (version 097). You can attach your Core Dump. One bug per post.
Locked
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Old SecureTrade bug

Post 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
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post 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 :)
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post 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?
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post 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:
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post by MuadDib »

OK, I'll try to look into it soon as I get a chance
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post by Bracco »

nope my fault, it works, read above :oops:
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post by MuadDib »

lol, ok. So I'm not going insane, good :D
Locked