From a7d7e5fc4c17ab455ce3a5118fb0c529241454f1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 20 一月 2021 11:07:34 +0800
Subject: [PATCH] 8701 【主干】【后端】活动相关的充值界面显示优化(跨服充值排行活动支持分);
---
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 4 ++--
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_QueryBillboardCross.py | 4 ++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py | 5 +++--
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 8 ++++----
PySysDB/PySysDBPY.h | 4 ++--
ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py | 9 +++++++++
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActCTGBillboard.py | 3 ++-
PySysDB/PySysDBG.h | 2 +-
8 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h
index 66f15ab..58f2a85 100644
--- a/PySysDB/PySysDBG.h
+++ b/PySysDB/PySysDBG.h
@@ -780,7 +780,7 @@
DWORD _TemplateID; //模板ID
WORD OrderA; //名次A
WORD OrderB; //至名次B
- DWORD CTGAtleast; //至少充值RMB
+ float CTGAtleast; //至少充值RMB
list AwardItemList; //奖励物品列表[[物品ID,个数,是否拍品], ...]
};
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 920f616..5b0eae0 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1935,7 +1935,7 @@
struct tagCrossActCTGBillboardDabiao
{
DWORD _TemplateID; //模板ID
- DWORD CTGNeed; //需充值RMB
+ float CTGNeed; //需充值RMB
BYTE AwardIndex; //奖励记录索引,从0开始,同个模板不可重复,不可变更
list AwardItemList; //奖励物品列表[[物品ID,个数,是否拍品], ...]
};
@@ -1947,7 +1947,7 @@
DWORD _TemplateID; //模板ID
WORD OrderA; //名次A
WORD OrderB; //至名次B
- DWORD CTGAtleast; //至少充值RMB
+ float CTGAtleast; //至少充值RMB
list AwardItemList; //奖励物品列表[[物品ID,个数,是否拍品], ...]
};
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py b/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py
index e29d3be..3e65f93 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/CommFunc.py
@@ -546,6 +546,7 @@
# @param maxLen 最大长度
# @return
def GetStrCutoff(srcStr, maxLen):
+ import ShareDefine
if len(srcStr) <= maxLen:
return srcStr
tempComment = srcStr[:maxLen]
@@ -558,3 +559,11 @@
return ""
+def RMBToCoin(floatRMB):
+ ''' 元转为分,统一函数,方便修改及搜索
+ @param floatRMB: 单位元,float 类型,支持 RMB 或 美元
+ @return: 转化为分数值
+ '''
+ # 由于float会有不精确的现象出现xxx.9999999的问题,所以这里计算出的结果向上取整
+ return int(math.ceil(floatRMB * 100))
+
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_QueryBillboardCross.py b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_QueryBillboardCross.py
index 16a067f..83a35a7 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_QueryBillboardCross.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_QueryBillboardCross.py
@@ -72,6 +72,10 @@
"CmpValue3":billboardData.CmpValue3,
}
+ # 20210120 后台没做区分不同版本,暂时用游戏版本代码做返回值区分;(BT版存的是元,主干港台版存的是分,美元支持到分)
+ if billboardType in [ShareDefine.Def_CBT_ActCTG]:
+ billboardDict["CmpValue"] = billboardData.CmpValue / 100.0
+
for k, v in billboardDict.items():
if not v:
billboardDict.pop(k)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActCTGBillboard.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActCTGBillboard.py
index b7970fa..acf9397 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActCTGBillboard.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActCTGBillboard.py
@@ -20,6 +20,7 @@
import PlayerCompensation
import IpyGameDataPY
import GameWorld
+import CommFunc
def OnActIDChange(cfgID, dbTemplateID, state):
## 活动ID变更
@@ -69,7 +70,7 @@
for ipyData in orderIpyDataList:
orderA = ipyData.GetOrderA()
orderB = ipyData.GetOrderB()
- ctgAtleast = ipyData.GetCTGAtleast()
+ ctgAtleast = CommFunc.RMBToCoin(ipyData.GetCTGAtleast())
awardItemList = ipyData.GetAwardItemList()
orderCountTotal = orderB - orderA + 1 # 奖励名次数量
orderCount = 0
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
index 0516bb5..d4a76b4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -641,7 +641,7 @@
("DWORD", "TemplateID", 1),
("WORD", "OrderA", 0),
("WORD", "OrderB", 0),
- ("DWORD", "CTGAtleast", 0),
+ ("float", "CTGAtleast", 0),
("list", "AwardItemList", 0),
),
@@ -1947,7 +1947,7 @@
self.TemplateID = 0
self.OrderA = 0
self.OrderB = 0
- self.CTGAtleast = 0
+ self.CTGAtleast = 0.0
self.AwardItemList = []
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 3677297..eed5e8a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1507,7 +1507,7 @@
"CrossActCTGBillboardDabiao":(
("DWORD", "TemplateID", 1),
- ("DWORD", "CTGNeed", 0),
+ ("float", "CTGNeed", 0),
("BYTE", "AwardIndex", 0),
("list", "AwardItemList", 0),
),
@@ -1516,7 +1516,7 @@
("DWORD", "TemplateID", 1),
("WORD", "OrderA", 0),
("WORD", "OrderB", 0),
- ("DWORD", "CTGAtleast", 0),
+ ("float", "CTGAtleast", 0),
("list", "AwardItemList", 0),
),
@@ -4784,7 +4784,7 @@
def __init__(self):
self.TemplateID = 0
- self.CTGNeed = 0
+ self.CTGNeed = 0.0
self.AwardIndex = 0
self.AwardItemList = []
return
@@ -4801,7 +4801,7 @@
self.TemplateID = 0
self.OrderA = 0
self.OrderB = 0
- self.CTGAtleast = 0
+ self.CTGAtleast = 0.0
self.AwardItemList = []
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py
index 965bf5c..6c0e1fe 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossActCTGBillboard.py
@@ -26,6 +26,7 @@
import IPY_GameWorld
import IpyGameDataPY
import GameWorld
+import CommFunc
def OnPlayerLogin(curPlayer):
isReset = __CheckPlayerCrossActCTGBillboard(curPlayer)
@@ -109,7 +110,7 @@
for ipyData in ipyDataList:
ctgNeed = ipyData.GetCTGNeed()
awardIndex = ipyData.GetAwardIndex()
- if totalRMB < ctgNeed:
+ if totalRMB < CommFunc.RMBToCoin(ctgNeed):
continue
if awardRecord & pow(2, awardIndex):
continue
@@ -148,7 +149,7 @@
awardItemList = []
for ipyData in ipyDataList:
- ctgNeed = ipyData.GetCTGNeed()
+ ctgNeed = CommFunc.RMBToCoin(ipyData.GetCTGNeed())
if awardIndex == ipyData.GetAwardIndex():
if totalRMB < ctgNeed:
GameWorld.DebugLog("充值额度未达标,无法领取! awardIndex=%s,totalRMB=%s,ctgNeed=%s"
--
Gitblit v1.8.0