using Google.Protobuf.WellKnownTypes; namespace SogClient { /// /// 玩家一些缓存 /// public class PlayerDataCache { private const string Cache_Path_Root = "../PlayerCache/"; private Player m_player; public DBRoleData m_data; public PlayerDataCache(Player player) { m_player = player; } /// /// 只加载需要的数据 /// /// /// public void OnInit(DBRoleBase roleBase, DBRoleData roleData) { m_data = new DBRoleData(); //m_data.Arena = roleData.Arena.Clone(); //m_data.HerosData = roleData.HerosData.Clone(); //m_data.CommanderData = roleData.CommanderData.Clone(); //m_data.TreasureSysData = roleData.TreasureSysData.Clone(); m_data.SysUnlockData = roleData.SysUnlockData.Clone(); //if (roleData.TradeInfo != null) //{ // m_data.TradeInfo = roleData.TradeInfo.Clone(); //} //if (roleData.Mate != null) //{ // m_data.Mate = roleData.Mate.Clone(); //} } public string GetCachePath() { return Cache_Path_Root + m_player.GetUid(); } } }