| | |
| | | import PlayerActTotalRecharge
|
| | | import OpenServerCampaign
|
| | | import PlayerWeekParty
|
| | | import PlayerGoldInvest
|
| | | import ItemCommon
|
| | |
|
| | | import time
|
| | |
| | | for i in xrange(ipyDataMgr.GetCTGCount()):
|
| | | ipyData = ipyDataMgr.GetCTGByIndex(i)
|
| | | recordID = ipyData.GetRecordID()
|
| | | if not ipyData.GetCanResetBuyCount():
|
| | | continue
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
|
| | | if not totalBuyCount and not todayBuyCount:
|
| | |
| | | orderInfo = chargeInfo.GetOrderInfo() # 商品编号
|
| | | orderID = chargeInfo.GetOrderID() #订单号,兑换成功后清除
|
| | | isAddBourseMoney = chargeInfo.GetIsAddBourseMoney()
|
| | | if orderID:
|
| | | curPlayer.SendDBFinishRecharge(orderID)
|
| | | |
| | | appID = chargeInfo.GetAppID()
|
| | | if not appID:
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer)
|
| | |
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict)
|
| | | return
|
| | |
|
| | | DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark)
|
| | | DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark, ipyData)
|
| | |
|
| | | #充值成功主动查询一次,无充值数量就不会继续查询
|
| | | if orderID:
|
| | | curPlayer.SendDBFinishRecharge(orderID)
|
| | | #curPlayer.SendDBFinishRecharge(orderID)
|
| | | # 充值成功回报客户端,SDK等会用到
|
| | | Sync_CoinToGoldReport(curPlayer, orderID, orderCoin)
|
| | |
|
| | |
| | | DataRecordPack.DR_CTGError(curPlayer, "Can not find CTG ipyData!", addDRDict)
|
| | | return
|
| | |
|
| | | dailyBuyCount = ipyData.GetDailyBuyCount()
|
| | | addDRDict.update({"recordID":recordID})
|
| | | |
| | | totalBuyCountLimit = ipyData.GetTotalBuyCount()
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | if totalBuyCountLimit:
|
| | | addDRDict.update({"totalBuyCountLimit":totalBuyCountLimit, "totalBuyCount":totalBuyCount})
|
| | | if totalBuyCount >= totalBuyCountLimit:
|
| | | DataRecordPack.DR_CTGError(curPlayer, "Pay count limit total!totalBuyCount=%s" % totalBuyCount, addDRDict)
|
| | | return |
| | | |
| | | dailyBuyCountLimit = ipyData.GetDailyBuyCount()
|
| | | todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
|
| | | if dailyBuyCount:
|
| | | addDRDict.update({"dailyCanBuyCount":dailyBuyCount, "todayBuyCount":todayBuyCount})
|
| | | if todayBuyCount >= dailyBuyCount:
|
| | | if dailyBuyCountLimit:
|
| | | addDRDict.update({"dailyBuyCountLimit":dailyBuyCountLimit, "todayBuyCount":todayBuyCount})
|
| | | if todayBuyCount >= dailyBuyCountLimit:
|
| | | DataRecordPack.DR_CTGError(curPlayer, "Pay count limit today!todayBuyCount=%s" % todayBuyCount, addDRDict)
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCount + 1)
|
| | | |
| | | |
| | | if totalBuyCountLimit:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCount + 1)
|
| | | addDRDict.update({"totalBuyCountUpd":(totalBuyCount + 1)})
|
| | | if dailyBuyCountLimit:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCount + 1)
|
| | | addDRDict.update({"todayBuyCountUpd":(todayBuyCount + 1)})
|
| | | |
| | | giveItemList = ipyData.GetGainItemList()
|
| | | addGold = ipyData.GetGainGold() # 获得仙玉数
|
| | | gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给
|
| | | firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉
|
| | | notifyMark = ipyData.GetNotifyMark()
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCount + 1)
|
| | | prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize
|
| | | |
| | | addDRDict.update({"totalBuyCount":(totalBuyCount + 1)})
|
| | |
|
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID])
|
| | | return addGold, prizeGold, giveItemList, notifyMark
|
| | |
|
| | | def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark=''):
|
| | | def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark='', ipyData=None):
|
| | | goldBefore = curPlayer.GetGold()
|
| | | bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | |
|
| | |
| | | #开服活动
|
| | | OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
|
| | | #投资
|
| | | if ipyData:
|
| | | PlayerGoldInvest.InvestByCTG(curPlayer, ipyData.GetCTGID()) |
| | | GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|