public static OutgoingMessage CreateOutgoingMessage(int opcode, byte[] data)
        {
            OutgoingMessage com = new OutgoingMessage();
            com.OperationCode = opcode;
            com.Data = data;
            com.Recipients = null;

            return com;
        }
        public void SendMessage(OutgoingMessage message)
        {
            if (!message.HasBeenEncoded)
                message.EncodeTo(lidgrenClient.CreateMessage());

            lidgrenClient.SendMessage(message.OutgoingPacket, NetDeliveryMethod.ReliableOrdered);
        }
Exemple #3
0
 public void SendMessageThroughServer(int port, OutgoingMessage om)
 {
     foreach (IServerNetworkInterface inf in ServerInterfaces)
     {
         if (inf.Port == port)
             inf.SendMessage(om);
     }
 }
Exemple #4
0
 public void SendMessageThroughClient(int port, OutgoingMessage om)
 {
     foreach (IClientNetworkInterface inf in ClientInterfaces)
     {
         if (inf.ContactPort == port)
             inf.SendMessage(om);
     }
 }
        public void SendMessage(OutgoingMessage om)
        {
            if (!om.HasBeenEncoded)
                om.EncodeTo(lidgrenServer.CreateMessage());

            List<NetConnection> recipients = Resolve(om.Recipients);

            if (recipients.Count > 0)
            {
                lidgrenServer.SendMessage(om.OutgoingPacket,
                    recipients,
                    om.DeliveryMethod,
                    om.SequenceChannel);
            }
        }