Hi,
I noticed a lot of people are using sharpzip for decompressing compressed packets. Here is some simple code that will eliminate the requirement for having to include sharpzip.
Code:
//assuming data is the entire opcode stream withoug the four byte header
//data[0] should equal F6
//data[1] should equal 01 (502)
uint uncompressedLength = data[2]*256+data[3]
//data[4]data[5]data[6]data[7] I dunno but would like to know :)
byte[] input = System.Buffer.BlockCopy((data[8],0, data.length-8)
System.IO.Compression.DeflateStream istream = new System.IO.Compression.DeflateStream(new MemoryStream(input), Compression.CompressionMode.Decompress);
byte[] output = new byte[uncompressedLength];
size = istream.Read(output, offset, uncompressedLength);
I know this isn't a huge contribution, but hopefully it doesn't make anyone mad if I broke any rules or anything please just let me know politely.
If anyone has or could share the code for classes InstancedObject and InstancedWorldObject I would appreciate it greatly. Of course I'd welcome any technical information on the packet structures too.
Best Wishes,
-Joe