PenUltima Online

It is currently Sun Sep 07, 2008 8:27 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Packet reference
PostPosted: Fri Aug 24, 2007 1:42 pm 
Offline

Joined: Fri Aug 10, 2007 3:30 pm
Posts: 9
Hello,

I have problem with editing packets in packet hook, i am trying to change some packets for clients > 6.0.1.6, so i created few packet hooks, this is one of it:

Code:
exported function DropRequest( who, byref packet )

    if(!GetObjProperty( who, NEW_CLIENT ) )
       return 0;   
    endif

    var oldstyle := CreatePacket( 0x08, 14 );
    oldstyle.SetInt32( 1, packet.GetInt32(1) );
    oldstyle.SetInt16( 5, packet.GetInt16(5) );
    oldstyle.SetInt16( 7, packet.GetInt16(7) );
    oldstyle.SetInt8 ( 9, packet.GetInt8 (9) );
    // packet.GetInt8( 10 ) - Grid location
    oldstyle.SetInt32( 10, packet.GetInt32( 11 ) );
    packet := oldstyle;
    return 0;

endfunction


but if i want to use this syntax "packet := oldstyle;" packet would not change at all and core seems to be working with original packet sent by client.
If i do almost the same this way:

Code:
exported function DropRequest( who, byref packet )

    if(!GetObjProperty( who, NEW_CLIENT ) )
       return 0;   
    endif

    var containerID := packet.GetInt32( 11 );
    packet.SetInt32( 10, cointainerID );
    return 0;

endfunction

then its working a little ( I can only drop items on ground, not in containers becouse of the last byte ). I want to create new packet becouse i need to set different size ( new clients are sending 15 bytes, and core needs 14 bytes packet ) and packet.SetSize() is not working on fixed length packets.

So i am curious why assigning new packet object to packet variable isnt working even if packet variable is sent with byref? Or at least is there some another way to pass new packet from script to polcore?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 10, 2007 5:45 pm 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
So the packet change in KR?

Please provide me the info for this changed packet.

Also, do you have it set as variable length in your packet hook?

If core expects 14, that's all it will read btw, if you mod the packet. Even it if it is 15 with newer clients. Can you provide me more info for this?

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 11, 2007 12:00 am 
Offline
POL Core Developer

Joined: Sun Feb 05, 2006 4:45 am
Posts: 33
MuadDib wrote:
So the packet change in KR?

Please provide me the info for this changed packet.


Take a look at this file:

http://rapidshare.com/files/51156091/UO ... e.rar.html

found at www.uodev.de
There is a complete uo-protocol file for the clients > 6.x and UOKR.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 11, 2007 1:42 am 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
Will have to get with him on the packet list. Some things are inconsistent compared to the old guides. I doubt EA removed the Password bytes from the Create Character packet for example.

At any rate, will use it to help update the official packet site, and the html included with core once done also. Thanks for the link mate.

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 11, 2007 12:02 pm 
Offline

Joined: Thu Feb 02, 2006 8:33 am
Posts: 276
http://rapidshare.com/files/51151320/cheese191.rar.html

FYI MuadDib. To scan the new packets :)
Most changed packets refer to backpacks changed since UOKR. They have a grid now, nevertheless they shown in old style except 1 byte. The most important packets changed are 0x08, 0x25 and 0x3c. There is a lot more to change. I think these are the most important first. Simply to show the backpacks/containers in a right way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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