From 07423ad90ce28a8817671e8266a4aba2ea294935 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 18 三月 2026 17:43:29 +0800
Subject: [PATCH] 571 【荣耀战将】删档测试充值返利

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DeleteTestRebate.py |   74 ++++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py                                                |   17 +++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py                                       |   34 +++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                                   |    1 
 4 files changed, 117 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 7870c7f..c5cb00e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3306,6 +3306,7 @@
 Def_PDict_ShareGameAwardState = "ShareGameAwardState"  # 每日分享游戏领奖记录
 Def_PDict_GoodGameAwardState = "GoodGameAwardState"  # 游戏好评领奖记录
 Def_PDict_LikeGameAwardState = "LikeGameAwardState"  # 游戏点赞领奖记录
+Def_PDict_DeleteTestRebate = "DeleteTestRebate"  # 删档测试返利状态,0-该角色未触发,1-该角色已处理,仅做处理标记,只会发给该平台账号第一个请求的角色
 Def_PDict_RechargeDayAward = "RechargeDayAward"  # 累充每日奖励
 Def_PDict_ADCnt = "ADCnt_%s"  # 今日已领取广告奖励次数,参数(广告ID)
 Def_PDict_EquipViewCacheState = "EquipViewCacheState"  # 本次上线是否同步过装备缓存
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
index 0829142..9dcf009 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
@@ -59,17 +59,18 @@
 #  @param eventParam 事件参数
 #  @param curPlayer 
 #  @return None
-def EventReport(eventActionID, eventParam, curPlayer=None, OperatorID=""):
+def EventReport(eventActionID, eventParam, curPlayer=None, OperatorID="", checkNeed=True):
     # 组成例子 eventParam 的格式必须是 xx=yy&zz=cc
     #  "http://192.168.0.249:12000/event_receiver?EventID=3099&OperatorID=test&PlayerCount=102&Time=2018-02-08 18:30:30&ProductID=snxxz&RegionName=s1"
     
-    reportActionIDList = IpyGameDataPY.GetFuncEvalCfg("EventReport", 3)
-    if reportActionIDList and eventActionID not in reportActionIDList:
-        #GameWorld.DebugLog("非需要汇报的事件ID! %s" % eventActionID)
-        return
-    if eventActionID in IpyGameDataPY.GetFuncEvalCfg("EventReport", 1):
-        #GameWorld.DebugLog("不需要汇报的事件! %s" % eventActionID)
-        return
+    if checkNeed:
+        reportActionIDList = IpyGameDataPY.GetFuncEvalCfg("EventReport", 3)
+        if reportActionIDList and eventActionID not in reportActionIDList:
+            #GameWorld.DebugLog("非需要汇报的事件ID! %s" % eventActionID)
+            return
+        if eventActionID in IpyGameDataPY.GetFuncEvalCfg("EventReport", 1):
+            #GameWorld.DebugLog("不需要汇报的事件! %s" % eventActionID)
+            return
     
     if not curPlayer and not OperatorID:
         return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index b219a6d..0fd83dd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3311,6 +3311,7 @@
             
         #不需要做升级任务, 设置玩家经验
         SetPlayerTotalExp(curPlayer, curTotalExp) 
+        DoDeleteTestRebate(curPlayer)
         return
     
     def __GiveLVMailAward(self, curLV):
@@ -4617,4 +4618,35 @@
         if not curSummon:
             continue
         curSummon.SetSightLevel(sightLevel)
-    return
\ No newline at end of file
+    return
+
+def DoDeleteTestRebate(curPlayer):
+    playerID = curPlayer.GetPlayerID()
+    appID = IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 1)
+    if GameWorld.GetAppIDByAccID(curPlayer.GetAccID()) != appID:
+        #GameWorld.DebugLog("非返利渠道AppID! appID=%s" % appID, playerID)
+        return
+    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DeleteTestRebate):
+        GameWorld.DebugLog("删档测试返利已经处理过,不再请求!", playerID)
+        return
+    if curPlayer.GetLV() < IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 2):
+        GameWorld.DebugLog("等级不足不处理删档测试返利! lv=%s" % curPlayer.GetLV(), playerID)
+        return
+    rebateRate = IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 5)
+    if rebateRate <= 0:
+        GameWorld.DebugLog("没有返利比例不处理!", playerID)
+        return
+    curTime = int(time.time())
+    testEndDate = IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 3) # 删档测试结束日期
+    testEndTime = GameWorld.ChangeTimeStrToNum("%s235959" % testEndDate, ChConfig.TYPE_Time_Format_YmdHMS)
+    if curTime <= testEndTime:
+        GameWorld.DebugLog("删档测试期间不处理删档测试返利! testEndDate=%s" % testEndDate, playerID)
+        return
+    rebateEndDate = IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 4) # 返利结束日期,由公测日期+有效天数得到
+    rebateEndTime = GameWorld.ChangeTimeStrToNum("%s235959" % rebateEndDate, ChConfig.TYPE_Time_Format_YmdHMS)
+    if curTime > rebateEndTime:
+        GameWorld.DebugLog("返利有效期已结束不处理删档测试返利! rebateEndDate=%s" % rebateEndDate, playerID)
+        return
+    import EventReport
+    EventReport.EventReport("DeleteTestRebate", "testEndDate=%s"%(testEndDate), curPlayer, checkNeed=False)
+    return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DeleteTestRebate.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DeleteTestRebate.py
new file mode 100644
index 0000000..94a3658
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_DeleteTestRebate.py
@@ -0,0 +1,74 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_DeleteTestRebate
+#
+# @todo:删档测试返利返回
+# @author hxp
+# @date 2026-03-18
+# @version 1.0
+#
+# 详细描述: 删档测试返利返回
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2026-03-18 18:00"""
+#-------------------------------------------------------------------------------
+
+import GMCommon
+import GameWorld
+from Player import (PlayerControl)
+import IpyGameDataPY
+import DataRecordPack
+import ShareDefine
+import PlayerMail
+import ItemCommon
+import ChConfig
+
+def OnExec(gmCmdDict):
+    
+    errorMsg = ""
+    from GMToolLogicProcess import  ProjSpecialProcess
+    Result, curPlayer = ProjSpecialProcess.GMCmdPlayerValidation(gmCmdDict)
+    if Result != GMCommon.Def_Success:
+        return Result, errorMsg
+    if not curPlayer:
+        return Result, "offline"
+    
+    # 玩家在线,可处理
+    playerID = curPlayer.GetPlayerID()
+    Result = GMCommon.Def_Unknow
+    GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '') 
+    
+    appID = IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 1)
+    playerAppID = GameWorld.GetAppIDByAccID(curPlayer.GetAccID())
+    if playerAppID != appID:
+        return GMCommon.Def_Unknow, "appID error. playerAppID=%s" % playerAppID
+    
+    rebateRate = IpyGameDataPY.GetFuncCfg("DeleteTestRebate", 5)
+    if rebateRate <= 0:
+        return GMCommon.Def_Unknow, "rebateRate is zero."
+    
+    itemID = ItemCommon.GetMoneyItemID(ShareDefine.TYPE_Price_PayCoin)
+    if not itemID:
+        return GMCommon.Def_Unknow, "payCoin itemID error."
+    
+    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DeleteTestRebate):
+        return GMCommon.Def_Unknow, "already rebate."
+    
+    accountPayTotal = GameWorld.ToNumDef(gmCmdDict.get('accountPayTotal', '0'), 0) # 单位,元,支持小数
+    GameWorld.Log("删档测试充值总额: %s" % accountPayTotal, curPlayer.GetPlayerID())
+    # 只要有收到同步,该角色就标记为已处理,如有异常再进行手动补偿
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DeleteTestRebate, 1)
+    
+    if accountPayTotal > 0:
+        rebateMoney = int(accountPayTotal * rebateRate / 100.0 * 100) # 除100为百分比,乘100为coin比例
+        itemList = [[itemID, rebateMoney]]
+        paramList = [accountPayTotal, rebateRate]
+        PlayerMail.SendMailByKey("DeleteTestRebate", playerID, itemList, paramList)
+        
+        resultDict = {"accountPayTotal":accountPayTotal, "rebateRate":rebateRate, "itemID":itemID, "rebateMoney":rebateMoney}
+        DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), GMT_Name, resultDict)
+        
+    return GMCommon.Def_Success
+

--
Gitblit v1.8.0