public void ProcessServerData() { int length = ServerPackets.NextPacketLength(); if (length == 0) { throw new Exception("Server data reader is broken...."); } byte[] data = ServerPackets.GetBytes(length); ushort opCode = BitConverter.ToUInt16(data, 2); Packet_old tmpPacket = new Packet_old(Direction.SC, opCode, data, false); //Debug.Print(DateTime.Now.ToLongTimeString() + " " + tmpPacket.OpName); AppendPacket(tmpPacket); }
public void ProcessClientData() { int length = ClientPackets.NextPacketLength(); if (length == 0) { throw new Exception("Client data reader is broken...."); } byte[] data = ClientPackets.GetBytes(length); ushort opCode = BitConverter.ToUInt16(data, 2); Packet_old tmpPacket = new Packet_old(Direction.CS, opCode, data, false); AppendPacket(tmpPacket); }