/* Sog 游戏基础库 2016 by zouwei */ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using ProtoCSStruct; using Sog; using Sog.Service; namespace Mail { public class PlayerVerChange { public long uid; public long version; public int param1; } public class MailServerData : IServerDataObj { public ServerApp m_app; public StructPacketSender m_packetSender; // uid public Dictionary m_playerTable = new Dictionary(); public List m_playerForUpdate; //发邮件列表,版本号控制 public SendMailWithRuleDataToFile m_mailWithRule; public bool mailWithRuleNeedSave = false; public MailLangContentData m_mailLang = new MailLangContentData(); /// /// 缓存消息队列,先进的先处理 /// 需要线程安全,所以用ConcurrentQueue,这个比加锁效率高 /// //public ConcurrentQueue m_versionChangeQueue = new ConcurrentQueue(); public ConcurrentQueue m_threadSafePacketQueue = new ConcurrentQueue(); public MailServerData(ServerApp app) { m_app = app; m_packetSender = new StructPacketSender(); m_packetSender.Init(app.ServerID, app.GetCluster()); } public override int GetDataType() { return MailDataObjType.MailServerData; } } }