public void AddPlayerChatItem(MyPlayerChatItem chatItem, long senderId) { MyPlayerChatHistory playerChat; if (PlayerChatHistory.TryGetValue(senderId, out playerChat)) { if (playerChat.Chat.Count == MyChatConstants.MAX_PLAYER_CHAT_HISTORY_COUNT) { playerChat.Chat.Dequeue(); } playerChat.Chat.Enqueue(chatItem); } else { var newChatHistory = new Entities.Character.MyPlayerChatHistory(senderId); newChatHistory.Chat.Enqueue(chatItem); PlayerChatHistory.Add(senderId, newChatHistory); } }
public void AddPlayerChatItem(MyPlayerChatItem chatItem, long senderId) { MyPlayerChatHistory playerChat; if (PlayerChatHistory.TryGetValue(senderId, out playerChat)) { if (playerChat.Chat.Count == MyChatConstants.MAX_PLAYER_CHAT_HISTORY_COUNT) { playerChat.Chat.Dequeue(); } playerChat.Chat.Enqueue(chatItem); } else { var newChatHistory = new Entities.Character.MyPlayerChatHistory(senderId); newChatHistory.Chat.Enqueue(chatItem); PlayerChatHistory.Add(senderId, newChatHistory); } }