| | |
| | |
|
| | | def PlayerCoinToGoldEx(curPlayer, orderRMB, eventName, isAddBourseMoney):
|
| | | ## 直接充值自定义金额
|
| | | |
| | | appID = GameWorld.GetPlayerPlatform(curPlayer)
|
| | | payRMBNum = 1
|
| | | oneRMBIpyData = None # 默认取单位1货币对应充值配置
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetOrderInfoCount()):
|
| | | ipyData = ipyDataMgr.GetOrderInfoByIndex(i)
|
| | | # 单位1元配置,不关联充值ID、礼包ID
|
| | | if appID == ipyData.GetAppID() and ipyData.GetPayRMBNum() == payRMBNum and not ipyData.GetCTGID() and not ipyData.GetGiftbagID():
|
| | | oneRMBIpyData = ipyData
|
| | | break
|
| | | if not oneRMBIpyData:
|
| | | GameWorld.ErrLog("Can not found one RMB pay num orderInfo! appID=%s,payRMBNum=%s" % (appID, payRMBNum), curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | oneRMBCoinExp = oneRMBIpyData.GetCoinExp()
|
| | | |
| | | prizeGold = 0
|
| | | giveItemList = []
|
| | | orderCoin = CommFunc.RMBToCoin(orderRMB)
|
| | | addGold = orderRMB * GetCoinRate()
|
| | | coinExp = int(orderRMB * oneRMBCoinExp)
|
| | | addGold = coinExp # 此方式增加的仙玉 = 直充经验
|
| | | addDRDict = {"orderCoin":orderCoin, "isAddBourseMoney":isAddBourseMoney, "eventName":eventName}
|
| | | DoCTGLogic(curPlayer, CoinType_Gold, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | | return
|
| | | DoCTGLogic(curPlayer, CoinType_Gold, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, coinExp=coinExp)
|
| | | return True
|
| | |
|
| | | def PlayerItemCTG(curPlayer, orderRMB, eventName, isAddBourseMoney):
|
| | | ## 使用赠送的物品兑换点券,一般用于bt版
|
| | | prizeGold = 0
|
| | | giveItemList = []
|
| | | orderCoin = CommFunc.RMBToCoin(orderRMB) # 单位,分
|
| | | addGold = orderRMB * GetCoinRate()
|
| | | addDRDict = {"orderCoin":orderCoin, "eventName":eventName}
|
| | | DoCTGLogic(curPlayer, CoinType_Item, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | | # 20210120 港台主干版暂废弃
|
| | | # prizeGold = 0
|
| | | # giveItemList = []
|
| | | # orderCoin = CommFunc.RMBToCoin(orderRMB) # 单位,分
|
| | | # addGold = orderRMB * GetCoinRate()
|
| | | # addDRDict = {"orderCoin":orderCoin, "eventName":eventName}
|
| | | # DoCTGLogic(curPlayer, CoinType_Item, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | | return
|
| | |
|
| | | def DoGMCTG(curPlayer, orderInfo, appID, isAddBourseMoney, eventName):
|
| | |
| | | DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict)
|
| | | return
|
| | |
|
| | | coinExp = ipyData.GetCoinExp()
|
| | | coinType = CoinType_Gold if (ctgIpyData and ctgIpyData.GetPayType() in [2, 3]) else CoinType_Buy # 规定2为直充,其他为直购
|
| | | DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData)
|
| | | DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData, coinExp)
|
| | |
|
| | | #充值成功主动查询一次,无充值数量就不会继续查询
|
| | | if orderID:
|
| | |
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID])
|
| | | return addGold, prizeGold, giveItemList, ipyData
|
| | |
|
| | | def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None):
|
| | | def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, coinExp=0):
|
| | | notifyMark = ctgIpyData.GetNotifyMark() if ctgIpyData else ""
|
| | | goldBefore = curPlayer.GetGold()
|
| | | bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | |
| | | if notifyMark:
|
| | | PlayerControl.WorldNotify(0, notifyMark, [curPlayer.GetName()])
|
| | |
|
| | | addVIPExp = int(orderCoin / 100 * GetCoinRate())
|
| | | addVIPExp = coinExp
|
| | | PlayerVip.AddVIPExp(curPlayer, addVIPExp)
|
| | |
|
| | | changeCoinPointBefore = curPlayer.GetChangeCoinPointTotal()
|
| | |
| | | changeCoinPointAfter = curPlayer.GetChangeCoinPointTotal()
|
| | | bourseMoneyAfter = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | | addDRDict.update({"gold":[goldBefore, goldAfter], "changeCoinPoint":[changeCoinPointBefore, changeCoinPointAfter], "todayCTGCoinTotal":todayCTGCoinTotal,
|
| | | "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter], "addGold":addGold, "prizeGold":prizeGold, "giveItemList":giveItemList, "coinType":coinType})
|
| | | "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter], "addGold":addGold, "prizeGold":prizeGold, "giveItemList":giveItemList, "coinType":coinType,
|
| | | "coinExp":coinExp})
|
| | |
|
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | |
|