private static byte[] PacketToBytes(ProtocolPacket packet) { BinaryDataWriter writer = new BinaryDataWriter(); packet.GetData(writer); return(writer.ToArray()); }
static string PacketToString(ProtocolPacket packet) { TextDataWriter writer = new TextDataWriter(); writer.Write(packet.CommandId.ToString()); packet.GetData(writer); return(writer.ToString()); }