Example #1
0
 private void ReadHeader(Stream str)
 {
     Header = str.ReadStruct<Header>();
     if (Header.PacketType != 0 && Header.PacketType != 1)
         throw new InvalidDataException("Unknown packet type; expected 0 or 1, got " + Header.PacketType);
 }
Example #2
0
 private static void PrintHeader(StringBuilder sb, string indention, Header header)
 {
     sb.AppendLine(indention + "[Destiny Header]");
     sb.AppendLine(indention + Indention + "[PacketType: " + header.PacketType + "]");
     sb.AppendLine(indention + Indention + "[Stamp: " + header.Stamp + "]");
 }