From 78eba407c2b7d68096500e9013add9141b13f52c Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 21 九月 2018 23:37:11 +0800 Subject: [PATCH] 3798 【后端】运营活动时间优化,开服日常限时活动定制时间优化 --- ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py index 4742007..6992c9c 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorld.py @@ -535,6 +535,19 @@ return tagPlayer.GetRealMapID() #--------------------------------------------------------------------- + +def GetOperationActionDateStr(dateInfo, openServerDay): + '''获取运营活动对应日期,存数字代表开服天配置,需要转化为对应的日期 + @param dateInfo: 运营活动表配置的日期信息, 如果是纯数字代表开服天 + @param openServerDay: 当前开服天 + ''' + if not dateInfo.isdigit(): + return dateInfo + actionServerDay = int(dateInfo) + curDateTime = datetime.datetime.today() + actionDateTime = curDateTime + datetime.timedelta(days=(actionServerDay-openServerDay)) + return "%d-%d-%d" % (actionDateTime.year, actionDateTime.month, actionDateTime.day) + ##获得系统时间 # @param 无意义 # @return 系统时间 -- Gitblit v1.8.0