View unanswered posts | View active topics
|
Page 1 of 1
|
[ 7 posts ] |
|
| Author |
Message |
|
mr bubbles
|
Post subject: Editing packets. Posted: Sat Mar 24, 2007 10:14 pm |
|
Joined: Thu Jan 18, 2007 2:34 am Posts: 91
|
|
Is it possible to hook a packet like 0x6C (target cursor) and edit the packet info the client sends?
I want it to always show the result of GetMapInfo() in the last part of the packet, instead of the landtile or static #.
What ive got now is a hook catching the packet and creating a new packet of the same type to what i want. But how do i make POL use the edited packet? I've tried
packet := newpacket;
return 0;
or is it sent via a different packet to the client with the info?
|
|
| Top |
|
 |
|
tekproxy
|
Post subject: Posted: Sun Mar 25, 2007 8:00 am |
|
 |
| Distro Developer |
 |
Joined: Thu Apr 06, 2006 5:11 pm Posts: 350 Location: Nederland, Texas
|
|
If you want to hook a packet sent by the client and modify it before it gets to the server, that's entirely possible. Make sure it is configured as a recieve hook, and try editing packet instead of setting it to equal another packet.
|
|
| Top |
|
 |
|
mr bubbles
|
Post subject: Posted: Sun Mar 25, 2007 12:25 pm |
|
Joined: Thu Jan 18, 2007 2:34 am Posts: 91
|
|
how do i edit "packet"? does .setintx(x, x) overwrite whats there or just make the packet bigger? and how is it different than me creating a new packet and assigning "packet" to that one?
|
|
| Top |
|
 |
|
tekproxy
|
Post subject: Posted: Mon Mar 26, 2007 6:24 am |
|
 |
| Distro Developer |
 |
Joined: Thu Apr 06, 2006 5:11 pm Posts: 350 Location: Nederland, Texas
|
|
If you use .SetInt16(), etc... you'll be rewriting 16-bytes of memory starting at that offset, which would overwrite the old data. I can't think of a reason that packet := newpacket wouldn't work, but using SetInt16(), etc... would just be the first thing I would check, because I know that way works.
Could you post your code? Maybe it's something else.
|
|
| Top |
|
 |
|
Barbeirosa
|
Post subject: Posted: Mon Mar 26, 2007 9:25 am |
|
|
|
|
Does your packethook script declare the packet parameter as byref? If it does not, then nothing at all you do to the packet will stick.
|
|
| Top |
|
 |
|
mr bubbles
|
Post subject: Posted: Mon Mar 26, 2007 5:40 pm |
|
Joined: Thu Jan 18, 2007 2:34 am Posts: 91
|
ohh, editing packet worked. maybe the packet i created was the wrong size or something
Thanks for the help
|
|
| Top |
|
 |
|
tekproxy
|
Post subject: Posted: Mon Mar 26, 2007 6:23 pm |
|
 |
| Distro Developer |
 |
Joined: Thu Apr 06, 2006 5:11 pm Posts: 350 Location: Nederland, Texas
|
Good. 
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 7 posts ] |
|
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
|
|