public int GetIPointsLeftMergeNum(GameClient client, int index) { JieriIPointsExchgActivity instance = HuodongCachingMgr.GetJieriIPointsExchgActivity(); int result; if (null == instance) { result = 0; } else { IPointsExchgData ExchgData = null; this.AwardItemDict.TryGetValue(index, out ExchgData); if (ExchgData == null) { result = 0; } else { DateTime startTime = DateTime.Parse(this.FromDate); int currday = Global.GetOffsetDay(startTime); int lastday = 0; int count = 0; string strFlag = "InputPointExchg" + index; string JieRiIPointExchgFlag = Global.GetRoleParamByName(client, strFlag); if (null != JieRiIPointExchgFlag) { string[] fields = JieRiIPointExchgFlag.Split(new char[] { ',' }); if (2 == fields.Length) { lastday = Convert.ToInt32(fields[0]); count = Convert.ToInt32(fields[1]); } } if (currday == lastday) { result = ExchgData.DayMaxTimes - count; } else { result = ExchgData.DayMaxTimes; } } } return(result); }
/// <summary> /// 获取角色活动期间充值点兑换的剩余 /// </summary> /// <param name="client"></param> /// <returns></returns> public int GetIPointsLeftMergeNum(GameClient client, int index) { JieriIPointsExchgActivity instance = HuodongCachingMgr.GetJieriIPointsExchgActivity(); if (null == instance) { return(0); } IPointsExchgData ExchgData = null; AwardItemDict.TryGetValue(index, out ExchgData); if (ExchgData == null) { return(0); } // 每次活动刷新一次 DateTime startTime = DateTime.Parse(FromDate); int currday = Global.GetOffsetDay(startTime); int lastday = 0; int count = 0; string strFlag = RoleParamName.InputPointExchargeFlag + index; String JieRiIPointExchgFlag = Global.GetRoleParamByName(client, strFlag); // day:count if (null != JieRiIPointExchgFlag) { string[] fields = JieRiIPointExchgFlag.Split(','); if (2 == fields.Length) { lastday = Convert.ToInt32(fields[0]); count = Convert.ToInt32(fields[1]); } } if (currday == lastday) { return(ExchgData.DayMaxTimes - count); } return(ExchgData.DayMaxTimes); }