| | |
| | | PayOrderType_PayCoin, # 代币 6
|
| | | ) = range(1, 1 + 6)
|
| | |
|
| | | PayOrderType_Default = PayOrderType_VND
|
| | |
|
| | | # 充值类型定义
|
| | | PayType_Gold = 2 # 常规仙玉充值
|
| | | PayType_GoldPlus = 3 # 至尊仙玉充值
|
| | | PayType_GrowupBuy = 16 # 成长必买
|
| | | PayType_PayCoin = 17 # 代币充值
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #注意: GetChangeCoinPointTotal 充值点和赠送点总和
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("OrderInfo", orderInfo, appID)
|
| | | if not ipyData:
|
| | | return
|
| | | if "@9997@" in curPlayer.GetAccID():
|
| | | orderCoin = CommFunc.RMBToCoin(ipyData.GetUsdMoney())
|
| | | else:
|
| | | orderCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum()) |
| | | cPlayerCoin = CPY_PlayerCoinToGold()
|
| | | cPlayerCoin.useCoin = orderCoin
|
| | | cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
|
| | | cPlayerCoin.orderInfo = orderInfo
|
| | | cPlayerCoin.appID = appID
|
| | | cPlayerCoin.orderID = ""
|
| | |
| | | '''
|
| | | orderInfo = addDRDict.get("orderInfo", "")
|
| | | orderCoin = addDRDict.get("orderCoin", 0)
|
| | | payOrderType = addDRDict.get("payOrderType", PayOrderType_RMB)
|
| | | payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
|
| | | if not orderCoin or not orderInfo:
|
| | | DataRecordPack.DR_CTGError(curPlayer, errorInfo, addDRDict)
|
| | | return
|
| | |
| | | return
|
| | |
|
| | | cPlayerCoin = CPY_PlayerCoinToGold()
|
| | | if "@9997@" in curPlayer.GetAccID():
|
| | | cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetUsdMoney())
|
| | | else:
|
| | | cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
|
| | | cPlayerCoin.useCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum())
|
| | | cPlayerCoin.orderInfo = orderInfo
|
| | | cPlayerCoin.appID = appID
|
| | | cPlayerCoin.isAddBourseMoney = isAddBourseMoney
|
| | |
| | | # @param useCoin 使用的点卷
|
| | | # @param eventName 兑换事件名
|
| | | # @return None
|
| | | def PlayerCoinToGold(curPlayer, chargeInfo, eventName, payOrderType=PayOrderType_RMB):
|
| | | def PlayerCoinToGold(curPlayer, chargeInfo, eventName, payOrderType=PayOrderType_Default):
|
| | | ## 按商品编号充值
|
| | | orderCoin = chargeInfo.GetCoin() # 金额 已乘以100 人民币单位为分
|
| | | orderCoin = chargeInfo.GetCoin()
|
| | | #notePrizeCoin = chargeInfo.GetPrizeCoin()
|
| | | orderInfo = chargeInfo.GetOrderInfo() # 商品编号
|
| | | orderID = chargeInfo.GetOrderID() #订单号,兑换成功后清除
|
| | |
| | | DataRecordPack.DR_CTGError(curPlayer, "Can not found the orderInfo.", addDRDict)
|
| | | return
|
| | |
|
| | | # quick海外用美元验证
|
| | | if "@9997@" in curPlayer.GetAccID():
|
| | | GameWorld.Log("quikc海外充值验证美元: orderInfo=%s,orderCoin=%s,orderID=%s" % (orderInfo, orderCoin, orderID), curPlayer.GetPlayerID())
|
| | | orderCoinUsd = orderCoin # 入库的是美元分
|
| | | orderCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum()) # 游戏内orderCoin转化为人民币
|
| | | usdMoney = ipyData.GetUsdMoney()
|
| | | GameWorld.Log(" 转化后: orderInfo=%s,orderCoin=%s,orderCoinUsd=%s" % (orderInfo, orderCoin, orderCoinUsd), curPlayer.GetPlayerID())
|
| | | addDRDict["orderCoin"] = orderCoin
|
| | | addDRDict["orderCoinUsd"] = orderCoinUsd
|
| | | if orderCoinUsd != CommFunc.RMBToCoin(usdMoney):
|
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderCoinUsd is not equal to the ipyData's UsdMoney(%s)!" % usdMoney, addDRDict)
|
| | | return
|
| | | else:
|
| | | payRMBNum = ipyData.GetPayRMBNum() # 单位,元
|
| | | if orderCoin != CommFunc.RMBToCoin(payRMBNum):
|
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderCoin is not equal to the ipyData's RMB(%s)!" % payRMBNum, addDRDict)
|
| | | return
|
| | | |
| | | # 港台0.1折特殊处理:游戏内部逻辑按原版原价处理,所以验证完金额后需要乘100
|
| | | orderCoin *= 100
|
| | | addDRDict["orderCoin"] = orderCoin
|
| | | payRMBNum = ipyData.GetPayRMBNum() # 越南版本配表及coin均使用越南盾原值
|
| | | if orderCoin != CommFunc.RMBToCoin(payRMBNum):
|
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderCoin is not equal to the ipyData's RMB(%s)!" % payRMBNum, addDRDict)
|
| | | return
|
| | |
|
| | | if payOrderType == PayOrderType_PayCoin:
|
| | | #直接扣,类似充值扣钱,这里是发放物品,可能会有发放失败的当做 CTGError 处理
|
| | |
| | |
|
| | | addDRDict["payOrderType"] = payOrderType
|
| | |
|
| | | addGold, prizeGold, giveItemList, ctgIpyData = 0, 0, [], None
|
| | | moneyType, addGold, prizeGold, giveItemList, ctgIpyData = 0, 0, 0, [], None
|
| | |
|
| | | if ipyData.GetCTGID():
|
| | | ctgResultInfo = __GetCTGInfoByID(curPlayer, ipyData.GetCTGID(), addDRDict)
|
| | | if not ctgResultInfo:
|
| | | return
|
| | | addGold, prizeGold, giveItemList, ctgIpyData = ctgResultInfo
|
| | | moneyType, addGold, prizeGold, giveItemList, ctgIpyData = ctgResultInfo
|
| | |
|
| | | elif ipyData.GetGiftbagID():
|
| | | giftbagID = ipyData.GetGiftbagID()
|
| | |
| | |
|
| | | coinExp = ipyData.GetCoinExp()
|
| | | coinType = ChConfig.CoinType_Gold if (ctgIpyData and ctgIpyData.GetPayType() in [PayType_Gold, PayType_GoldPlus]) else ChConfig.CoinType_Buy # 规定2为直充,其他为直购
|
| | | if not DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData, coinExp):
|
| | | if not DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData, moneyType, coinExp):
|
| | | return
|
| | |
|
| | | #充值成功主动查询一次,无充值数量就不会继续查询
|
| | |
| | | addDRDict.update({"monthBuyCountUpd":monthBuyCountUpd})
|
| | |
|
| | | giveItemList = GetCTGGiveItemList(ipyData)
|
| | | addGold = ipyData.GetGainGold() # 获得仙玉数
|
| | | gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给
|
| | | moneyType = ipyData.GetMoneyType() # 获得货币类型
|
| | | addGold = ipyData.GetGainGold() # 获得货币数
|
| | | gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送货币数,首次充值赠送仙玉时,此仙玉不给
|
| | | firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉
|
| | | prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize
|
| | | actPrizeGold = PlayerActRechargePrize.DoAddPlayerActRechargePrizeCount(curPlayer, recordID)
|
| | | if actPrizeGold:
|
| | | prizeGold += actPrizeGold
|
| | | addDRDict.update({"actRechargePrize":1})
|
| | | |
| | | if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | actPrizeGold = PlayerActRechargePrize.DoAddPlayerActRechargePrizeCount(curPlayer, recordID)
|
| | | if actPrizeGold:
|
| | | prizeGold += actPrizeGold
|
| | | addDRDict.update({"actRechargePrize":1})
|
| | | |
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID])
|
| | | return addGold, prizeGold, giveItemList, ipyData
|
| | | return moneyType, addGold, prizeGold, giveItemList, ipyData
|
| | |
|
| | | def GetCTGGiveItemList(ipyData):
|
| | | ## 获取充值ID对应给物品列表
|
| | |
| | | giveItemList = gainItemList
|
| | | return giveItemList
|
| | |
|
| | | def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, coinExp=0):
|
| | | def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, moneyType=IPY_GameWorld.TYPE_Price_Gold_Money, coinExp=0):
|
| | | |
| | | if ctgIpyData and ctgIpyData.GetPayType() == PayType_PayCoin:
|
| | | # 代币充值,仅给代币,不触发其他内容
|
| | | coinType = ChConfig.CoinType_PayCoin
|
| | | orderInfo = addDRDict.get("orderInfo", "")
|
| | | orderCoin = addDRDict.get("orderCoin", 0)
|
| | | payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | befPayCoin = PlayerControl.GetPayCoin(curPlayer)
|
| | | if addGold and moneyType == ShareDefine.TYPE_Price_PayCoin:
|
| | | drDict = {ChConfig.Def_Give_Reason_SonKey:orderInfo, "payOrderType":payOrderType}
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, addGold, eventName, drDict)
|
| | | aftPayCoin = PlayerControl.GetPayCoin(curPlayer)
|
| | | GameWorld.Log("充值代币: orderInfo=%s,orderCoin=%s,payOrderType=%s,eventName=%s,befPayCoin=%s,aftPayCoin=%s" |
| | | % (orderInfo, orderCoin, payOrderType, eventName, befPayCoin, aftPayCoin), playerID)
|
| | | |
| | | serverDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | addDRDict.update({"coinType":coinType, "PayCoin":[befPayCoin, aftPayCoin], |
| | | "VIPLv":curPlayer.GetVIPLv(), "ServerDay":serverDay, "eventName":eventName})
|
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | | return True
|
| | |
|
| | | if coinType not in [ChConfig.CoinType_Gold, ChConfig.CoinType_Buy, ChConfig.CoinType_ItemSuper]:
|
| | | DataRecordPack.DR_CTGError(curPlayer, "coinType error! coinType(%s)!" % coinType, addDRDict)
|
| | | return
|
| | |
|
| | | isRealMoney = True if addDRDict.get("orderID") else False # 是否真实货币充值,仅真实货币充值订单有orderID,后台充值的不算真实货币充值
|
| | | payOrderType = addDRDict.get("payOrderType", PayOrderType_RMB)
|
| | | payOrderType = addDRDict.get("payOrderType", PayOrderType_Default)
|
| | | if payOrderType == PayOrderType_PayCoin:
|
| | | isRealMoney = True # 代币充值在游戏内容上算真实充值
|
| | | ctgRealToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealToday) # 当日真实货币充值Coin数 ,不含后台充值- 今日
|
| | |
| | | bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | |
|
| | | if addGold:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, addGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, addGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
|
| | |
|
| | | if prizeGold:
|
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, prizeGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, prizeGold, eventName, addDRDict, isGiveBourseMoney=isAddBourseMoney)
|
| | |
|
| | | if giveItemList:
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList, "", event=[ChConfig.ItemGive_CTG, True, copy.deepcopy(addDRDict)])
|