WriteToMessage() public static method

public static WriteToMessage ( NetOutgoingMessage msg, Packet packet ) : void
msg Lidgren.Network.NetOutgoingMessage
packet Packet
return void
Exemplo n.º 1
0
        public static NetSendResult SendMessage(this NetConnection connection, Packet packet, NetDeliveryMethod method = NetDeliveryMethod.ReliableOrdered)
        {
            var msg = server.CreateMessage();

            Packet.WriteToMessage(msg, packet);

            return(connection.SendMessage(msg, method, 0));
        }
Exemplo n.º 2
0
        public static void SendMessage(Packet packet, NetDeliveryMethod method = NetDeliveryMethod.ReliableOrdered)
        {
            if (client == null)
            {
                return;
            }

            NetOutgoingMessage msg = client.CreateMessage();

            Packet.WriteToMessage(msg, packet);
            client.SendMessage(msg, method);
        }