using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog; using ProtoCSStruct; using Sog.Data; namespace PlayerOp { public struct ExchangeCodeStrcut : 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 bool NeedSave; private DataSeqSave dataSeqSave; public DataSeqSave GetDataSeqSave() { if (dataSeqSave == null) { return dataSeqSave = new DataSeqSave(); } return dataSeqSave; } public void setNeedSave(bool b) { NeedSave = b; if (NeedSave) { GetDataSeqSave().MakeDirty(); } } public bool getNeedSave() { return NeedSave || dataSeqSave.IsDirty(); } public ExchangeConfigure data; } public class ExchangeCodeCache: IServerDataObj { //兑换码索引map public Dictionary m_codeMap = new Dictionary(); //兑换码id索引map public Dictionary m_codeIdMap = new Dictionary(); //动态激活码缓存 public Dictionary m_uidCodeMap = new Dictionary(); public int m_maxCodeId; //public List m_exchangeCodeList = new List(); //public int m_curExchangeId = 0; //兑换码分配id public bool m_isLoadExchangeDB = false; //是否加载 public long m_lastLoadExchangeDBTime;//最后加载时间 public long m_lastSaveExchangeDBTime;//最后保存时间 public long m_lastSynExchangeCodeTime; //最后同步兑换码时间 public long m_lastTickSaveTime = 0; public List m_tickSaveList = new List(); public int m_tickSaveIndex = 0; //public Dictionary exchangeCode = new Dictionary(); public ExchangeCodeCache(int cacheCount) { //m_cache = new StructMemoryCache(cacheCount + 1); } public override int GetDataType() { return PlayerOpDataObjType.ExchangeCodeCache; } } }