コード例 #1
0
        public static OutgoingMessage CreateOutgoingMessage(int opcode, byte[] data)
        {
            OutgoingMessage com = new OutgoingMessage();
            com.OperationCode = opcode;
            com.Data = data;
            com.Recipients = null;

            return com;
        }
コード例 #2
0
        public void SendMessage(OutgoingMessage message)
        {
            if (!message.HasBeenEncoded)
                message.EncodeTo(lidgrenClient.CreateMessage());

            lidgrenClient.SendMessage(message.OutgoingPacket, NetDeliveryMethod.ReliableOrdered);
        }
コード例 #3
0
ファイル: NetworkAdapter.cs プロジェクト: bberak/PokerDotNet
 public void SendMessageThroughServer(int port, OutgoingMessage om)
 {
     foreach (IServerNetworkInterface inf in ServerInterfaces)
     {
         if (inf.Port == port)
             inf.SendMessage(om);
     }
 }
コード例 #4
0
ファイル: NetworkAdapter.cs プロジェクト: bberak/PokerDotNet
 public void SendMessageThroughClient(int port, OutgoingMessage om)
 {
     foreach (IClientNetworkInterface inf in ClientInterfaces)
     {
         if (inf.ContactPort == port)
             inf.SendMessage(om);
     }
 }
コード例 #5
0
        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);
            }
        }