//缓存世界频道内容 public void CacheWorldMessage(uint serverId, int chatType, ulong characterId, string characterName, ChatMessageContent content) { var Horn = new HornMessage { ServerId = serverId, ChatType = chatType, CharacterId = characterId, CharacterName = characterName, Content = content }; List <HornMessage> tempList; if (ChatManager.mCacheWorlds.TryGetValue(serverId, out tempList)) { if (tempList.Count > 20) { tempList.RemoveAt(0); } tempList.Add(Horn); } else { tempList = new List <HornMessage>(); ChatManager.mCacheWorlds[serverId] = tempList; tempList.Add(Horn); } }
public void PushHornMessage(uint serverId, int chatType, ulong characterId, string characterName, ChatMessageContent content) { if (ChatManager.HornTrigger == null) { BroadcastServerIdMessage(serverId, chatType, characterId, characterName, content); CreateHornTrigger(); } else { var Horn = new HornMessage { ServerId = serverId, ChatType = chatType, CharacterId = characterId, CharacterName = characterName, Content = content }; ChatManager.Horns.Add(Horn); } }