| | |
| | | import CommFunc
|
| | |
|
| | | Max_ActDays = 7 # 支持最大活动持续天
|
| | | Max_AwardKeyNum = 3 # 支持最大领奖记录key数
|
| | |
|
| | | def GetTemplateID(cfgID):
|
| | | if not cfgID:
|
| | |
| | | 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)
|
| | |
|
| | |
| | |
|
| | | 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())
|
| | |
| | | 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])
|
| | |
| | | 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)
|
| | |
|
| | |
| | | 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
|
| | |
|
| | |
| | | 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()
|
| | |
| | | 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
|
| | |
|