| | |
| | | if TotalRechargeID == playerTotalRechargeID:
|
| | | #GameWorld.DebugLog("累计充值活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV)
|
| | | templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeTemplateID)
|
| | |
|
| | |
| | | % (TotalRechargeID, playerTotalRechargeID, state, templateID, playerTemplateID), playerID)
|
| | |
|
| | | # 未领取的奖励邮件发放
|
| | | __SendTotalRechargeMail(curPlayer, playerTemplateID)
|
| | | __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID, TotalRechargeID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID, templateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeWorldLV, actWorldLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, 0)
|
| | |
|
| | |
| | | Sync_TotalRechargeInfo(curPlayer)
|
| | | return True
|
| | |
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID):
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV):
|
| | | # 未领取的奖励邮件发放
|
| | |
|
| | | if not playerTemplateID:
|
| | |
| | | continue
|
| | | awardRecord |= pow(2, awardIndex)
|
| | |
|
| | | awardItemList = ipyData.GetAwardItem().get(str(job), [])
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), job, playerWorldLV)
|
| | | batchPlayerIDList.append([playerID])
|
| | | batchAddItemList.append(awardItemList)
|
| | | batchParamList.append([needGold])
|
| | |
| | | PlayerControl.SendMailBatch("TotalRechargeMail", batchPlayerIDList, batchAddItemList, batchParamList)
|
| | |
|
| | | return
|
| | |
|
| | | def __GetItemList(itemDict, job, worldLV):
|
| | | #{世界等级范围:[(物品ID,个数,是否绑定), ...]},若物品ID要区分职业则配{世界等级范围:[({职业:物品ID,..},个数,是否绑定), ...]}
|
| | | itemList = []
|
| | | itemInfoList = GameWorld.GetDictValueByRangeKey(itemDict, worldLV, [])
|
| | | for itemInfo in itemInfoList:
|
| | | if type(itemInfo[0]) == dict:
|
| | | itemID = itemInfo[0].get(job)
|
| | | if not itemID:
|
| | | GameWorld.ErrLog('累计充值奖励未配置该职业itemDict=%s,job=%s'%(itemDict, job))
|
| | | continue
|
| | | else:
|
| | | itemID = itemInfo[0]
|
| | | itemList.append([itemID, itemInfo[1], itemInfo[2]])
|
| | | return itemList
|
| | |
|
| | | def AddTotalRechargeGold(curPlayer, addGold):
|
| | | if addGold <= 0:
|
| | |
| | | return
|
| | |
|
| | | needGold = awardIpyData.GetNeedGold()
|
| | | awardItemList = awardIpyData.GetAwardItem().get(str(curPlayer.GetJob()), [])
|
| | | actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), curPlayer.GetJob(), actWorldLV)
|
| | |
|
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
|
| | | if curRechargeGold < needGold:
|