From d72e064d804f09b45674213016f5c39051ad7b79 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 22 十二月 2020 18:54:20 +0800 Subject: [PATCH] 8572 【主干】【后端】同步充值类型分类;同步记录流向coinType; --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 45 ++++++++++++++++++++++++++++++++------------- 1 files changed, 32 insertions(+), 13 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py index 589e246..2cb259c 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py @@ -57,6 +57,14 @@ import time + +# 充值点券处理类型 +( +CoinType_Gold, # 直接充仙玉 +CoinType_Buy, # 直购,非直接充仙玉的,如RMB直接购买某个物品或激活某个功能 +CoinType_Item, # 使用物品,类充值仙玉效果,但是有某些功能上的限制,一般是bt版本赠送 +) = range(3) + #--------------------------------------------------------------------- #注意: GetChangeCoinPointTotal 充值点和赠送点总和 # GetPrizeCoinPointTotal 赠送点总和 @@ -165,7 +173,17 @@ orderCoin = orderRMB * 100 addGold = orderRMB * GetCoinRate() addDRDict = {"orderCoin":orderCoin, "isAddBourseMoney":isAddBourseMoney, "eventName":eventName} - DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict) + DoCTGLogic(curPlayer, CoinType_Gold, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict) + return + +def PlayerItemCTG(curPlayer, orderRMB, eventName, isAddBourseMoney): + ## 使用赠送的物品兑换点券,一般用于bt版 + prizeGold = 0 + giveItemList = [] + orderCoin = orderRMB * 100 # 单位,分 + 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): @@ -217,13 +235,13 @@ DataRecordPack.DR_CTGError(curPlayer, "The orderCoin is not equal to the ipyData's RMB(%s)!" % payRMBNum, addDRDict) return - addGold, prizeGold, giveItemList, notifyMark = 0, 0, [], '' + addGold, prizeGold, giveItemList, ctgIpyData = 0, 0, [], None if ipyData.GetCTGID(): - ctgResultInfo = __GetCTGInfoByID(curPlayer, chargeInfo, ipyData.GetCTGID(), eventName, addDRDict, isAddBourseMoney) + ctgResultInfo = __GetCTGInfoByID(curPlayer, ipyData.GetCTGID(), addDRDict) if not ctgResultInfo: return - addGold, prizeGold, giveItemList, notifyMark = ctgResultInfo + addGold, prizeGold, giveItemList, ctgIpyData = ctgResultInfo elif ipyData.GetGiftbagID(): giftbagID = ipyData.GetGiftbagID() @@ -237,7 +255,8 @@ DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict) return - DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark, ipyData) + 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) #充值成功主动查询一次,无充值数量就不会继续查询 if orderID: @@ -248,7 +267,7 @@ curPlayer.SendDBQueryRecharge() return True -def __GetCTGInfoByID(curPlayer, chargeInfo, recordID, eventName, addDRDict, isAddBourseMoney): +def __GetCTGInfoByID(curPlayer, recordID, addDRDict): ## 根据充值数据ID获取充值信息 ipyData = IpyGameDataPY.GetIpyGameData("CTG", recordID) @@ -290,7 +309,6 @@ addGold = ipyData.GetGainGold() # 获得仙玉数 gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给 firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉 - notifyMark = ipyData.GetNotifyMark() prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize actPrizeGold = PlayerActRechargePrize.DoAddPlayerActRechargePrizeCount(curPlayer, recordID) if actPrizeGold: @@ -298,9 +316,10 @@ addDRDict.update({"actRechargePrize":1}) Sync_CoinToGoldCountInfo(curPlayer, [recordID]) - return addGold, prizeGold, giveItemList, notifyMark + return addGold, prizeGold, giveItemList, ipyData -def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark='', ipyData=None): +def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None): + notifyMark = ctgIpyData.GetNotifyMark() if ctgIpyData else "" goldBefore = curPlayer.GetGold() bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney) @@ -333,7 +352,7 @@ 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}) + "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter], "addGold":addGold, "prizeGold":prizeGold, "giveItemList":giveItemList, "coinType":coinType}) DataRecordPack.DR_CTGOK(curPlayer, addDRDict) @@ -351,9 +370,9 @@ #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()) + if ctgIpyData: + PlayerGoldInvest.InvestByCTG(curPlayer, ctgIpyData.GetRecordID()) + GameWorld.Log("Billing: coinType=%s,eventName=%s, %s" % (coinType, eventName, addDRDict), curPlayer.GetPlayerID()) return #=============================================================================== -- Gitblit v1.8.0