|
||
|
|
#1 (permalink) |
|
Account Terminated
Join Date: Dec 2007
Posts: 28
|
How are UO gzip packets handled? I know I need the zlib for whatever platform I'm using, but how do I know how big the packet is as its coming through? As in tcp packets are just streams, so you need to get up to a specific size, then handle the data to do whatever you need, in the case of a gzipped packet, it needs to be decompressed first. When I look at the char list for example, its a variable lenght packet and the size is specified, but I only know the size once I uncompress it, but I need to know the size so I can uncompress it, as I need to ensure I capture enough but not too much.
|
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
|
I might be wrong on this but... Whenever a packet is compressed, it becomes a new packet that is identified by the Compressed Packet ID. This packet is just like any other packet. It has a length field which specifies the length of its contents which is the original packet after compression.
|
|
|
|
|
|
#4 (permalink) |
|
Account Terminated
Join Date: Dec 2007
Posts: 28
|
Hmm weird the lenght is not in there at all. Wonder if the only way is to use non blocking sockets, then you just read until the buffer is empty. But even that would not make sense as sometimes packets are sent in several chunks, so how do you determine how to put these together (before decompressing).
|
|
|
|
|
|
#6 (permalink) |
|
Account Terminated
Join Date: Dec 2007
Posts: 28
|
Yeah but those seem different for some reason. i did notice when I look at the char list packet there is a 5 byte zipped packet followed by another packet. Wonder if there's always a 5 byte packet first, maybe that contains the size. So I uncompress it individually. I'll have to play around some more.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|