public static void ModifyDailyActiveInfor(GameClient client, uint value, DailyActiveDataField1 field, bool writeToDB = false) { List <uint> lsUint = Global.GetRoleParamsUIntListFromDB(client, "DailyActiveInfo1"); while (lsUint.Count < (int)(field + 1)) { lsUint.Add(0U); } lsUint[(int)field] = value; Global.SaveRoleParamsUintListToDB(client, lsUint, "DailyActiveInfo1", writeToDB); }
/// <summary> /// 获得每日活跃数据 /// </summary> /// <returns></returns> public static uint GetDailyActiveDataByField(GameClient client, DailyActiveDataField1 field) { List <uint> lsUint = Global.GetRoleParamsUIntListFromDB(client, RoleParamName.DailyActiveInfo1); int index = (int)field; if (index >= lsUint.Count) { return(0); } return(lsUint[index]); }
/// <summary> /// 修改每日活跃数据 /// </summary> /// <returns></returns> public static void ModifyDailyActiveInfor(GameClient client, UInt32 value, DailyActiveDataField1 field, bool writeToDB = false) { List <uint> lsUint = Global.GetRoleParamsUIntListFromDB(client, RoleParamName.DailyActiveInfo1); int index = (int)field; while (lsUint.Count < (index + 1)) { lsUint.Add(0); } lsUint[index] = value; Global.SaveRoleParamsUintListToDB(client, lsUint, RoleParamName.DailyActiveInfo1, writeToDB); }
public static uint GetDailyActiveDataByField(GameClient client, DailyActiveDataField1 field) { List <uint> lsUint = Global.GetRoleParamsUIntListFromDB(client, "DailyActiveInfo1"); uint result; if (field >= (DailyActiveDataField1)lsUint.Count) { result = 0U; } else { result = lsUint[(int)field]; } return(result); }