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.
 
 
 
 
 
 

54 lines
1.4 KiB

using Google.Protobuf.WellKnownTypes;
namespace SogClient
{
/// <summary>
/// 玩家一些缓存
/// </summary>
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;
}
/// <summary>
/// 只加载需要的数据
/// </summary>
/// <param name="roleBase"></param>
/// <param name="roleData"></param>
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();
}
}
}