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