private void OnChatPlayerMessage(ChatPlayerMessage chatPlayerMessage) { if (StoreChatMessages) { ChatMessages.Add(chatPlayerMessage); } ChatPlayerMessage?.Invoke(chatPlayerMessage); }
private void GameClientOnChatPlayerMessage(VsadilNestihl.Networking.Messages.Chat.ChatPlayerMessage chatPlayerMessage) { var lobbyPlayer = _lobbyPlayers.Find(x => x.PlayerId == chatPlayerMessage.PlayerId); if (lobbyPlayer == null) { return; } ChatPlayerMessage?.Invoke(lobbyPlayer, chatPlayerMessage.Message); }
private void ChatSendMessage(LobbyPlayer player, string message) { if (message.Length > 1000) { return; } ChatPlayerMessage?.Invoke(player, message); var chatPlayerMessage = new VsadilNestihl.Networking.Messages.Chat.ChatPlayerMessage(player.PlayerId, message); foreach (var lobbyPlayer in GetAllLobbyPlayers().Where(x => x.PlayerHandler != null)) { lobbyPlayer.PlayerHandler.ChatPlayerMessage(chatPlayerMessage); } }