| | |
| | | needStartList = [] # [startDateTime, ...]
|
| | | needEndList = [] # [endDateTime, ...]
|
| | | needNotifyDict = {} # {notifyDateTime:[notifyKey, [参数]], ...}
|
| | | isCustomDay = False
|
| | | activityIpyData = None # 活动中的的配置,取需要处理的配置中开始时间最晚的,反之开关时间头尾相连的时候无法开启后面的活动
|
| | | # 注意:每个活动配置会有多个活动时间点,但是有且只能生效一条活动配置,换句话说就是每个活动配置时间不允许交叉
|
| | | for ipyData in curServerActIpyDataList:
|
| | |
| | | # 按开服天开的
|
| | | if startDateStr.isdigit() and endDateStr.isdigit():
|
| | | startServerDay, endServerDay = int(startDateStr), int(endDateStr)
|
| | | if not isCustomDay:
|
| | | isCustomDay = startServerDay == openServerDay
|
| | | #结束日可能还需要处理广播之类,所以这里需要+1
|
| | | if openServerDay > endServerDay + 1:
|
| | | GameWorld.Log(" 当前开服天超过活动结束开服天,不处理! cfgID=%s,%s ~ %s < openServerDay(%s)" % (cfgID, startDateStr, endDateStr, openServerDay))
|
| | |
| | | GameWorld.Log(" 非合服服务器,不处理! cfgID=%s,%s ~ %s" % (cfgID, startDateStr, endDateStr))
|
| | | continue
|
| | | startMixServerDay, endMixServerDay = int(startDateStr[3:]), int(endDateStr[3:])
|
| | | if not isCustomDay:
|
| | | isCustomDay = startMixServerDay == mixServerDay
|
| | | #结束日可能还需要处理广播之类,所以这里需要+1
|
| | | if mixServerDay > endMixServerDay + 1:
|
| | | GameWorld.Log(" 当前合服天超过活动结束合服天,不处理! cfgID=%s,%s ~ %s < mixServerDay(%s)" % (cfgID, startDateStr, endDateStr, mixServerDay))
|
| | |
| | | endDateStr = "%d-%d-%d" % (endServerDateTime.year, endServerDateTime.month, endServerDateTime.day)
|
| | | GameWorld.Log(" 合服天转化为日期: %s ~ %s" % (startDateStr, endDateStr))
|
| | | elif startDateStr.startswith("W") and endDateStr.startswith("W"):
|
| | | if isCustomDay:
|
| | | GameWorld.Log(" 当前开服合服天存在的定制天,周循环开启的不处理! cfgID=%s,%s ~ %s" % (cfgID, startDateStr, endDateStr))
|
| | | continue
|
| | | startWeekday = int(startDateStr[1:])
|
| | | endWeekday = int(endDateStr[1:])
|
| | | startWeekDate = curDateTime + datetime.timedelta(days=(startWeekday-curWeekday))
|