Quote:
Originally Posted by sarkoplata
Because you are reading 7 BYTES total (uint8 + uint16 + uint32) when there are only 3 bytes in the packet. Your proxy can't read through the end of stream therefore throws an exception, your connection is lost and thus you get DC.
this should work;
Code:
else if (_pck.Opcode == 0x704C)//item usage.
{
byte slot = _pck.ReadUInt8();
short itemtype = _pck.ReadUInt16();
}
|
actually it doesnt work either :S
so by what ur saying this should work as well:
HTML Code:
byte slot1 = _pck.ReadUInt8();
byte slot2 = _pck.ReadUInt8();
byte slot3 = _pck.ReadUInt8();
//edit:
here is the strangest thing:
Code:
if (_pck.Opcode == 0x704C)//item usage.
{
int count = packet_bytes.Length;
for (int x = 0; x < count; ++x)
{
byte first = _pck.ReadUInt8();
Console.WriteLine(first);
}
}
made this littile loop so the packet reads itself until the max bytes length is reached, this way it will print all the data from the packet, but here is the strange part, it seems like it gets stuck after reading the first byte, it never goes beyond it even though the packet contains 3/4 bytes.