public void OnPrivateMessage(string nicknameFrom, ChatMessage message) { Console.WriteLine("OnPrivateMessage: {0}: {1}", nicknameFrom, message.MessageText); }
public void SendPrivateMessage(string sendToNick, ChatMessage message) { var sender = _clients[CurrentClient.ClientId]; var receiver = FindClientByNick(sendToNick); if (sender == null || receiver == null) return; receiver.ClientProxy.OnPrivateMessage(sender.User.Nick, message); }
public void OnMessageToRoom(string nicknameFrom, ChatMessage message) { Console.WriteLine("OnMessageToRoom: {0}: {1}", nicknameFrom, message.MessageText); }
public void SendMessageToRoom(ChatMessage message) { var sender = _clients[CurrentClient.ClientId]; if (sender == null) return; Task.Factory.StartNew( () => { try { foreach (var client in _clients.GetAllItems()) { client.ClientProxy.OnMessageToRoom(sender.User.Nick, message); } } catch (Exception) { } } ); }