| | |
| | | import time
|
| | | import copy
|
| | |
|
| | |
|
| | | # 充值点券处理类型
|
| | | (
|
| | | CoinType_Gold, # 直接充仙玉
|
| | | CoinType_Buy, # 直购,非直接充仙玉的,如RMB直接购买某个物品或激活某个功能
|
| | | CoinType_Item, # 使用物品,类充值仙玉效果,但是有某些功能上的限制,一般是bt版本赠送
|
| | | ) = range(3)
|
| | |
|
| | | # 充值类型定义
|
| | | PayType_Gold = 2 # 常规仙玉充值
|
| | | PayType_GoldPlus = 3 # 至尊仙玉充值
|
| | |
| | | coinExp = int(orderRMB * oneRMBCoinExp)
|
| | | addGold = coinExp # 此方式增加的仙玉 = 直充经验
|
| | | addDRDict = {"orderCoin":orderCoin, "isAddBourseMoney":isAddBourseMoney, "eventName":eventName}
|
| | | DoCTGLogic(curPlayer, CoinType_Gold, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, coinExp=coinExp)
|
| | | DoCTGLogic(curPlayer, ChConfig.CoinType_Gold, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, coinExp=coinExp)
|
| | | return True
|
| | |
|
| | | def PlayerItemCTG(curPlayer, orderRMB, eventName, isAddBourseMoney, addDataDict={}):
|
| | | ## 使用赠送的物品兑换点券,一般用于bt版
|
| | | ## 使用赠送的物品兑换点券,一般用于bt版,限超级现金
|
| | | # 20210120 港台主干版暂废弃
|
| | | # prizeGold = 0
|
| | | # giveItemList = []
|
| | |
| | | # addGold = orderRMB * GetCoinRate()
|
| | | # addDRDict = {"orderCoin":orderCoin, "eventName":eventName}
|
| | | # addDRDict.update(addDataDict)
|
| | | # DoCTGLogic(curPlayer, CoinType_Item, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | | # DoCTGLogic(curPlayer, ChConfig.CoinType_ItemSuper, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
|
| | | return
|
| | |
|
| | | def DoGMCTG(curPlayer, orderInfo, appID, isAddBourseMoney, eventName):
|
| | |
| | | return
|
| | |
|
| | | coinExp = ipyData.GetCoinExp()
|
| | | coinType = CoinType_Gold if (ctgIpyData and ctgIpyData.GetPayType() in [PayType_Gold, PayType_GoldPlus]) else CoinType_Buy # 规定2为直充,其他为直购
|
| | | DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData, coinExp)
|
| | | 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):
|
| | | return
|
| | |
|
| | | #充值成功主动查询一次,无充值数量就不会继续查询
|
| | | if orderID:
|
| | |
| | |
|
| | | def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, coinExp=0):
|
| | |
|
| | | 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,后台充值的不算真实货币充值
|
| | | ctgRealToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealToday) # 当日真实货币充值Coin数 ,不含后台充值- 今日
|
| | | ctgRealTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealTotal) # 累计真实货币充值Coin数 ,不包后台充值 - 总计
|
| | |
| | | # 功能统一以分存储记录,玩家字典不支持存小数
|
| | |
|
| | | # 所有真实充值均有效的
|
| | | if coinType in [CoinType_Gold, CoinType_Buy]:
|
| | | if coinType in [ChConfig.CoinType_Gold, ChConfig.CoinType_Buy]:
|
| | | #跨服充值排行活动
|
| | | CrossActCTGBillboard.AddCTGRMB(curPlayer, orderCoin)
|
| | | #跨服全民充值
|
| | |
| | | PlayerFamilyRedPacket.OnPlayerRecharge(curPlayer, orderCoin)
|
| | |
|
| | | # 只算充仙玉的
|
| | | if coinType == CoinType_Gold:
|
| | | if coinType == ChConfig.CoinType_Gold:
|
| | | PlayerActRechargeRebateGold.AddRechargeRebateGoldRMB(curPlayer, addGold)
|
| | |
|
| | | #仙界盛典-充值大礼
|
| | |
| | | PlayerNewFairyCeremony.OnFCRecharge(curPlayer)
|
| | | PlayerGoldGift.OnPlayerChargeGold(curPlayer)
|
| | | #累积充值X元
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin)
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin, coinType)
|
| | | PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_CTG, addVIPExp, coinType) # 垃圾分类
|
| | | PlayerActSingleRecharge.UpdSingleRechargeValue(curPlayer, orderCoin, coinType) # 单笔累充
|
| | | PlayerActTurntable.OnPlayerRecharge(curPlayer, orderCoin, coinType) # 转盘
|
| | |
| | | "ctgRealToday":ctgRealToday, "ctgRealTotal":ctgRealTotal, "ctgRealFirstTime":GameWorld.ChangeTimeNumToStr(ctgRealFirstTime) if ctgRealFirstTime else ""})
|
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | | GameWorld.Log("Billing: coinType=%s,eventName=%s, %s" % (coinType, eventName, addDRDict), curPlayer.GetPlayerID())
|
| | | return
|
| | | return True
|
| | |
|
| | | #===============================================================================
|
| | |
|