/* Sog 游戏基础库 2016 by zouwei */ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using ProtoCSStruct; using Sog; namespace Chat { public class ChatServerData : IServerDataObj { public ServerApp m_app; public StructPacketSender m_packetSender; //通知和跑马灯 public int m_sysNoticeLampSeq; public List m_sysNoticeLampList; // 通过gm或者web临时添加的走马灯, desc.id是operationNoticeLampSeq public uint operationNoticeLampSeq; // m_WebLampDescList只保存web添加的走马灯, gm添加的直接插入SystemLampObj public List m_WebLampDescList; public int m_sysNoticeSeq; public List m_sysNoticeList; public ChatCache m_chatCacheInfo; public Dictionary m_ChatChannelSeqDic; public Dictionary m_noticeBackgrounds; //脏词数据 public DirtyString m_dirtyStringData; // 一个cluster下所有的realm简要信息, 包含其他world的 public Dictionary m_allRealmMap = new Dictionary(); public string recvRealmListMd5; //大realm包含的realmid public Dictionary> m_bigRealmDict = new Dictionary>(); public ChatServerData(ServerApp app) { m_app = app; m_packetSender = new StructPacketSender(); m_packetSender.Init(app.ServerID, app.GetCluster()); m_sysNoticeLampList = new List(); m_sysNoticeList = new List(); operationNoticeLampSeq = 9000; m_WebLampDescList = new List(); m_ChatChannelSeqDic = new Dictionary(); m_noticeBackgrounds = new Dictionary(); } public static long GetChatChannelId(ChatChannelType channel, long paramId) { return (long)channel * 10000000 + paramId; } public long GetChannalChatSeq(ChatChannelType channel, long paramId) { long id = GetChatChannelId(channel, paramId); if (!m_ChatChannelSeqDic.ContainsKey(id)) { m_ChatChannelSeqDic.Add(id, 0); } return ++m_ChatChannelSeqDic[id]; } public void SetChannalChatSeq(long seq, ChatChannelType channel, long paramId) { long id = GetChatChannelId(channel, paramId); if (!m_ChatChannelSeqDic.ContainsKey(id)) { m_ChatChannelSeqDic.Add(id, seq); } else { m_ChatChannelSeqDic[id] = Math.Max(seq, m_ChatChannelSeqDic[id]); } } public override int GetDataType() { return ChatDataObjType.ChatServerData; } } public struct ChatCacheDataStruct : IStructObject { public int m_objectID; public int GetObjectID() { return m_objectID; } public void SetObjectID(int id) { m_objectID = id; } public bool IsNull() { return m_objectID == -1; } public CSChatRes cacheData; } }