PenUltima Online

It is currently Fri Sep 05, 2008 1:32 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Pick up item [POL097-2006-07-02 and older]
PostPosted: Wed Jul 05, 2006 7:41 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
Wow, first 097 bug! ;) *even if it's not a pure 097 bug*

In the 0x07 packet (Pick Up Item) hook, we check for some character props and deny the action if it's not enough to lift item... in this case, we send a 0x27 packet (Reject Move Item Request) to client and block 0x07 packet.
All ok, but...
If the same client try to pick up the same item (before it has been touched by another character) the 0x07 packet is wrong, having item amount always 0.
alway 0 --> BYTE[2] # of items in stack
If we don't send 0x27 packet all is ok, but client make item graphical disappeared.

One more thing: the amount in 0x07 packet is alway the whole stack amount, even if a client pick up only a little part of it... it's fixable or not?

(Thank you for 097 release :D )

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 05, 2006 8:37 am 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
What client versions? Give me all info you can. Including the hook if possible.

I will want to reproduce this myself and see what i can come up with.

The trick to try, is use .startlog then pick the item up where it will DENY it with your packethook. Then, reboot, whatever you gotta do (to get away from the bug). Then, try to pick up the item where the CORE rejects it (aka, to far away). See what happens then for the 0x27 again. Remember to use .startlog for this also. It will create a <accountname>.log file in the /log directory of your pol installation. It will contain the packets sent/recieved by the core.

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject: Re: Pick up item [POL097-2006-07-02 and older]
PostPosted: Wed Jul 05, 2006 9:47 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
Developer Silver wrote:
One more thing: the amount in 0x07 packet is alway the whole stack amount, even if a client pick up only a little part of it... it's fixable or not?

This is not true, sorry I've mistaken... :P

For the first bug, I'll do what you suggested and I'll post here results... :)

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 05, 2006 10:21 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
Results:

With my 0x07 packethook enabled, in case of pick up denied (custom check not passed):

First pick up
Code:
Client -> Server: 0x7, 7 bytes
0000: 07 40 89 cb b5 00 01                               .@...... ........

Server -> Client: 0x27, 2 bytes
0000: 27 00                                              '....... ........

Lift correctly denied with 0x27 packet.


Second pick up
Code:
Client -> Server: 0x7, 7 bytes
0000: 07 40 89 cb b5 00 00                               .@...... ........

Server -> Client: 0x1D, 5 bytes
0000: 1d 40 89 cb b5                                     .@...... ........

Lift uncorrectly allowed: last byte in 0x7 packet is 0, while in first pick up was 1 (correct 1, it's a metal chest)

- - - - -

With my 0x07 packethook disabled, in case of pick up denied (too far away from item):

First pickup
Code:
Client -> Server: 0x7, 7 bytes
0000: 07 40 89 cb b5 00 01                               .@...... ........

Server -> Client: 0x27, 2 bytes
0000: 27 01                                              '....... ........

Correct.

Every other pickup
Code:
Client -> Server: 0x7, 7 bytes
0000: 07 40 89 cb b5 00 00                               .@...... ........

Server -> Client: 0x27, 2 bytes
0000: 27 01                                              '....... ........

Strange... in every pick up after the first, last byte of 0x7 is 0 (alway the metal chest, so it should be 1, no?)
Second byte of 0x27 sent by the core is 1, while packet guide tells second byte is an unknown 0. I tried setting up my 0x27 packet with 1 as second byte but nothing changed.

- - - - -

We use latest 5.0.2d client (with uorice).

Portion of hook you may be interested in is:

Code:
exported function hooklift(who, byref pacchetto)

   if([...custom checks...])
// Too heavy
      var reject := CreatePacket(0x27, 2);
      reject.SetInt8(1, 1);
      reject.SendPacket(who);
      return 1;
   endif



Do you need more infos?

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl