| | |
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import PlayerTJG
|
| | | import CommFunc
|
| | | import ChEquip
|
| | |
|
| | | import time
|
| | |
| | | # @param curPlayer: 玩家
|
| | | # @param addGold: 充元宝数
|
| | | # @return: None
|
| | | def OnPlayerChargeGold(curPlayer, addGold):
|
| | | def OnPlayerChargeGold(curPlayer):
|
| | | DayChargeRedPackAward(curPlayer)
|
| | |
|
| | | firstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
|
| | |
| | | if not ipyData:
|
| | | return
|
| | |
|
| | | getRecharge = ipyData.GetRecharge()
|
| | | needCoin = CommFunc.RMBToCoin(ipyData.GetNeedRMB())
|
| | | # 检查可否领取
|
| | |
|
| | | # 玩家充值小于领取充值
|
| | | if curPlayer.GetChangeCoinPointTotal()/100 < getRecharge:
|
| | | GameWorld.ErrLog("OnGetHistoryRechargeAward error:getRecharge=%s greater than ChangeCoinPointTotal=%s" % (getRecharge, curPlayer.GetChangeCoinPointTotal()))
|
| | | if curPlayer.GetChangeCoinPointTotal() < needCoin:
|
| | | GameWorld.ErrLog("OnGetHistoryRechargeAward error:needCoin=%s greater than ChangeCoinPointTotal=%s" |
| | | % (needCoin, curPlayer.GetChangeCoinPointTotal()))
|
| | | return
|
| | | awardInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HistoryChargeAwardGetRecord, 0)
|
| | | awardMark = pow(2, awardID)
|
| | | if awardInfo & awardMark:
|
| | | #已领取
|
| | | GameWorld.DebugLog("已领取历史充值奖励!awardID=%s,getRecharge=%s" % (awardID, getRecharge))
|
| | | GameWorld.DebugLog("已领取历史充值奖励!awardID=%s,needCoin=%s" % (awardID, needCoin))
|
| | | return
|
| | |
|
| | | job = curPlayer.GetJob()
|
| | |
| | | Sync_HistoryChargeAwardGetRecordInfo(curPlayer)
|
| | |
|
| | | # 记录领取事件
|
| | | DataRecordPack.SendEventPack("HistoryRechargeAward", {'awardID':awardID, 'getRecharge':getRecharge}, curPlayer)
|
| | | DataRecordPack.SendEventPack("HistoryRechargeAward", {'awardID':awardID, 'needCoin':needCoin}, curPlayer)
|
| | | return
|
| | |
|
| | |
|