Esempio n. 1
0
 public static Packet decode(ref NetIncomingMessage msg)
 {
     Packet p = new Packet (0);
     p.type = msg.ReadByte ();
     p.clientId = msg.ReadInt32 ();
     return p;
 }
Esempio n. 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);
 }
Esempio n. 3
0
 public void SendPacket(Packet pkt)
 {
     SendPacket(pkt, false);
 }
Esempio n. 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);
 }
Esempio n. 5
0
 private void SendPktToAll(Packet pkt)
 {
     SendPktToAll(pkt, false);
 }
Esempio n. 6
0
 private void SendPkt(Packet pkt, NetConnection client)
 {
     SendPkt(pkt, client, false);
 }