| | |
| | | if not playerTemplateID:
|
| | | return
|
| | |
|
| | | curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | if not curRechargeValue:
|
| | | canAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | if not canAwardValue:
|
| | | return
|
| | |
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", playerTemplateID)
|
| | |
| | | for ipyData in ipyDataList:
|
| | | awardIndex = ipyData.GetAwardIndex()
|
| | | if awardRecord & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog("单笔累充已发放过奖励!awardIndex=%s" % awardIndex)
|
| | | continue
|
| | |
|
| | | singleValue = ipyData.GetSingleRechargeValue()
|
| | | if curRechargeValue < CommFunc.RMBToCoin(singleValue):
|
| | | if not canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog("单笔累充不能领奖!awardIndex=%s" % awardIndex)
|
| | | continue
|
| | | awardRecord |= pow(2, awardIndex)
|
| | |
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def UpdSingleRechargeValue(curPlayer, updRechargeValue, coinType):
|
| | | if updRechargeValue <= 0:
|
| | | def UpdSingleRechargeValue(curPlayer, curRechargeValue, coinType):
|
| | | if curRechargeValue <= 0:
|
| | | return
|
| | |
|
| | | for actInfo in PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_SingleRecharge, {}).values():
|
| | |
| | | GameWorld.ErrLog("单笔累充充值活动数据异常!cfgID=%s,templateID=%s" % (cfgID, templateID), curPlayer.GetPlayerID())
|
| | | continue
|
| | |
|
| | | curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | if curRechargeValue >= updRechargeValue:
|
| | | GameWorld.DebugLog("单笔累充充值活动,未超过当前单笔累充额度,不更新! actNum=%s,curRechargeValue=%s >= updRechargeValue=%s" |
| | | % (actNum, curRechargeValue, updRechargeValue), curPlayer.GetPlayerID())
|
| | | awardIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", templateID)
|
| | | if not awardIpyDataList:
|
| | | continue
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, updRechargeValue)
|
| | | canAwardChange = False
|
| | | canAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | awardRuleType = ipyData.GetAwardRuleType()
|
| | | GameWorld.DebugLog("单笔累充充值活动,actNum=%s,awardRuleType=%s,canAwardValue=%s,curRechargeValue=%s" |
| | | % (actNum, awardRuleType, canAwardValue, curRechargeValue))
|
| | | # 向下兼容所有档次
|
| | | if awardRuleType == 0:
|
| | | for awardIpyData in awardIpyDataList:
|
| | | awardIndex = awardIpyData.GetAwardIndex()
|
| | | singleValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | if canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog(" 已经可领奖,不处理!awardRuleType=%s,awardIndex=%s" % (awardRuleType, awardIndex))
|
| | | continue
|
| | | if curRechargeValue < singleValue:
|
| | | #GameWorld.DebugLog(" 未达到档次额度,不处理!awardRuleType=%s,awardIndex=%s,singleValue=%s" |
| | | # % (awardRuleType, awardIndex, singleValue))
|
| | | continue
|
| | | |
| | | canAwardChange = True
|
| | | canAwardValue |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, canAwardValue)
|
| | | GameWorld.DebugLog(" 设置档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canAwardValue=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canAwardValue))
|
| | | |
| | | # 匹配最高档次
|
| | | elif awardRuleType == 1:
|
| | | for awardIpyData in awardIpyDataList[::-1]:
|
| | | awardIndex = awardIpyData.GetAwardIndex()
|
| | | singleValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | if canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog(" 已经可领奖,不处理!awardRuleType=%s,awardIndex=%s" % (awardRuleType, awardIndex))
|
| | | continue
|
| | | if curRechargeValue < singleValue:
|
| | | #GameWorld.DebugLog(" 未达到档次额度,不处理!awardRuleType=%s,awardIndex=%s,singleValue=%s" |
| | | # % (awardRuleType, awardIndex, singleValue))
|
| | | continue
|
| | | |
| | | canAwardChange = True
|
| | | canAwardValue |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, canAwardValue)
|
| | | GameWorld.DebugLog(" 设置最高档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canAwardValue=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canAwardValue))
|
| | | break
|
| | | |
| | | # 精确匹配对应档次
|
| | | elif awardRuleType == 2:
|
| | | for awardIpyData in awardIpyDataList:
|
| | | awardIndex = awardIpyData.GetAwardIndex()
|
| | | singleValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | if curRechargeValue != singleValue:
|
| | | #GameWorld.DebugLog(" 不等于档次额度,不处理!awardRuleType=%s,awardIndex=%s,singleValue=%s" |
| | | # % (awardRuleType, awardIndex, singleValue))
|
| | | continue
|
| | | if canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog(" 已经可领奖,不处理!awardRuleType=%s,awardIndex=%s" % (awardRuleType, awardIndex))
|
| | | break
|
| | | |
| | | canAwardChange = True
|
| | | canAwardValue |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, canAwardValue)
|
| | | GameWorld.DebugLog(" 设置精确档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canAwardValue=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canAwardValue))
|
| | | break
|
| | | |
| | | else:
|
| | | continue
|
| | | |
| | | if not canAwardChange:
|
| | | continue
|
| | | |
| | | Sync_SingleRechargePlayerInfo(curPlayer, actNum)
|
| | | GameWorld.DebugLog("单笔累充充值活动更新单笔充值额度: actNum=%s,curRechargeValue=%s,updRechargeValue=%s" |
| | | % (actNum, curRechargeValue, updRechargeValue), curPlayer.GetPlayerID())
|
| | |
|
| | | # 线下活动,检查发放奖励
|
| | | if ipyData.GetIsOfflineAct():
|
| | |
| | | GameWorld.DebugLog("找不到该单笔累充活动档位索引奖励!actNum=%s,templateID=%s,awardIndex=%s" % (actNum, templateID, awardIndex), playerID)
|
| | | return
|
| | |
|
| | | singleValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | curRechargeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | singleValue = awardIpyData.GetSingleRechargeValue()
|
| | | canAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | |
|
| | | if curRechargeValue < singleValue:
|
| | | GameWorld.DebugLog("所需单笔充值额度不足,无法领取! templateID=%s,awardIndex=%s,singleValue=(%s) > curRechargeValue(%s)" |
| | | % (templateID, awardIndex, singleValue, curRechargeValue), playerID)
|
| | | if not canAwardValue & pow(2, awardIndex):
|
| | | GameWorld.DebugLog("该档次奖励无法领取! templateID=%s,awardIndex=%s,singleValue=%s,canAwardValue%s" |
| | | % (templateID, awardIndex, singleValue, canAwardValue), playerID)
|
| | | return
|
| | |
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | |
| | |
|
| | | playerActInfo = ChPyNetSendPack.tagMCActSingleRechargePlayerInfo()
|
| | | playerActInfo.ActNum = actNum
|
| | | playerActInfo.HightestSingleRecharge = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | playerActInfo.CanAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeAward % actNum)
|
| | | NetPackCommon.SendFakePack(curPlayer, playerActInfo)
|
| | | return
|
| | |
| | | clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
|
| | | clientPack.IsDayReset = ipyData.GetIsDayReset()
|
| | | clientPack.LimitLV = ipyData.GetLVLimit()
|
| | | clientPack.AwardRuleType = ipyData.GetAwardRuleType()
|
| | | clientPack.AwardInfo = []
|
| | |
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", templateID)
|