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); }
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); }