Exemple #1
0
 public static Packet decode(ref NetIncomingMessage msg)
 {
     Packet p = new Packet (0);
     p.type = msg.ReadByte ();
     p.clientId = msg.ReadInt32 ();
     return p;
 }
Exemple #2
0
 public void SendPacket(Packet pkt, bool secure)
 {
     NetOutgoingMessage outMsg = client.CreateMessage();
     pkt.encode(ref outMsg);
     if(secure)
         client.SendMessage(outMsg, NetDeliveryMethod.ReliableUnordered);
     else
         client.SendMessage(outMsg, NetDeliveryMethod.Unreliable);
 }
Exemple #3
0
 public void SendPacket(Packet pkt)
 {
     SendPacket(pkt, false);
 }
Exemple #4
0
 private void SendPktToAll(Packet pkt, bool secure)
 {
     NetOutgoingMessage outMsg = server.CreateMessage();
     pkt.encode(ref outMsg);
     if (secure)
         server.SendToAll(outMsg, NetDeliveryMethod.ReliableOrdered);
     else
         server.SendToAll(outMsg, NetDeliveryMethod.Unreliable);
 }
Exemple #5
0
 private void SendPktToAll(Packet pkt)
 {
     SendPktToAll(pkt, false);
 }
Exemple #6
0
 private void SendPkt(Packet pkt, NetConnection client)
 {
     SendPkt(pkt, client, false);
 }