From 505624324cbcd11b44f0db3036fca1ffa562f3b7 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 16 六月 2021 18:29:53 +0800
Subject: [PATCH] 8983 【港台】【BT2】【港台-1.100.7】【BT2-1.100.1】循环相关的活动配置优化(周循环支持配置开始循环日期及结束循环日期,格式: W1|开启日期 或 W7|结束日期)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashSale.py | 13 -
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargeRebateGold.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSpringSale.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGrowupBuy.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActCollectWords.py | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py | 6
ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py | 92 +++++++++---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py | 6
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFairyCeremony.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastTravel.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActXianXiaMJ.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py | 9
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py | 47 +++---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargePrize.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py | 6
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGarbageSorting.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py | 90 +++++++++---
28 files changed, 239 insertions(+), 153 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py
index 3cc7e7a..8fc20e4 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py
@@ -538,31 +538,73 @@
#---------------------------------------------------------------------
-def GetOperationActionDateStr(dateInfo, openServerDay):
- '''获取运营活动对应日期,存数字代表开服天配置,需要转化为对应的日期
- @param dateInfo: 运营活动表配置的日期信息, 如果是纯数字代表开服天
- @param openServerDay: 当前开服天
- '''
- if not dateInfo:
- curDateTime = datetime.datetime.today()
- return "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
- if dateInfo.startswith("W"):
- curDateTime = datetime.datetime.today()
- curWeekday = curDateTime.weekday() + 1
- actionWeekday = int(dateInfo[1:])
- actionDateTime = curDateTime + datetime.timedelta(days=(actionWeekday-curWeekday))
- return "%d-%d-%d" % (actionDateTime.year, actionDateTime.month, actionDateTime.day)
- if dateInfo.startswith("Mix"):
- diffDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay) + 1
- actionServerDay = int(dateInfo[3:])
- elif not dateInfo.isdigit():
- return dateInfo
- else:
- diffDay = openServerDay
- actionServerDay = int(dateInfo)
+def GetOperationActionDateStr(ipyData):
+ ## 获取运营活动对应日期,存数字代表开服天配置,需要转化为对应的日期
curDateTime = datetime.datetime.today()
- actionDateTime = curDateTime + datetime.timedelta(days=(actionServerDay-diffDay))
- return "%d-%d-%d" % (actionDateTime.year, actionDateTime.month, actionDateTime.day)
+ startDateStr = ipyData.GetStartDate()
+ endDateStr = ipyData.GetEndDate()
+ if not startDateStr:
+ startDateStr = "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
+ if not endDateStr:
+ endDateStr = "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
+
+ # 日期直接返回
+ if startDateStr.count("-") == 2 and "W" not in startDateStr:
+ return startDateStr, endDateStr
+
+ # 开服天
+ if startDateStr.isdigit():
+ diffDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
+ startDateTime = curDateTime + datetime.timedelta(days=(int(startDateStr)-diffDay))
+ endDateTime = curDateTime + datetime.timedelta(days=(int(endDateStr)-diffDay))
+
+ # 合服天
+ elif startDateStr.startswith("Mix"):
+ diffDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay) + 1
+ startDateTime = curDateTime + datetime.timedelta(days=(int(startDateStr[3:])-diffDay))
+ endDateTime = curDateTime + datetime.timedelta(days=(int(endDateStr[3:])-diffDay))
+
+ # 周循环, 直接配置 Wx 或 Wx|有效开始日期 或 Wx|有效结束日期
+ elif startDateStr.startswith("W"):
+ curWeekday = curDateTime.weekday() + 1
+
+ startWeekDateInfo = startDateStr.split("|")
+ startWeekInfo = startWeekDateInfo[0]
+ startWeekday = int(startWeekInfo[1:])
+ startDateTime = curDateTime + datetime.timedelta(days=(startWeekday-curWeekday))
+
+ # 限制开启循环日期
+ if len(startWeekDateInfo) > 1:
+ startLoopDateStr = startWeekDateInfo[1]
+ startLoopDateTime = ChangeStrToDatetime(startLoopDateStr, ChConfig.TYPE_Time_YmdFormat)
+ if startLoopDateTime > startDateTime:
+ startDateTime = startLoopDateTime
+
+ startWeekDay = startDateTime.weekday() + 1 # 实际开启活动是周几,不一定和配置的周几一样,可能从中间被截断开始
+
+ # 处理周循环的结束日期
+ endWeekDateInfo = endDateStr.split("|")
+ endWeekInfo = endWeekDateInfo[0]
+ endWeekday = int(endWeekInfo[1:])
+ endDateTime = startDateTime + datetime.timedelta(days=(endWeekday-startWeekDay))
+ if len(endWeekDateInfo) > 1:
+ endLoopDateStr = endWeekDateInfo[1]
+ endLoopDateTime = ChangeStrToDatetime(endLoopDateStr, ChConfig.TYPE_Time_YmdFormat)
+ if endDateTime > endLoopDateTime:
+ endDateTime = endLoopDateTime
+
+ # 只配置结束日期的时候可能导致开始日期计算出来比结束日期还大,即当前时间超过结束日期,且 配置还存在的情况
+ if startDateTime > endDateTime:
+ startDateTime = endDateTime # 反正都无法开启,随便给个日期,不超过结束日期即可
+
+ # 默认
+ else:
+ startDateTime = curDateTime
+ endDateTime = curDateTime
+
+ startDateStr = "%d-%d-%d" % (startDateTime.year, startDateTime.month, startDateTime.day)
+ endDateStr = "%d-%d-%d" % (endDateTime.year, endDateTime.month, endDateTime.day)
+ return startDateStr, endDateStr
##获得系统时间
# @param 无意义
@@ -844,6 +886,8 @@
timeStr = datetime.datetime.strptime(timeStr, timeFormat).timetuple()
return int(time.mktime(timeStr))
+def ChangeStrToDatetime(timeStr, timeFormat=ChConfig.TYPE_Time_Format):
+ return datetime.datetime.strptime(timeStr, timeFormat)
##获取与当前时间相差天数的datetime格式数据
# @param diffDays 差距天数
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
index d88f64e..b1083ac 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -235,7 +235,7 @@
GameWorld.Log("加载运营活动: actName=%s,platform=%s,serverGroupID=%s" % (actName, platform, serverGroupID))
curServerActIpyDataList = __GetOperationActionServerIpyDataList(ipyDataMgr, platform, serverGroupID, actName)
GameWorld.Log(" 可处理条数=%s" % (len(curServerActIpyDataList)))
- actNumDisableWeekIpyDataInfo = __GetOperationActionDisableWeekIpyDataInfo(actName, curDateTime, curServerActIpyDataList)
+ actNumDisableWeekIpyDataInfo, disableWeekCfgIDList = __GetOperationActionDisableWeekIpyDataInfo(actName, curDateTime, curServerActIpyDataList)
for ipyData in curServerActIpyDataList:
@@ -269,7 +269,7 @@
# 开服常规: 开服天 > 日期 > 周x (不受合服天影响,合服活动新增一套独立的活动,还是走运营活动配置)
if actType == ShareDefine.ActType_OpenComm:
actByWeek = (startDateStr.startswith("W") and endDateStr.startswith("W")) # 按周x开
- actByDate = (startDateStr.count("-") == 2 and endDateStr.count("-") == 2) # 按日期开
+ actByDate = (not actByWeek and startDateStr.count("-") == 2 and endDateStr.count("-") == 2) # 按日期开
# 开服天的
if startDateStr.isdigit() and endDateStr.isdigit():
@@ -297,13 +297,13 @@
% (cfgID, startWeekDate, startDateStr, endWeekDate, endDateStr, ymdCfgID, ymdStartDate, ymdEndDate))
continue
+ if cfgID in disableWeekCfgIDList:
+ GameWorld.Log(" 常规活动,按星期开启的未到开启循环日期或已结束循环日期,不处理! cfgID=%s,startDateStr=%s,endDateStr=%s"
+ % (cfgID, startDateStr, endDateStr))
+ continue
+
if actByWeek:
- startWeekday = int(startDateStr[1:])
- endWeekday = int(endDateStr[1:])
- startWeekDate = curDateTime + datetime.timedelta(days=(startWeekday - curWeekday))
- endWeekDate = curDateTime + datetime.timedelta(days=(endWeekday - curWeekday))
- startDateStr = "%d-%d-%d" % (startWeekDate.year, startWeekDate.month, startWeekDate.day)
- endDateStr = "%d-%d-%d" % (endWeekDate.year, endWeekDate.month, endWeekDate.day)
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
GameWorld.Log(" 星期X转化为日期: %s ~ %s" % (startDateStr, endDateStr))
curServerOpenDateTime = curDateTime + datetime.timedelta(days=(1 - openServerDay)) # 开服第一天的日期
@@ -595,10 +595,12 @@
def __GetOperationActionDisableWeekIpyDataInfo(actName, curDateTime, curServerActIpyDataList):
## 获取不可用的按星期X开启的配置数据信息,按星期X开启的 活动优先级小于按日期的,当有重叠时以日期的为准
- curWeekday = curDateTime.weekday() + 1 # 今天星期几, 1代表星期1
+ #curWeekday = curDateTime.weekday() + 1 # 今天星期几, 1代表星期1
actNumWeekYMDIpyDataInfo = {} # {actNum:[weekIpyDataList, ymdIpyDatList], ...}
+ disableWeekCfgIDList = [] # [cfgID, ...]
for ipyData in curServerActIpyDataList:
+ cfgID = ipyData.GetCfgID()
startDateStr = ipyData.GetStartDate()
endDateStr = ipyData.GetEndDate()
actNum = GetOperationActNum(actName, ipyData)
@@ -614,11 +616,14 @@
# 按星期X的
if startDateStr.startswith("W"):
- startWeekday = int(startDateStr[1:])
- endWeekday = int(endDateStr[1:])
- startWeekDate = curDateTime + datetime.timedelta(days=(startWeekday - curWeekday))
- endWeekDate = curDateTime + datetime.timedelta(days=(endWeekday - curWeekday))
- weekIpyDataList.append([ipyData, startWeekDate, endWeekDate])
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
+ startWeekDate = GameWorld.ChangeStrToDatetime(startDateStr, ChConfig.TYPE_Time_YmdFormat)
+ endWeekDate = GameWorld.ChangeStrToDatetime(endDateStr, ChConfig.TYPE_Time_YmdFormat)
+ if startWeekDate > curDateTime or curDateTime >= endWeekDate: # 还未开始的循环 or 已经强制结束的循环
+ disableWeekCfgIDList.append(cfgID)
+ else:
+ weekIpyDataList.append([ipyData, startWeekDate, endWeekDate])
+
# 按日期的
elif startDateStr.count("-") == 2:
ymdIpyData = ipyData
@@ -642,7 +647,7 @@
ymdCfgID = ymdIpyData.GetCfgID()
actNumDisableWeekIpyDataInfo[actNum][cfgID] = [startWeekDate, endWeekDate, ymdCfgID, ymdStartDate, ymdEndDate]
- return actNumDisableWeekIpyDataInfo
+ return actNumDisableWeekIpyDataInfo, disableWeekCfgIDList
def TransferOperationActDBKeyValue():
''' 服务器启动时调用
@@ -904,11 +909,11 @@
return
if len(ipyData.GetStartTimeList()) != len(ipyData.GetEndTimeList()):
return
- openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
multiExpRateInfo = ChPyNetSendPack.tagGCMultiExpRateInfo()
multiExpRateInfo.Clear()
- multiExpRateInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- multiExpRateInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ multiExpRateInfo.StartDate = startDateStr
+ multiExpRateInfo.EndtDate = endDateStr
multiExpRateInfo.ActivityTime = []
for i, startTime in enumerate(ipyData.GetStartTimeList()):
endTime = ipyData.GetEndTimeList()[i]
@@ -937,11 +942,11 @@
##多倍修行点活动信息通知
if not ipyData:
return
- openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
multiRealmPointInfo = ChPyNetSendPack.tagGCMultiRealmPointInfo()
multiRealmPointInfo.Clear()
- multiRealmPointInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- multiRealmPointInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ multiRealmPointInfo.StartDate = startDateStr
+ multiRealmPointInfo.EndtDate = endDateStr
multiRealmPointInfo.Multiple = ipyData.GetMultiple()
multiRealmPointInfo.LimitLV = ipyData.GetLVLimit()
multiRealmPointInfo.LimitPoint = ipyData.GetPointLimit()
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFairyCeremony.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFairyCeremony.py
index c95d060..73740c8 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFairyCeremony.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFairyCeremony.py
@@ -88,11 +88,11 @@
if not ipyData:
return
- openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
fairyCeremonyInfo = ChPyNetSendPack.tagGCFairyCeremonyInfo()
fairyCeremonyInfo.Clear()
- fairyCeremonyInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- fairyCeremonyInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ fairyCeremonyInfo.StartDate = startDateStr
+ fairyCeremonyInfo.EndtDate = endDateStr
fairyCeremonyInfo.WorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_FairyCeremony)
fairyCeremonyInfo.LimitLV = ipyData.GetLVLimit()
fairyCeremonyInfo.ResetType = ipyData.GetResetType()
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py
index 333f44b..ccd7413 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py
@@ -827,10 +827,10 @@
if not ipyData:
return
- openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
feastPack = ChPyNetSendPack.tagGCFeastRedPacketInfo()
- feastPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- feastPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ feastPack.StartDate = startDateStr
+ feastPack.EndtDate = endDateStr
feastPack.LimitLV = ipyData.GetLVLimit()
feastPack.ResetType = ipyData.GetResetType()
feastPack.RedPacketDayList = []
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py
index 6f89de4..0d9baae 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py
@@ -88,11 +88,11 @@
if not ipyData:
return
- openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
NewFairyCeremonyInfo = ChPyNetSendPack.tagGCNewFairyCeremonyInfo()
NewFairyCeremonyInfo.Clear()
- NewFairyCeremonyInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- NewFairyCeremonyInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ NewFairyCeremonyInfo.StartDate = startDateStr
+ NewFairyCeremonyInfo.EndtDate = endDateStr
NewFairyCeremonyInfo.WorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_NewFairyCeremony)
NewFairyCeremonyInfo.LimitLV = ipyData.GetLVLimit()
NewFairyCeremonyInfo.ResetType = ipyData.GetResetType()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
index e735c5f..78c0d00 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
@@ -611,31 +611,73 @@
return {}
return actNumDict[actNum]
-def GetOperationActionDateStr(dateInfo, openServerDay):
- '''获取运营活动对应日期,存数字代表开服天配置,需要转化为对应的日期
- @param dateInfo: 运营活动表配置的日期信息, 如果是纯数字代表开服天
- @param openServerDay: 当前开服天
- '''
- if not dateInfo:
- curDateTime = datetime.datetime.today()
- return "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
- if dateInfo.startswith("W"):
- curDateTime = datetime.datetime.today()
- curWeekday = curDateTime.weekday() + 1
- actionWeekday = int(dateInfo[1:])
- actionDateTime = curDateTime + datetime.timedelta(days=(actionWeekday-curWeekday))
- return "%d-%d-%d" % (actionDateTime.year, actionDateTime.month, actionDateTime.day)
- if dateInfo.startswith("Mix"):
- diffDay = GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_MixServerDay) + 1
- actionServerDay = int(dateInfo[3:])
- elif not dateInfo.isdigit():
- return dateInfo
- else:
- diffDay = openServerDay
- actionServerDay = int(dateInfo)
+def GetOperationActionDateStr(ipyData):
+ ## 获取运营活动对应日期,存数字代表开服天配置,需要转化为对应的日期
curDateTime = datetime.datetime.today()
- actionDateTime = curDateTime + datetime.timedelta(days=(actionServerDay-diffDay))
- return "%d-%d-%d" % (actionDateTime.year, actionDateTime.month, actionDateTime.day)
+ startDateStr = ipyData.GetStartDate()
+ endDateStr = ipyData.GetEndDate()
+ if not startDateStr:
+ startDateStr = "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
+ if not endDateStr:
+ endDateStr = "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
+
+ # 日期直接返回
+ if startDateStr.count("-") == 2 and "W" not in startDateStr:
+ return startDateStr, endDateStr
+
+ # 开服天
+ if startDateStr.isdigit():
+ diffDay = GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateTime = curDateTime + datetime.timedelta(days=(int(startDateStr)-diffDay))
+ endDateTime = curDateTime + datetime.timedelta(days=(int(endDateStr)-diffDay))
+
+ # 合服天
+ elif startDateStr.startswith("Mix"):
+ diffDay = GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_MixServerDay) + 1
+ startDateTime = curDateTime + datetime.timedelta(days=(int(startDateStr[3:])-diffDay))
+ endDateTime = curDateTime + datetime.timedelta(days=(int(endDateStr[3:])-diffDay))
+
+ # 周循环, 直接配置 Wx 或 Wx|有效开始日期 或 Wx|有效结束日期
+ elif startDateStr.startswith("W"):
+ curWeekday = curDateTime.weekday() + 1
+
+ startWeekDateInfo = startDateStr.split("|")
+ startWeekInfo = startWeekDateInfo[0]
+ startWeekday = int(startWeekInfo[1:])
+ startDateTime = curDateTime + datetime.timedelta(days=(startWeekday-curWeekday))
+
+ # 限制开启循环日期
+ if len(startWeekDateInfo) > 1:
+ startLoopDateStr = startWeekDateInfo[1]
+ startLoopDateTime = ChangeStrToDatetime(startLoopDateStr, ChConfig.TYPE_Time_Format_Day)
+ if startLoopDateTime > startDateTime:
+ startDateTime = startLoopDateTime
+
+ startWeekDay = startDateTime.weekday() + 1 # 实际开启活动是周几,不一定和配置的周几一样,可能从中间被截断开始
+
+ # 处理周循环的结束日期
+ endWeekDateInfo = endDateStr.split("|")
+ endWeekInfo = endWeekDateInfo[0]
+ endWeekday = int(endWeekInfo[1:])
+ endDateTime = startDateTime + datetime.timedelta(days=(endWeekday-startWeekDay))
+ if len(endWeekDateInfo) > 1:
+ endLoopDateStr = endWeekDateInfo[1]
+ endLoopDateTime = ChangeStrToDatetime(endLoopDateStr, ChConfig.TYPE_Time_Format_Day)
+ if endDateTime > endLoopDateTime:
+ endDateTime = endLoopDateTime
+
+ # 只配置结束日期的时候可能导致开始日期计算出来比结束日期还大,即当前时间超过结束日期,且 配置还存在的情况
+ if startDateTime > endDateTime:
+ startDateTime = endDateTime # 反正都无法开启,随便给个日期,不超过结束日期即可
+
+ # 默认
+ else:
+ startDateTime = curDateTime
+ endDateTime = curDateTime
+
+ startDateStr = "%d-%d-%d" % (startDateTime.year, startDateTime.month, startDateTime.day)
+ endDateStr = "%d-%d-%d" % (endDateTime.year, endDateTime.month, endDateTime.day)
+ return startDateStr, endDateStr
##获得服务器系统时间
# @param 无
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActCollectWords.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActCollectWords.py
index 522eaae..f75919a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActCollectWords.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActCollectWords.py
@@ -146,8 +146,7 @@
lastDayOnlyExchange = ipyData.GetLastDayOnlyExchange()
if lastDayOnlyExchange:
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
- endDateStr = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ _, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
curDate = GameWorld.GetCurrentTime()
curDateStr = "%d-%s-%s" % (curDate.year, curDate.month, curDate.day)
if curDateStr == endDateStr:
@@ -306,11 +305,11 @@
if not templateID:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
clientPack = ChPyNetSendPack.tagMCActCollectWordsInfo()
clientPack.ActNum = actNum
- clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.StartDate = startDateStr
+ clientPack.EndtDate = endDateStr
clientPack.LimitLV = ipyData.GetLVLimit()
clientPack.LastDayOnlyExchange = ipyData.GetLastDayOnlyExchange()
clientPack.ExchangeItemList = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGarbageSorting.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGarbageSorting.py
index b7977b6..0ff8533 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGarbageSorting.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGarbageSorting.py
@@ -294,11 +294,11 @@
if not ipyData:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
clientPack = ChPyNetSendPack.tagMCActGarbageSortingInfo()
clientPack.ActNum = actNum
- clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.StartDate = startDateStr
+ clientPack.EndtDate = endDateStr
clientPack.LimitLV = ipyData.GetLVLimit()
clientPack.ResetType = ipyData.GetResetType()
NetPackCommon.SendFakePack(curPlayer, clientPack)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGrowupBuy.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGrowupBuy.py
index 0c1fb34..5c1e738 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGrowupBuy.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActGrowupBuy.py
@@ -157,10 +157,10 @@
import PlayerCoin
buyState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GrowupBuyState)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actPack = ChPyNetSendPack.tagMCActGrowupBuyInfo()
- actPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actPack.StartDate = startDateStr
+ actPack.EndtDate = endDateStr
actPack.LimitLV = ipyData.GetLVLimit()
actPack.GroupList = []
for i, ctgIDList in enumerate(ctgIDGroupList):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py
index 28e4c52..e0c84f5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py
@@ -64,11 +64,11 @@
if len(startTimeList) != len(endTimeList):
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actIpyData)
actInfo = ChPyNetSendPack.tagMCActHorsePetFeastInfo()
actInfo.Clear()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.ActTimeList = []
for i, startTime in enumerate(startTimeList):
timeObj = ChPyNetSendPack.tagMCActHorsePetFeastTime()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py
index d12c2eb..58a4901 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py
@@ -278,11 +278,11 @@
if not templateIDList:
return
actWorldLVList = actLoginAwardInfo.get(ShareDefine.ActKey_WorldLVList, [])
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actIpyData)
actInfo = ChPyNetSendPack.tagMCActLoginAwardInfo()
actInfo.Clear()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.AdvanceMinutes = actIpyData.GetAdvanceMinutes()
actInfo.IsDayReset = actIpyData.GetIsDayReset()
actInfo.ResetType = actIpyData.GetResetType()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargePrize.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargePrize.py
index d31271f..84b283c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargePrize.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargePrize.py
@@ -165,10 +165,10 @@
templateIDList = ipyData.GetTemplateIDList()
if not templateIDList:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actInfo = ChPyNetSendPack.tagMCActRechargePrizeInfo()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.LimitLV = ipyData.GetLVLimit()
actInfo.IsDayReset = ipyData.GetIsDayReset()
actInfo.PrizeDayInfo = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargeRebateGold.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargeRebateGold.py
index 25b9135..492f21e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargeRebateGold.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActRechargeRebateGold.py
@@ -164,10 +164,10 @@
if not templateIDList:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actInfo = ChPyNetSendPack.tagMCActRechargeRebateGoldInfo()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.LimitLV = ipyData.GetLVLimit()
actInfo.IsDayReset = ipyData.GetIsDayReset()
actInfo.RebateDayInfo = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py
index 9724dd0..06ca77c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActSingleRecharge.py
@@ -374,12 +374,12 @@
return
actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
clientPack = ChPyNetSendPack.tagMCActSingleRechargeInfo()
clientPack.ActNum = actNum
- clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.StartDate = startDateStr
+ clientPack.EndtDate = endDateStr
clientPack.IsDayReset = ipyData.GetIsDayReset()
clientPack.LimitLV = ipyData.GetLVLimit()
clientPack.AwardRuleType = ipyData.GetAwardRuleType()
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 36c31de..4192c42 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
@@ -315,11 +315,11 @@
return
job = curPlayer.GetJob()
actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actInfo = ChPyNetSendPack.tagMCActTotalRechargeInfo()
actInfo.ActNum = actNum
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.LimitLV = ipyData.GetLVLimit()
actInfo.IsDayReset = ipyData.GetIsDayReset()
actInfo.AwardDayInfo = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py
index 6403123..6f601a5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTurntable.py
@@ -482,12 +482,12 @@
return
actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
clientPack = ChPyNetSendPack.tagMCActTurntableInfo()
clientPack.ActNum = actNum
- clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.StartDate = startDateStr
+ clientPack.EndtDate = endDateStr
clientPack.IsDayReset = ipyData.GetIsDayReset()
clientPack.LimitLV = ipyData.GetLVLimit()
clientPack.CTGPrizeList = [CommFunc.RMBToCoin(floatRMB) for floatRMB in ipyData.GetCTGPrizeList()]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActXianXiaMJ.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActXianXiaMJ.py
index 20b10db..a3b4e11 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActXianXiaMJ.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActXianXiaMJ.py
@@ -524,15 +524,15 @@
costMoneyType, costMoneyValue = ipyData.GetUseMoneyInfo()
actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
layerInfoValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_XianXiaMJAwardLayerInfo % actNum)
layerNum = layerInfoValue % 100
clientPack = ChPyNetSendPack.tagMCActXianXiaMJInfo()
clientPack.ActNum = actNum
- clientPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- clientPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ clientPack.StartDate = startDateStr
+ clientPack.EndtDate = endDateStr
clientPack.LimitLV = ipyData.GetLVLimit()
clientPack.ResetType = ipyData.GetResetType()
clientPack.MoneyType = costMoneyType
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
index 95e4582..8ce9306 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
@@ -229,11 +229,11 @@
if not ipyDataList:
return
worldLV = actBossRebornInfo.get(ShareDefine.ActKey_WorldLV, 0)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actBossIpyData)
actInfo = ChPyNetSendPack.tagMCBossRebornInfo()
actInfo.Clear()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.ResetType = actBossIpyData.GetResetType()
actInfo.LimitLV = actBossIpyData.GetLVLimit()
actInfo.TaskInfo = []
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 ceb1cbe..887a13e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCostRebate.py
@@ -280,11 +280,11 @@
return
job = curPlayer.GetJob()
actWorldLV = actCostRebateInfo.get(ShareDefine.ActKey_WorldLV, 0)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actInfo = ChPyNetSendPack.tagMCCostRebateInfo()
actInfo.ActNum = actNum
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.LimitLV = ipyData.GetLVLimit()
actInfo.IsDayReset = ipyData.GetIsDayReset()
actInfo.AwardDayInfo = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py
index 5f46a01..59aa132 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py
@@ -189,11 +189,11 @@
if not dayIpyDataList:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actPack = ChPyNetSendPack.tagMCFeastLoginInfo()
actPack.Clear()
- actPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actPack.StartDate = startDateStr
+ actPack.EndtDate = endDateStr
actPack.LimitLV = ipyData.GetLVLimit()
actPack.DayAwardList = []
for dayIpyData in dayIpyDataList:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastTravel.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastTravel.py
index 152d336..ed77e24 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastTravel.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastTravel.py
@@ -269,11 +269,11 @@
if not templateID:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actPack = ChPyNetSendPack.tagMCFeastTravelInfo()
actPack.Clear()
- actPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actPack.StartDate = startDateStr
+ actPack.EndtDate = endDateStr
actPack.LimitLV = ipyData.GetLVLimit()
actPack.ResetType = ipyData.GetResetType()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py
index 831347a..7f5ca59 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py
@@ -443,11 +443,11 @@
bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", templateID)
poolIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWishPool", templateID)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
actPack = ChPyNetSendPack.tagMCFeastWishInfo()
actPack.Clear()
- actPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
- actPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
+ actPack.StartDate = startDateStr
+ actPack.EndtDate = endDateStr
actPack.LimitLV = ipyData.GetLVLimit()
actPack.ResetType = ipyData.GetResetType()
actPack.WishPoolShowItemList = poolIpyData.GetWishPoolClientItemShow() if poolIpyData else []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py
index d7ff96b..d08b0f3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py
@@ -294,11 +294,11 @@
# 取玩家APPID,混服使用
appID = GameWorld.GetPlayerPlatform(curPlayer)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(flashGiftbagIpyData)
packInfo = ChPyNetSendPack.tagMCFlashGiftbagInfo()
packInfo.ActNum = actNum
- packInfo.StartDate = GameWorld.GetOperationActionDateStr(flashGiftbagIpyData.GetStartDate(), openServerDay)
- packInfo.EndtDate = GameWorld.GetOperationActionDateStr(flashGiftbagIpyData.GetEndDate(), openServerDay)
+ packInfo.StartDate = startDateStr
+ packInfo.EndtDate = endDateStr
packInfo.AdvanceMinutes = flashGiftbagIpyData.GetAdvanceMinutes()
packInfo.ActivityTime = []
for i, startTime in enumerate(startTimeList):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashSale.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashSale.py
index 5bb9ca0..c5d3178 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashSale.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashSale.py
@@ -127,8 +127,7 @@
isReset = True
if cfgID:
flashSaleIpyData = IpyGameDataPY.GetIpyGameData("ActFlashSale", cfgID)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
- startDate = GameWorld.GetOperationActionDateStr(flashSaleIpyData.GetStartDate(), openServerDay)
+ startDate, _ = GameWorld.GetOperationActionDateStr(flashSaleIpyData)
startTimeNum = GameWorld.ChangeTimeStrToNum(startDate, timeFormat=ChConfig.TYPE_Time_Format_Day)
else:
startTimeNum = 0
@@ -191,9 +190,7 @@
LVLimit = flashSaleIpyData.GetLVLimit()
if not mailKey or curPlayer.GetLV() < LVLimit:
continue
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
- startDate = GameWorld.GetOperationActionDateStr(flashSaleIpyData.GetStartDate(), openServerDay)
- endDate = GameWorld.GetOperationActionDateStr(flashSaleIpyData.GetEndDate(), openServerDay)
+ startDate, endDate = GameWorld.GetOperationActionDateStr(flashSaleIpyData)
startTimeList = flashSaleIpyData.GetStartTimeList()
endTimeList = flashSaleIpyData.GetEndTimeList()
if not startTimeList or not endTimeList:
@@ -238,11 +235,11 @@
GameWorld.ErrLog("限时抢购开关时间时分配置错误!cfgID=%s" % cfgID)
return
job = curPlayer.GetJob()
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(flashSaleIpyData)
packInfo = ChPyNetSendPack.tagMCFlashSaleInfo()
packInfo.ActNum = actNum
- packInfo.StartDate = GameWorld.GetOperationActionDateStr(flashSaleIpyData.GetStartDate(), openServerDay)
- packInfo.EndtDate = GameWorld.GetOperationActionDateStr(flashSaleIpyData.GetEndDate(), openServerDay)
+ packInfo.StartDate = startDateStr
+ packInfo.EndtDate = endDateStr
packInfo.AdvanceMinutes = flashSaleIpyData.GetAdvanceMinutes()
packInfo.ActivityTime = []
for i, startTime in enumerate(startTimeList):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py
index 36605af..e296c80 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py
@@ -206,11 +206,11 @@
actIpyData = IpyGameDataPY.GetIpyGameData("ActLuckyTreasure", cfgID)
if not actIpyData:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actIpyData)
actInfo = ChPyNetSendPack.tagMCLuckyTreasureInfo()
actInfo.Clear()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.ResetType = actIpyData.GetResetType()
actInfo.LimitLV = actIpyData.GetLVLimit()
actInfo.LuckyPoint = actIpyData.GetLuckyPoint()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSpringSale.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSpringSale.py
index 3b2a542..4ebdcfd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSpringSale.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSpringSale.py
@@ -134,11 +134,11 @@
GameWorld.ErrLog("限时特惠开关时间时分配置错误!cfgID=%s" % cfgID)
return
job = curPlayer.GetJob()
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(springSaleIpyData)
packInfo = ChPyNetSendPack.tagMCSpringSaleInfo()
packInfo.ActNum = actNum
- packInfo.StartDate = GameWorld.GetOperationActionDateStr(springSaleIpyData.GetStartDate(), openServerDay)
- packInfo.EndtDate = GameWorld.GetOperationActionDateStr(springSaleIpyData.GetEndDate(), openServerDay)
+ packInfo.StartDate = startDateStr
+ packInfo.EndtDate = endDateStr
packInfo.AdvanceMinutes = springSaleIpyData.GetAdvanceMinutes()
packInfo.ActivityTime = []
for i, startTime in enumerate(startTimeList):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
index e776975..7970d51 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
@@ -412,11 +412,11 @@
return
worldLV = actWeekPartyInfo.get(ShareDefine.ActKey_WorldLV, 0)
pointAwardDict = __GetPointAwardInfo(actBossIpyData.GetPointAward(), worldLV)
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actBossIpyData)
actInfo = ChPyNetSendPack.tagMCWeekPartyInfo()
actInfo.Clear()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.AdvanceMinutes = actBossIpyData.GetAdvanceMinutes()
actInfo.IsDayReset = actBossIpyData.GetIsDayReset()
actInfo.ResetType = actBossIpyData.GetResetType()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py
index 663a38f..b78494b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py
@@ -377,11 +377,11 @@
actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
if not actIpyData:
return
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actIpyData)
actInfo = ChPyNetSendPack.tagMCActWishingWellInfo()
actInfo.Clear()
- actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
- actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
+ actInfo.StartDate = startDateStr
+ actInfo.EndtDate = endDateStr
actInfo.IsDayReset = actIpyData.GetIsDayReset()
actInfo.ResetType = actIpyData.GetResetType()
actInfo.LimitLV = actIpyData.GetLVLimit()
@@ -410,8 +410,7 @@
cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
if actIpyData:
- openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
- startDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
+ startDate, _ = GameWorld.GetOperationActionDateStr(actIpyData)
resetType = actIpyData.GetResetType() # 重置类型,0-0点重置;1-5点重置
if resetType == 1:
--
Gitblit v1.8.0