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.
 
 
 
 
 
 

91 lines
2.5 KiB

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<string, long> m_codeMap = new Dictionary<string, long>();
//兑换码id索引map
public Dictionary<int, long> m_codeIdMap = new Dictionary<int, long>();
//动态激活码缓存
public Dictionary<string, long> m_uidCodeMap = new Dictionary<string, long>();
public int m_maxCodeId;
//public List<ExchangeCodeExchangeCodeInfo> m_exchangeCodeList = new List<ExchangeCodeExchangeCodeInfo>();
//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<int> m_tickSaveList = new List<int>();
public int m_tickSaveIndex = 0;
//public Dictionary<string, ExchangeConfigure> exchangeCode = new Dictionary<string, ExchangeConfigure>();
public ExchangeCodeCache(int cacheCount)
{
//m_cache = new StructMemoryCache<ExchangeCodeStrcut>(cacheCount + 1);
}
public override int GetDataType()
{
return PlayerOpDataObjType.ExchangeCodeCache;
}
}
}