Ejemplo n.º 1
0
        public override void OnLobbyMessageReceived(GalaxyID lobbyID, GalaxyID senderID, uint messageID, uint messageLength)
        {
            Dictionary <string, string> messageAndSenderDict = new Dictionary <string, string>();
            ChatController chatMenuController = GameObject.Find("OnlineChat").GetComponent <ChatController>();

            Debug.Log("Message from lobby: \'" + lobbyID + "\', sender: \'" + senderID + "\', with value: \'" + message +
                      "\' received.");
            message = matchmaking.GetLobbyMessage(matchmaking.CurrentLobbyID, ref senderID, messageID);
            messageAndSenderDict.Add("sender", friends.GetFriendPersonaName(senderID));
            messageAndSenderDict.Add("message", message);
            chatLobbyMessageHistory.Add(messageAndSenderDict);
            if (chatMenuController != null)
            {
                chatMenuController.DisplayChatMessage(messageAndSenderDict);
            }
            if (GameManager.Instance != null)
            {
                ((Online2PlayerGameManager)GameManager.Instance).PopChatPrompt();
            }
        }