public void IncrementPlayerUnreadMessageCount(long otherPlayerId, bool refresh)
        {
            MyPlayerChatHistory chatHistory = MyChatSystem.GetPlayerChatHistory(MySession.Static.LocalPlayerId, otherPlayerId);

            if (chatHistory != null)
            {
                chatHistory.UnreadMessageCount++;
                if (refresh)
                {
                    UpdatePlayerList();
                }
            }
        }
Esempio n. 2
0
        public void OnNewPlayerMessage(long playerId, long senderId)
        {
            var handler = PlayerMessageReceived;

            if (handler != null)
            {
                handler(playerId);
            }
            else if (senderId != MySession.LocalPlayerId)
            {
                var identity = MySession.Static.Players.TryGetIdentity(senderId);
                if (identity != null)
                {
                    MyPlayerChatHistory chatHistory = MyChatSystem.GetPlayerChatHistory(MySession.LocalPlayerId, senderId);
                    if (chatHistory != null)
                    {
                        chatHistory.UnreadMessageCount++;
                    }

                    m_newPlayerMessageNotification.SetTextFormatArguments(identity.DisplayName);
                    ShowNewMessageHudNotification(m_newPlayerMessageNotification);
                }
            }
        }