Esempio n. 1
0
        private void OnChatPlayerMessage(ChatPlayerMessage chatPlayerMessage)
        {
            if (StoreChatMessages)
            {
                ChatMessages.Add(chatPlayerMessage);
            }

            ChatPlayerMessage?.Invoke(chatPlayerMessage);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
            }
        }