示例#1
0
 public TeraPacket(byte[] data)
 {
     try
     {
         Stream = new MemoryStream(data);
         Reader = new BinaryReader(Stream);
         ID     = (PacketHeaderEnum)Reader.ReadByte();
     }
     catch (Exception e)
     {
         Console.WriteLine("[Error] Can't read OverPacket : " + e.ToString());
     }
 }
示例#2
0
 public TeraPacket(PacketHeaderEnum id)
 {
     try
     {
         ID     = id;
         Stream = new MemoryStream();
         Writer = new BinaryWriter(Stream);
         Writer.Write((byte)id);
     }
     catch (Exception e)
     {
         Console.WriteLine("[Error] Can't write OverPacket : " + e.ToString());
     }
 }