예제 #1
0
        public void SendMessage(EncMessage message)
        {
            Console.WriteLine($"[{DateTime.Now}]: {message.Sender.Username} -> {message.Recipient.Username}");
            foreach (var elem in message.Payload)
            {
                Console.Write((elem == 0x34 ? "[SYN]" : elem.ToString()) + " ");
            }
            Console.WriteLine();

            var sender    = _connectedClients.FirstOrDefault(c => c.Id == message.Sender.Id);
            var recipient = _connectedClients.FirstOrDefault(c => c.Id == message.Recipient.Id);

            if (recipient != null)
            {
                recipient.CallbackChannel.ReceiveNewMessage(message);
            }
        }
예제 #2
0
 public void ReceiveNewMessage(EncMessage message)
 {
     NewMessageReceivedEvent(message);
 }