Example #1
0
 public void SendPacket(SpheroCommandPacket packet)
 {
     // Each packet we send has an updated sequence number.
     packet.SequenceNumber = GetNextSequenceNumber();
     RegisterSentPacket(packet);
     Stream.Write(packet.Data, 0, packet.Data.Length);
 }
Example #2
0
 private void RegisterSentPacket(SpheroCommandPacket packet)
 {
     SentPackets.Add(packet);
     if (SentPackets.Count > _numberOfPacketsToLog)
     {
         SentPackets.RemoveAt(0);
     }
 }