From be081d1cd3e93b201807ecd5e30288e73d3e96a7 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 11 六月 2024 15:53:59 +0800 Subject: [PATCH] 10130 【后端】福地争夺资源功能(修复配置的系统刷新时间点会刷出超级物品的bug;) --- ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActionControl.py | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActionControl.py index d73ef2d..f37a3c1 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActionControl.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossActionControl.py @@ -25,6 +25,7 @@ import CrossRealmMsg import PyGameData import ChConfig +import CommFunc import datetime import time @@ -275,6 +276,11 @@ endDateStr = curDateStr GameWorld.Log(" 结束日期为空,默认每天,今日为: endDateStr=%s" % endDateStr) + actByWeek = (startDateStr.startswith("W") and endDateStr.startswith("W")) # 按周x开 + if actByWeek: + startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) + GameWorld.Log(" 星期X转化为日期: %s ~ %s" % (startDateStr, endDateStr)) + if hasattr(ipyData, "GetStartTimeList") and hasattr(ipyData, "GetEndTimeList"): startHMStrList = ipyData.GetStartTimeList() endHMStrList = ipyData.GetEndTimeList() @@ -399,10 +405,11 @@ # ipyData 活动时间表信息由跨服服务器同步子服,活动内容取子服自己的 ipyDataDict = {} - for k, v in ipyData.__dict__.items(): - if k in ["NotifyInfoStart", "NotifyInfoEnd", "NotifyInfoLoop", "ServerIDRangeList"]: + methods = CommFunc.get_class_method(ipyData, "Get") # 获取所有Get开头的方法 + for method_name in methods: + if method_name in ["GetNotifyInfoStart", "GetNotifyInfoEnd", "GetNotifyInfoLoop", "GetServerIDRangeList"]: continue - ipyDataDict[k] = v + ipyDataDict[method_name[3:]] = getattr(ipyData, method_name)() ipyDataDict.update({"StartDate":startDateStr, "EndDate":endDateStr}) GameWorld.Log(" ipyDataDict=%s" % ipyDataDict) @@ -446,7 +453,7 @@ GameWorld.Log(" isDayReset=%s,actIDDateTime=%s,actID=%s" % (isDayReset, actIDDateTime, actID)) # 模板ID - if hasattr(ipyData, "TemplateIDList"): + if hasattr(ipyData, "GetTemplateIDList"): templateIDList = ipyData.GetTemplateIDList() templateID = templateIDList[-1] if dayIndex >= len(templateIDList) else templateIDList[dayIndex] -- Gitblit v1.8.0