| | |
| | | templateID = templateIDList[-1] if dayIndex >= len(templateIDList) else templateIDList[dayIndex]
|
| | | return templateID
|
| | |
|
| | | def GetActInfo(actNum):
|
| | | if ShareDefine.OperationActionName_TotalRecharge not in PyGameData.g_operationActionDict:
|
| | | return {}
|
| | | actNumDict = PyGameData.g_operationActionDict[ShareDefine.OperationActionName_TotalRecharge]
|
| | | if actNum not in actNumDict:
|
| | | return {}
|
| | | return actNumDict[actNum]
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | |
|
| | | for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {}).values():
|
| | |
| | | ## 检查玩家累计充值活动数据信息
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | actInfo = GetActInfo(actNum)
|
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_TotalRecharge, actNum)
|
| | | TotalRechargeID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | |
|
| | |
| | | return True
|
| | |
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum):
|
| | | # 未领取的奖励邮件发放
|
| | | # 邮件发放奖励,适用于活动结束后补发未领取奖励 或 线下活动自动发放满足领取条件的奖励
|
| | |
|
| | | if not playerTemplateID:
|
| | | return
|
| | |
| | |
|
| | | if batchPlayerIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum, awardRecord)
|
| | | actType = actNum / 10
|
| | | PlayerControl.SendMailBatch("TotalRechargeMail%s" % actType, batchPlayerIDList, batchAddItemList, batchParamList)
|
| | | PlayerControl.SendMailBatch("TotalRechargeMail%s" % actNum, batchPlayerIDList, batchAddItemList, batchParamList)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | return itemInfoDict[str(job)]
|
| | |
|
| | |
|
| | | def AddTotalRechargeGold(curPlayer, addGold):
|
| | | def AddTotalRechargeGold(curPlayer, addGold, coinType):
|
| | | if addGold <= 0:
|
| | | return
|
| | |
|
| | | for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {}).values():
|
| | | actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
|
| | | |
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | GameWorld.DebugLog("累计充值活动当前未开启! actNum=%s" % actNum)
|
| | | continue
|
| | | |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not cfgID:
|
| | | continue
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID)
|
| | | if not ipyData:
|
| | | continue
|
| | | |
| | | ctgTypeEffValue = ipyData.GetCTGTypeEffValue()
|
| | | if not ctgTypeEffValue & pow(2, coinType):
|
| | | GameWorld.DebugLog("玩家累计充值活动,充值类型对该活动无效! actNum=%s,coinType=%s,ctgTypeEffValue=%s" |
| | | % (actNum, coinType, ctgTypeEffValue), curPlayer.GetPlayerID())
|
| | | continue
|
| | |
|
| | | actID = actInfo.get(ShareDefine.ActKey_ID)
|
| | |
| | | Sync_TotalRechargeInfo(curPlayer, actNum)
|
| | | GameWorld.DebugLog("玩家累计充值活动: actNum=%s,actID=%s,templateID=%s,curRechargeGold=%s,addGold=%s,updRechargeGold=%s"
|
| | | % (actNum, actID, templateID, curRechargeGold, addGold, updRechargeGold), curPlayer.GetPlayerID())
|
| | | |
| | | # 线下活动,检查发放奖励
|
| | | if ipyData.GetIsOfflineAct():
|
| | | playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV % actNum)
|
| | | __SendTotalRechargeMail(curPlayer, templateID, playerWorldLV, actNum)
|
| | | |
| | | return
|
| | |
|
| | | |
| | | |
| | | def OnGetTotalRechargeAward(curPlayer, awardIndex, actNum):
|
| | | '''OnGetTotalRechargeAward
|
| | | '''领取累计充值奖励
|
| | | @param awardIndex: 奖励索引
|
| | | @param actNum: 活动编号,如11 或 12 代表不同的活动
|
| | | '''
|
| | |
| | | GameWorld.DebugLog("没有指定领取的累充活动编号! actNum=%s" % actNum)
|
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | actInfo = GetActInfo(actNum)
|
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_TotalRecharge, actNum)
|
| | |
|
| | | TotalRechargeID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | |
| | |
|
| | | def Sync_TotalRechargeInfo(curPlayer, actNum):
|
| | | ## 通知累计充值玩家数据信息
|
| | | |
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_TotalRecharge, actNum)
|
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | | |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | if ipyData.GetIsOfflineAct():
|
| | | #线下活动不下发
|
| | | return
|
| | | |
| | | playerActInfo = ChPyNetSendPack.tagMCTotalRechargePlayerInfo()
|
| | | playerActInfo.ActNum = actNum
|
| | | playerActInfo.GoldTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
|
| | |
| | | def Sync_TotalRechargeActionInfo(curPlayer, actNum):
|
| | | ## 通知累计充值活动信息
|
| | |
|
| | | actInfo = GetActInfo(actNum)
|
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_TotalRecharge, actNum)
|
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | |
|
| | |
| | | if not ipyData:
|
| | | return
|
| | |
|
| | | if ipyData.GetIsOfflineAct():
|
| | | #线下活动不下发
|
| | | return
|
| | | |
| | | templateIDList = ipyData.GetTemplateIDList()
|
| | | if not templateIDList:
|
| | | return
|