From eda1e177e9227ce1a60423a77fa03e3a1f60e73d Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 17 三月 2021 17:34:29 +0800 Subject: [PATCH] 8835 【BT2】【主干】【后端】Part3-2 5)新增多日连充(领奖记录支持多个值) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py index 549bd8f..83727bb 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActManyDayRecharge.py @@ -29,6 +29,7 @@ import CommFunc Max_ActDays = 7 # 支持最大活动持续天 +Max_AwardKeyNum = 3 # 支持最大领奖记录key数 def GetTemplateID(cfgID): if not cfgID: @@ -95,7 +96,8 @@ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeID % actNum, actID) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeTempID % actNum, templateID) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeWorldLV % actNum, actWorldLV) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % actNum, 0) + for i in xrange(Max_AwardKeyNum): + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % (actNum, i), 0) for dayIndex in xrange(Max_ActDays): PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex), 0) @@ -115,11 +117,10 @@ playerID = curPlayer.GetPlayerID() batchPlayerIDList, batchAddItemList, batchParamList = [], [], [] - awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % actNum) for ipyData in ipyDataList: awardIndex = ipyData.GetAwardIndex() - if awardRecord & pow(2, awardIndex): + if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward, awardIndex, True, [actNum]): continue needRechargeValue = CommFunc.RMBToCoin(ipyData.GetNeedRMB()) @@ -133,7 +134,7 @@ if finishDays < needDays: continue - awardRecord |= pow(2, awardIndex) + GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward, awardIndex, 1, True, [actNum]) awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItemInfo(), playerWorldLV, []) batchPlayerIDList.append([playerID]) @@ -142,7 +143,6 @@ GameWorld.Log("多日连充活动补发奖励! actNum=%s,playerTemplateID=%s,awardIndex=%s" % (actNum, playerTemplateID, awardIndex)) if batchPlayerIDList: - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % actNum, awardRecord) actType = actNum / 10 PlayerControl.SendMailBatch("ManyDayRechargeMail%s" % actType, batchPlayerIDList, batchAddItemList, batchParamList) @@ -187,8 +187,7 @@ GameWorld.DebugLog("该多日连充活动非活动中,无法领奖!actNum=%s,state=%s,templateID=%s" % (actNum, state, templateID), playerID) return - awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % actNum) - if awardRecord & pow(2, awardIndex): + if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward, awardIndex, True, [actNum]): GameWorld.DebugLog("已经领取过该多日连充活动奖励! actNum=%s,awardIndex=%s" % (actNum, awardIndex), playerID) return @@ -230,8 +229,7 @@ if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList): return - awardRecord |= pow(2, awardIndex) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward % actNum, awardRecord) + GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_ManyDayRechargeAward, awardIndex, 1, True, [actNum]) Sync_ManyDayRechargePlayerInfo(curPlayer, actNum) notifyKey = awardIpyData.GetNotifyKey() @@ -256,7 +254,9 @@ rechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeValue % (actNum, dayIndex)) playerActInfo.DayRechargeValues.append(rechargeValue) playerActInfo.Days = len(playerActInfo.DayRechargeValues) - playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % actNum) + for i in xrange(Max_AwardKeyNum): + playerActInfo.AwardRecord.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ManyDayRechargeAward % (actNum, i))) + playerActInfo.RecordCount = len(playerActInfo.AwardRecord) NetPackCommon.SendFakePack(curPlayer, playerActInfo) return -- Gitblit v1.8.0