| | |
| | | # @date 2018-7-16
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 累计充值活动
|
| | | # 详细描述: 累计充值X元活动,支持多个累充活动同时存在,需要多个运营活动时间表配置
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-7-16 12:00"""
|
| | |
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import CommFunc
|
| | |
|
| | | def GetTemplateID(cfgID, dayIndex):
|
| | | if cfgID == None or dayIndex == None:
|
| | | return 0
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID) |
| | | if not ipyData:
|
| | | return 0
|
| | | templateIDList = ipyData.GetTemplateIDList()
|
| | | 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):
|
| | | isReset = __CheckPlayerTotalRechargeAction(curPlayer)
|
| | | if not isReset:
|
| | | actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
|
| | | # 活动中同步活动信息
|
| | | if actTotalRechargeInfo.get(ShareDefine.ActKey_State):
|
| | | Sync_TotalRechargeActionInfo(curPlayer)
|
| | | Sync_TotalRechargeInfo(curPlayer)
|
| | | |
| | | TransferPlayerActDBKeyValue(curPlayer)
|
| | | |
| | | for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {}).values():
|
| | | actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
|
| | | isReset = __CheckPlayerTotalRechargeAction(curPlayer, actNum)
|
| | | if not isReset:
|
| | | # 活动中同步活动信息
|
| | | if actInfo.get(ShareDefine.ActKey_State):
|
| | | Sync_TotalRechargeActionInfo(curPlayer, actNum)
|
| | | Sync_TotalRechargeInfo(curPlayer, actNum)
|
| | | |
| | | return
|
| | |
|
| | | def RefreshTotalRechargeActionInfo():
|
| | | def TransferPlayerActDBKeyValue(curPlayer):
|
| | | ## 玩家登录时调用,旧版本玩家活动数据转移到新版本字典,线上版本维护之后的版本可删除此代码,线上版本分支 gt_1.100.4
|
| | | |
| | | # 原: 1-常规单日;2-常规多日;3-节日多日
|
| | | # 新:10 11 31
|
| | | transferActNumDict = {1:10, 2:11, 3:31}
|
| | | for actNumOld, actNumNew in transferActNumDict.items():
|
| | | actID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID % actNumOld)
|
| | | if not actID:
|
| | | continue
|
| | | |
| | | templateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeTemplateID % actNumOld)
|
| | | rechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNumOld)
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord % actNumOld)
|
| | | worldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV % actNumOld)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID % actNumNew, actID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID % actNumNew, templateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold % actNumNew, rechargeGold)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNumNew, awardRecord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeWorldLV % actNumNew, worldLV)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID % actNumOld, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID % actNumOld, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold % actNumOld, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNumOld, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeWorldLV % actNumOld, 0)
|
| | | |
| | | GameWorld.Log("累计充值转移玩家活动字典记录: actNumOld=%s,actNumNew=%s,actID=%s,templateID=%s,rechargeGold=%s,awardRecord=%s,worldLV=%s" |
| | | % (actNumOld, actNumNew, actID, templateID, rechargeGold, awardRecord, worldLV), curPlayer.GetPlayerID())
|
| | | |
| | | return
|
| | |
|
| | | def RefreshTotalRechargeActionInfo(actNum):
|
| | | ## 收到GameServer同步的活动信息,刷新活动信息
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if curPlayer.GetID() == 0:
|
| | | continue
|
| | | __CheckPlayerTotalRechargeAction(curPlayer)
|
| | | __CheckPlayerTotalRechargeAction(curPlayer, actNum)
|
| | | return
|
| | |
|
| | | def __CheckPlayerTotalRechargeAction(curPlayer):
|
| | | def __CheckPlayerTotalRechargeAction(curPlayer, actNum):
|
| | | ## 检查玩家累计充值活动数据信息
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | actInfo = GetActInfo(actNum)
|
| | | TotalRechargeID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | |
|
| | | actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
|
| | | TotalRechargeID = actTotalRechargeInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actTotalRechargeInfo.get(ShareDefine.ActKey_State, 0)
|
| | | |
| | | playerTotalRechargeID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID) # 玩家身上的活动ID
|
| | | playerTotalRechargeID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID % actNum) # 玩家身上的活动ID
|
| | |
|
| | | # 活动ID 相同的话不处理
|
| | | if TotalRechargeID == playerTotalRechargeID:
|
| | | #GameWorld.DebugLog("累计充值活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLog("累计充值活动ID不变,不处理!actNum=%s" % actNum, curPlayer.GetPlayerID())
|
| | | return
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV % actNum)
|
| | | templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeTemplateID % actNum)
|
| | |
|
| | | templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeTemplateID)
|
| | | |
| | | GameWorld.DebugLog("累计充值重置! TotalRechargeID=%s,playerTotalRechargeID=%s,state=%s,templateID=%s,playerTemplateID=%s" |
| | | % (TotalRechargeID, playerTotalRechargeID, state, templateID, playerTemplateID), playerID)
|
| | | GameWorld.DebugLog("累计充值重置! actNum=%s,TotalRechargeID=%s,playerTotalRechargeID=%s,state=%s,templateID=%s,playerTemplateID=%s" |
| | | % (actNum, TotalRechargeID, playerTotalRechargeID, state, templateID, playerTemplateID), playerID)
|
| | |
|
| | | # 未领取的奖励邮件发放
|
| | | __SendTotalRechargeMail(curPlayer, playerTemplateID)
|
| | | __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID, TotalRechargeID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID, templateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID % actNum, TotalRechargeID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID % actNum, templateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeWorldLV % actNum, actWorldLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold % actNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum, 0)
|
| | |
|
| | | Sync_TotalRechargeActionInfo(curPlayer)
|
| | | Sync_TotalRechargeInfo(curPlayer)
|
| | | Sync_TotalRechargeActionInfo(curPlayer, actNum)
|
| | | Sync_TotalRechargeInfo(curPlayer, actNum)
|
| | | return True
|
| | |
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID):
|
| | | def __SendTotalRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum):
|
| | | # 未领取的奖励邮件发放
|
| | |
|
| | | if not playerTemplateID:
|
| | | return
|
| | |
|
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
|
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
|
| | | if not curRechargeGold:
|
| | | return
|
| | |
|
| | |
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord)
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum)
|
| | | job = curPlayer.GetJob()
|
| | | for ipyData in ipyDataList:
|
| | | awardIndex = ipyData.GetAwardIndex()
|
| | | if awardRecord & pow(2, awardIndex):
|
| | | continue
|
| | |
|
| | | needGold = ipyData.GetNeedGold()
|
| | | needGold = CommFunc.RMBToCoin(ipyData.GetNeedGold())
|
| | | if curRechargeGold < needGold:
|
| | | 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])
|
| | | batchParamList.append([str(ipyData.GetNeedGold())]) # 钱支持小数,显示参数传字符串
|
| | |
|
| | | if batchPlayerIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, awardRecord)
|
| | | PlayerControl.SendMailBatch("TotalRechargeMail", batchPlayerIDList, batchAddItemList, batchParamList)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum, awardRecord)
|
| | | actType = actNum / 10
|
| | | PlayerControl.SendMailBatch("TotalRechargeMail%s" % actType, batchPlayerIDList, batchAddItemList, batchParamList)
|
| | |
|
| | | return
|
| | |
|
| | | def __GetItemList(itemDict, job, worldLV):
|
| | | #{世界等级范围:{职业:[(物品ID,个数,是否绑定), ...]}}
|
| | | itemInfoDict = GameWorld.GetDictValueByRangeKey(itemDict, worldLV, {})
|
| | | if str(job) not in itemInfoDict:
|
| | | GameWorld.ErrLog('累计充值奖励未配置该职业itemDict=%s,job=%s' % (itemDict, job))
|
| | | return []
|
| | | else:
|
| | | return itemInfoDict[str(job)]
|
| | | |
| | |
|
| | | def AddTotalRechargeGold(curPlayer, addGold):
|
| | | if addGold <= 0:
|
| | | return
|
| | | |
| | |
|
| | | actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
|
| | | if not actTotalRechargeInfo.get(ShareDefine.ActKey_State):
|
| | | GameWorld.DebugLog("累计充值活动当前未开启!")
|
| | | return
|
| | | |
| | | actID = actTotalRechargeInfo.get(ShareDefine.ActKey_ID)
|
| | | templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not actID or not templateID:
|
| | | GameWorld.ErrLog("累计充值活动数据异常!actID=%s,templateID=%s" % (actID, templateID), curPlayer.GetPlayerID())
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID, actID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID, templateID)
|
| | | |
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
|
| | | updRechargeGold = curRechargeGold + addGold
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold, updRechargeGold)
|
| | | Sync_TotalRechargeInfo(curPlayer)
|
| | | GameWorld.DebugLog("玩家累计充值活动: actID=%s,templateID=%s,curRechargeGold=%s,addGold=%s,updRechargeGold=%s" |
| | | % (actID, templateID, curRechargeGold, addGold, updRechargeGold), curPlayer.GetPlayerID())
|
| | | 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
|
| | | |
| | | actID = actInfo.get(ShareDefine.ActKey_ID)
|
| | | templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not actID or not templateID:
|
| | | GameWorld.ErrLog("累计充值活动数据异常!actID=%s,templateID=%s" % (actID, templateID), curPlayer.GetPlayerID())
|
| | | continue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeID % actNum, actID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeTemplateID % actNum, templateID)
|
| | | |
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
|
| | | updRechargeGold = curRechargeGold + addGold
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeGold % actNum, updRechargeGold)
|
| | | 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())
|
| | | return
|
| | |
|
| | | def OnGetTotalRechargeAward(curPlayer, awardIndex):
|
| | | ## 领取累计充值奖励
|
| | |
|
| | | def OnGetTotalRechargeAward(curPlayer, awardIndex, actNum):
|
| | | '''OnGetTotalRechargeAward
|
| | | @param awardIndex: 奖励索引
|
| | | @param actNum: 活动编号,如11 或 12 代表不同的活动
|
| | | '''
|
| | | actNum = GameWorld.ToIntDef(actNum, 0)
|
| | | if actNum <= 0:
|
| | | GameWorld.DebugLog("没有指定领取的累充活动编号! actNum=%s" % actNum)
|
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
|
| | | TotalRechargeID = actTotalRechargeInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actTotalRechargeInfo.get(ShareDefine.ActKey_State, 0)
|
| | | templateID = GetTemplateID(actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID, 0), actTotalRechargeInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | actInfo = GetActInfo(actNum)
|
| | | |
| | | TotalRechargeID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | | templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not state or not templateID:
|
| | | GameWorld.DebugLog("没有累计充值活动,无法领奖!state=%s,templateID=%s" % (state, templateID), playerID)
|
| | | GameWorld.DebugLog("没有累计充值活动,无法领奖!actNum=%s,state=%s,templateID=%s" % (actNum, state, templateID), playerID)
|
| | | return
|
| | |
|
| | | playerTotalRechargeID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID) # 玩家身上的活动ID
|
| | | playerTotalRechargeID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeID % actNum) # 玩家身上的活动ID
|
| | | if TotalRechargeID != playerTotalRechargeID:
|
| | | return
|
| | |
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord)
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum)
|
| | | if awardRecord & pow(2, awardIndex):
|
| | | GameWorld.DebugLog("已经领取过该累计充值活动奖励!awardIndex=%s" % awardIndex, playerID)
|
| | | GameWorld.DebugLog("已经领取过该累计充值活动奖励! actNum=%s,awardIndex=%s" % (actNum, awardIndex), playerID)
|
| | | return
|
| | |
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("TotalRechargeTemplate", templateID)
|
| | |
| | | break
|
| | |
|
| | | if not awardIpyData:
|
| | | GameWorld.DebugLog("找不到该返利活动档位索引奖励!templateID=%s,awardIndex=%s" % (templateID, awardIndex), playerID)
|
| | | GameWorld.DebugLog("找不到该返利活动档位索引奖励!actNum=%s,templateID=%s,awardIndex=%s" % (actNum, templateID, awardIndex), playerID)
|
| | | return
|
| | |
|
| | | needGold = awardIpyData.GetNeedGold()
|
| | | awardItemList = awardIpyData.GetAwardItem().get(str(curPlayer.GetJob()), [])
|
| | | needGold = CommFunc.RMBToCoin(awardIpyData.GetNeedGold())
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), curPlayer.GetJob(), actWorldLV)
|
| | |
|
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
|
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
|
| | | if curRechargeGold < needGold:
|
| | | GameWorld.DebugLog("所需充值仙玉数不足,无法领取!templateID=%s,awardIndex=%s,needGold=%s,curRechargeGold=%s" |
| | | % (templateID, awardIndex, needGold, curRechargeGold), playerID)
|
| | | GameWorld.DebugLog("所需充值额度不足,无法领取!actNum=%s,templateID=%s,awardIndex=%s,needGold=%s,curRechargeGold=%s" |
| | | % (actNum, templateID, awardIndex, needGold, curRechargeGold), playerID)
|
| | | return
|
| | |
|
| | | needSpace = len(awardItemList)
|
| | |
| | | return
|
| | |
|
| | | awardRecord |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord, awardRecord)
|
| | | Sync_TotalRechargeInfo(curPlayer)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum, awardRecord)
|
| | | Sync_TotalRechargeInfo(curPlayer, actNum)
|
| | |
|
| | | notifyKey = awardIpyData.GetNotifyKey()
|
| | | if notifyKey:
|
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), needGold])
|
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), str(awardIpyData.GetNeedGold())]) # 钱支持小数,显示参数传字符串
|
| | |
|
| | | for itemID, itemCount, isBind in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
|
| | | for itemID, itemCount, _ in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | |
|
| | | addDataDict = {"TemplateID":templateID, "NeedGold":needGold, "AwardIndex":awardIndex,
|
| | | "ItemList":str(awardItemList)}
|
| | | "ItemList":str(awardItemList), "ActNum":actNum}
|
| | | DataRecordPack.DR_FuncGiveItem(curPlayer, "TotalRechargeAward", addDataDict)
|
| | | return
|
| | |
|
| | | def Sync_TotalRechargeInfo(curPlayer):
|
| | | def Sync_TotalRechargeInfo(curPlayer, actNum):
|
| | | ## 通知累计充值玩家数据信息
|
| | | playerActInfo = ChPyNetSendPack.tagMCTotalRechargePlayerInfo()
|
| | | playerActInfo.GoldTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold)
|
| | | playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord)
|
| | | playerActInfo.ActNum = actNum
|
| | | playerActInfo.GoldTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
|
| | | playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum)
|
| | | NetPackCommon.SendFakePack(curPlayer, playerActInfo)
|
| | | return
|
| | |
|
| | | def Sync_TotalRechargeActionInfo(curPlayer):
|
| | | def Sync_TotalRechargeActionInfo(curPlayer, actNum):
|
| | | ## 通知累计充值活动信息
|
| | | actTotalRechargeInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_TotalRecharge, {})
|
| | | if not actTotalRechargeInfo:
|
| | | |
| | | actInfo = GetActInfo(actNum)
|
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | |
|
| | | if not actTotalRechargeInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | | |
| | | cfgID = actTotalRechargeInfo.get(ShareDefine.ActKey_CfgID)
|
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActTotalRecharge", cfgID)
|
| | | if not ipyData:
|
| | | return
|
| | |
| | | if not templateIDList:
|
| | | return
|
| | | job = curPlayer.GetJob()
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | actInfo = ChPyNetSendPack.tagMCActTotalRechargeInfo()
|
| | | actInfo.ActNum = actNum
|
| | | actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
|
| | | actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
|
| | | actInfo.LimitLV = ipyData.GetLVLimit()
|
| | |
| | | for ipyData in ipyDataList:
|
| | | awardInfo = ChPyNetSendPack.tagMCTotalRechargeAward()
|
| | | awardInfo.AwardIndex = ipyData.GetAwardIndex()
|
| | | awardInfo.NeedGold = ipyData.GetNeedGold()
|
| | | awardInfo.NeedGold = CommFunc.RMBToCoin(ipyData.GetNeedGold())
|
| | | awardInfo.AwardItem = []
|
| | | awardItemDict = ipyData.GetAwardItem()
|
| | | for itemID, itemCount, isBind in awardItemDict.get(str(job), []):
|
| | | awardItemList = __GetItemList(ipyData.GetAwardItem(), job, actWorldLV)
|
| | | for awardItemInfo in awardItemList:
|
| | | itemID, itemCount = awardItemInfo[:2]
|
| | | isBind = awardItemInfo[2] if len(awardItemInfo) > 2 else 0
|
| | | awardItem = ChPyNetSendPack.tagMCTotalRechargeAwardItem()
|
| | | awardItem.ItemID = itemID
|
| | | awardItem.ItemCount = itemCount
|