From dc925938d150b82d50bcbdfd6b0b860be31ba53a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 20 十月 2022 17:06:12 +0800
Subject: [PATCH] 9739 【越南】【BT7】【主干】运营活动下发时间优化(优化累计充值、消费返利活动开始日期与开服定制天交叉时下发开始日期为第8天)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py              |   13 +++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py |    3 ++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py       |    3 ++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py                   |    1 +
 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py                                        |    1 +
 5 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
index bfee180..166ec22 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -257,6 +257,7 @@
                           % (cfgID, actNum, startDateStr, endDateStr, openServerDay, isMixServer, mixServerDay, curDateTime, platformList, serverGroupIDList, serverGroupIDListExcept))
             
             actIDDateTimeSpec = None # 特殊指定的活动ID日期
+            startDateSync = None # 特殊同步前端显示用的开始日期,一般用于与开服前X天交叉的活动
             if actName in ShareDefine.MultiActNumOperationActNameList:
                 # 多活动分组编号的需要把所有配置的 actNum 都登记进来,以确保地图能正确进行逻辑
                 if actNum not in mapServerOperationActionDict[actName]:
@@ -331,6 +332,14 @@
                                                                            % (customMaxServerDateTime.year, customMaxServerDateTime.month, customMaxServerDateTime.day), 
                                                                            ChConfig.TYPE_Time_Format) + datetime.timedelta(days=1)
                             GameWorld.Log("        开服天后可开启的非每日重置活动! 活动ID日期特殊设置为开服定制天结束后一天! cfgID=%s,actIDDateTimeSpec=%s" % (cfgID, actIDDateTimeSpec))
+                            
+                        # 特殊同步的开始日期,无视是否每日重置
+                        if actName in startDateInCustomCanOpenList:
+                            startDateSync = datetime.datetime.strptime("%d-%d-%d 00:00:00" 
+                                                                       % (customMaxServerDateTime.year, customMaxServerDateTime.month, customMaxServerDateTime.day), 
+                                                                       ChConfig.TYPE_Time_Format) + datetime.timedelta(days=1)
+                            startDateSync = "%d-%d-%d" % (startDateSync.year, startDateSync.month, startDateSync.day)
+                            
                 else:
                     GameWorld.Log("        开服常规活动,配置时间格式不支持,不处理! cfgID=%s,startDateStr=%s,endDateStr=%s" % (cfgID, startDateStr, endDateStr))
                     continue
@@ -542,6 +551,10 @@
                     #活动每天的世界等级
                     activityInfoDict[ShareDefine.ActKey_WorldLVList] = GameWorldAverageLv.GetWorldLVListByTime(startDayDate, (endDayDate - startDayDate).days)
                     
+                if startDateSync:
+                    activityInfoDict[ShareDefine.ActKey_StartDateSync] = startDateSync
+                    GameWorld.Log("        startDateSync=%s" % (startDateSync))
+                    
                 dayIndex = (curDateTime - startDayDate).days
                 actIDDateTime = startDayDate
                 isDayRest = 0 if not hasattr(ipyData, "GetIsDayReset") else ipyData.GetIsDayReset()
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 3d8353b..6de589c 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -349,6 +349,7 @@
 ActKey_TemplateID = "TemplateID" # 当前活动模板ID
 ActKey_WorldLV = "WorldLV" # 活动开启时世界等级
 ActKey_WorldLVList = "WorldLVList" # 活动每天的世界等级列表
+ActKey_StartDateSync = "StartDateSync" # 特殊指定同步前端的开始日期
 
 ActKey_ServerIDRangeList = "ServerIDRangeList" # 活动服务器ID范围信息
 ActKey_IpyDataInfo = "IpyDataInfo" # 活动对应 IpyData 信息
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
index b3685c9..a6eca4e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
@@ -280,9 +280,10 @@
     job = curPlayer.GetJob()
     actWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeWorldLV % actNum)
     startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
+    startDateSync = actInfo.get(ShareDefine.ActKey_StartDateSync, startDateStr)
     actInfo = ChPyNetSendPack.tagMCActTotalRechargeInfo()
     actInfo.ActNum = actNum
-    actInfo.StartDate = startDateStr
+    actInfo.StartDate = startDateSync
     actInfo.EndtDate = endDateStr
     actInfo.LimitLV = ipyData.GetLVLimit()
     actInfo.IsDayReset = ipyData.GetIsDayReset()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py
index 1f1dc51..1adb20b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py
@@ -281,9 +281,10 @@
     job = curPlayer.GetJob()
     actWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CostRebateWorldLV % actNum)
     startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
+    startDateSync = actCostRebateInfo.get(ShareDefine.ActKey_StartDateSync, startDateStr)
     actInfo = ChPyNetSendPack.tagMCCostRebateInfo()
     actInfo.ActNum = actNum
-    actInfo.StartDate = startDateStr
+    actInfo.StartDate = startDateSync
     actInfo.EndtDate = endDateStr
     actInfo.LimitLV = ipyData.GetLVLimit()
     actInfo.IsDayReset = ipyData.GetIsDayReset()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 3d8353b..6de589c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -349,6 +349,7 @@
 ActKey_TemplateID = "TemplateID" # 当前活动模板ID
 ActKey_WorldLV = "WorldLV" # 活动开启时世界等级
 ActKey_WorldLVList = "WorldLVList" # 活动每天的世界等级列表
+ActKey_StartDateSync = "StartDateSync" # 特殊指定同步前端的开始日期
 
 ActKey_ServerIDRangeList = "ServerIDRangeList" # 活动服务器ID范围信息
 ActKey_IpyDataInfo = "IpyDataInfo" # 活动对应 IpyData 信息

--
Gitblit v1.8.0