You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.3 KiB
112 lines
3.3 KiB
/*
|
|
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<SysNoticeLampObj> m_sysNoticeLampList;
|
|
// 通过gm或者web临时添加的走马灯, desc.id是operationNoticeLampSeq
|
|
public uint operationNoticeLampSeq;
|
|
// m_WebLampDescList只保存web添加的走马灯, gm添加的直接插入SystemLampObj
|
|
public List<FakeLampDesc> m_WebLampDescList;
|
|
|
|
|
|
public int m_sysNoticeSeq;
|
|
public List<SysNoticeObj> m_sysNoticeList;
|
|
public ChatCache m_chatCacheInfo;
|
|
public Dictionary<long, long> m_ChatChannelSeqDic;
|
|
public Dictionary<string, string> m_noticeBackgrounds;
|
|
|
|
|
|
//脏词数据
|
|
public DirtyString m_dirtyStringData;
|
|
|
|
// 一个cluster下所有的realm简要信息, 包含其他world的
|
|
public Dictionary<int, RealmBriefInfo> m_allRealmMap = new Dictionary<int, RealmBriefInfo>();
|
|
public string recvRealmListMd5;
|
|
//大realm包含的realmid
|
|
public Dictionary<int, List<int>> m_bigRealmDict = new Dictionary<int, List<int>>();
|
|
|
|
public ChatServerData(ServerApp app)
|
|
{
|
|
m_app = app;
|
|
m_packetSender = new StructPacketSender();
|
|
m_packetSender.Init(app.ServerID, app.GetCluster());
|
|
|
|
m_sysNoticeLampList = new List<SysNoticeLampObj>();
|
|
m_sysNoticeList = new List<SysNoticeObj>();
|
|
|
|
operationNoticeLampSeq = 9000;
|
|
m_WebLampDescList = new List<FakeLampDesc>();
|
|
m_ChatChannelSeqDic = new Dictionary<long, long>();
|
|
|
|
m_noticeBackgrounds = new Dictionary<string, string>();
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|