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/Item/UseItem/Item_PrizeCoin.py | 2 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 7 +++++--
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 45 ++++++++++++++++++++++++++++++++-------------
PySysDB/PySysDBPY.h | 1 +
4 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 5df7b05..d2b8d44 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1244,6 +1244,7 @@
WORD FirstGoldPrize; //首次充值该档位赠送仙玉
list GainItemList; //获得物品列表[[物品ID,个数,是否绑定], ...]
char NotifyMark; //广播提示
+ BYTE PayType; //充值类型
};
//首充表
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 9189c2b..7bd3602 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1000,6 +1000,7 @@
("WORD", "FirstGoldPrize", 0),
("list", "GainItemList", 0),
("char", "NotifyMark", 0),
+ ("BYTE", "PayType", 0),
),
"FirstGold":(
@@ -3684,7 +3685,8 @@
self.GainGoldPrize = 0
self.FirstGoldPrize = 0
self.GainItemList = []
- self.NotifyMark = ""
+ self.NotifyMark = ""
+ self.PayType = 0
return
def GetRecordID(self): return self.RecordID # 记录ID
@@ -3695,7 +3697,8 @@
def GetGainGoldPrize(self): return self.GainGoldPrize # 赠送仙玉数
def GetFirstGoldPrize(self): return self.FirstGoldPrize # 首次充值该档位赠送仙玉
def GetGainItemList(self): return self.GainItemList # 获得物品列表[[物品ID,个数,是否绑定], ...]
- def GetNotifyMark(self): return self.NotifyMark # 广播提示
+ def GetNotifyMark(self): return self.NotifyMark # 广播提示
+ def GetPayType(self): return self.PayType # 充值类型
# 首充表
class IPY_FirstGold():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_PrizeCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_PrizeCoin.py
index 81e9f5d..cead888 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_PrizeCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_PrizeCoin.py
@@ -32,6 +32,6 @@
ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, ChConfig.ItemDel_PrizeCoin, saveDataDict, isForceDR=True)
orderRMB = useCoin + prizeCoin
- PlayerCoin.PlayerCoinToGoldEx(curPlayer, orderRMB, ChConfig.Def_GiveMoney_UseItem, isAddBourseMoney)
+ PlayerCoin.PlayerItemCTG(curPlayer, orderRMB, ChConfig.Def_GiveMoney_UseItem, isAddBourseMoney)
return True, useCnt
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