Position of the stream by bytes
I have code received and listener from client:
byte PacketSize = br.ReadByte();
PacketTypes packetType = (PacketTypes)br.ReadInt16();
Console.WriteLine("Packet: [Size: {0}], Type: {1}", PacketSize, packetType);
Listener.Parse(this, packetType);
I run it is ok but it took bytes --- 00 00 "00" 44 -----
it position of the stream by 2 bytes. I want it to move the location to
read 3 bytes to get the other 44 values. I tried to change the
(PacketTypes) br.ReadInt16 (); into (PacketTypes) br.ReadBytes (3) and
(PacketTypes) br.ReadBytes (int 3), but it gives this error:
Can not convert type 'byte [] 'to' ServerLogin.PacketTypes'
Sorry my english not good and sorry the previous post have a problem when
i copy code @@
No comments:
Post a Comment