| | |
| | | import ShareDefine
|
| | | #import PlayerExam
|
| | | import PlayerDBGSEvent
|
| | | import MergeBroadcast
|
| | | #import PlayerManorWar
|
| | | #import GameWorldShopItem
|
| | | #import GameWorldActionTeHui
|
| | | import GameWorldAverageLv
|
| | | #import GameWorldMergeBoss
|
| | | #import GameWorldMergeKing
|
| | | #import GameWorldMergePK
|
| | | import CrossRealmPK
|
| | | import GameWorldFamilyWar
|
| | | import PlayerFamilyParty
|
| | | import IpyGameDataPY
|
| | |
| | | from types import IntType
|
| | | import time
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | MaxCustomServerDay = 14 # 最大定制开服天数
|
| | |
|
| | | #年月日时间格式
|
| | | Time_YmdFormat = ChConfig.TYPE_Time_YmdFormat
|
| | |
| | | curDateTimeStr = "%d-%d-%d %02d:%02d:00" % (serverTime.year, serverTime.month, serverTime.day, serverTime.hour, serverTime.minute)
|
| | | curDateTime = datetime.datetime.strptime(curDateTimeStr, ChConfig.TYPE_Time_Format)
|
| | |
|
| | | customMaxServerDay = MaxCustomServerDay # 定制运营活动最大开服天
|
| | | customMaxServerDay = IpyGameDataPY.GetFuncCfg("OperationAction", 1) # 定制运营活动最大开服天
|
| | | operationActionDict = {}
|
| | | mapServerOperationActionDict = {}
|
| | | serverID = GameWorld.GetServerID()
|
| | |
| | | startDateStr = "%d-%d-%d" % (openServerDateTime.year, openServerDateTime.month, openServerDateTime.day)
|
| | | endDateStr = "%d-%d-%d" % (endServerDateTime.year, endServerDateTime.month, endServerDateTime.day)
|
| | | GameWorld.Log(" 开服天转化为日期: %s ~ %s" % (startDateStr, endDateStr))
|
| | | else:
|
| | | if openServerDay <= customMaxServerDay:
|
| | | GameWorld.Log(" 按日期开的在开服定制限制天内,不处理! cfgID=%s,%s ~ %s,openServerDay=%s" % (cfgID, startDateStr, endDateStr, openServerDay))
|
| | | continue
|
| | | customMaxServerDateTime = curDateTime + datetime.timedelta(days=(customMaxServerDay-openServerDay))
|
| | | curStartDateTime = datetime.datetime.strptime("%s %02d:%02d:%02d" % (startDateStr, customMaxServerDateTime.hour, customMaxServerDateTime.minute, |
| | | customMaxServerDateTime.second), ChConfig.TYPE_Time_Format)
|
| | | if curStartDateTime <= customMaxServerDateTime:
|
| | | GameWorld.Log(" 按日期开的开始日期在开服定制限制天内,不处理! cfgID=%s,curStartDateTime=%s,customMaxServerDateTime=%s" % (cfgID, curStartDateTime, customMaxServerDateTime))
|
| | | continue
|
| | |
|
| | | elif openServerDay <= customMaxServerDay:
|
| | | GameWorld.Log(" 按日期开的在开服定制限制天内,不处理! cfgID=%s,%s ~ %s,openServerDay=%s" % (cfgID, startDateStr, endDateStr, openServerDay))
|
| | | continue
|
| | | |
| | | if hasattr(ipyData, "GetStartTimeList") and hasattr(ipyData, "GetEndTimeList"):
|
| | | startHMStrList = ipyData.GetStartTimeList()
|
| | | endHMStrList = ipyData.GetEndTimeList()
|
| | |
| | | if resetType == 1:
|
| | | startDayDate = datetime.datetime.strptime("%s 05:00:00" % (startDateStr), ChConfig.TYPE_Time_Format)
|
| | | endDayDate = datetime.datetime.strptime("%s 05:00:00" % (endDateStr), ChConfig.TYPE_Time_Format) # 结束日期5点
|
| | | elif resetType == 2:
|
| | | startDayDate = datetime.datetime.strptime("%s 05:00:00" % (startDateStr), ChConfig.TYPE_Time_Format) |
| | | endDayDate = datetime.datetime.strptime("%s 00:00:00" % (endDateStr), ChConfig.TYPE_Time_Format) + datetime.timedelta(days=1) # 结束日期隔天0点
|
| | | else:
|
| | | startDayDate = datetime.datetime.strptime("%s 00:00:00" % (startDateStr), ChConfig.TYPE_Time_Format)
|
| | | endDayDate = datetime.datetime.strptime("%s 00:00:00" % (endDateStr), ChConfig.TYPE_Time_Format) + datetime.timedelta(days=1) # 结束日期隔天0点
|
| | |
| | | ## 获取运营活动本服务器对应的配置数据列表
|
| | |
|
| | | # 所有配置先按活动标识归组
|
| | | platform = GameWorld.GetPlatform()
|
| | | actGroupDict = {} # {ActMark:{ServerIDTuple:[ipyData, ...], ...}, ...}
|
| | | actCfgCount = getattr(ipyDataMgr, "Get%sCount" % actName)()
|
| | | for cfgIndex in xrange(actCfgCount):
|
| | | ipyData = getattr(ipyDataMgr, "Get%sByIndex" % actName)(cfgIndex)
|
| | | actMark = ipyData.GetActMark()
|
| | | platformList = [] if not hasattr(ipyData, "GetPlatformList") else ipyData.GetPlatformList()
|
| | | if platformList and platform not in platformList:
|
| | | GameWorld.Log("非本平台活动,不取!platform=%s,platformList=%s,actName=%s,cfgID=%s" % (platform, platformList, actName, ipyData.GetCfgID()))
|
| | | continue
|
| | | serverIDTuple = tuple(ipyData.GetServerIDList())
|
| | |
|
| | | serverIpyDataDict = actGroupDict.get(actMark, {})
|
| | |
| | | multiRealmPointInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
|
| | | multiRealmPointInfo.Multiple = ipyData.GetMultiple()
|
| | | multiRealmPointInfo.LimitLV = ipyData.GetLVLimit()
|
| | | multiRealmPointInfo.LimitPoint = ipyData.GetPointLimit()
|
| | | if not curPlayer:
|
| | | # 全服广播在线玩家
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | |
| | | curDateStr = GameWorld.ChangeTimeNumToStr(curTime, ChConfig.TYPE_Time_YmdFormat) # 当天日期
|
| | |
|
| | | openServerWeekday = GameWorldProcess.GetOpenServerWeekday() # 服务器开服时是星期几
|
| | | curMaxCustomServerDay = MaxCustomServerDay - openServerWeekday + 1 # 最大有效定制开服天
|
| | | curMaxCustomServerDay = IpyGameDataPY.GetFuncCfg("OperationAction", 1) - openServerWeekday + 1 # 最大有效定制开服天
|
| | | GameWorld.Log("===== 加载今天日常活动信息 =====")
|
| | | GameWorld.Log(" 开服是星期%s, 开服第%s天, 当前星期%s" % (openServerWeekday, openServerDay, weekDay))
|
| | | GameWorld.Log(" 最大有效定制开服天: %s" % (curMaxCustomServerDay))
|
| | |
| | | GameWorld.ErrLog("获取开服是星期几数据错误!openServerWeekday=%s" % openServerWeekday)
|
| | | return []
|
| | |
|
| | | curMaxCustomServerDay = MaxCustomServerDay - openServerWeekday + 1 # 最大有效定制开服天
|
| | | curMaxCustomServerDay = IpyGameDataPY.GetFuncCfg("OperationAction", 1) - openServerWeekday + 1 # 最大有效定制开服天
|
| | | GameWorld.Log("===== 加载今天副本状态时间表 =====")
|
| | | GameWorld.Log(" 开服是星期%s, 开服第%s天, 当前星期%s,%s点%s分 !" % (openServerWeekday, openServerDay, curWeekDay, curHour, curMinute))
|
| | | GameWorld.Log(" 最大有效定制开服天: %s" % (curMaxCustomServerDay))
|
| | |
| | | # #间隔未到
|
| | | # return
|
| | |
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | |
|
| | | Dispose_ActionGoOnByDayKey()
|
| | |
| | | def DoLogic_ServerLastOpenActionDay():
|
| | |
|
| | | #是跨服服务器
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | if not PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MergeServerOpenActionDay):
|
| | | return
|
| | |
|
| | |
| | | #def __CheckIsProcessDictName(dictName):
|
| | | #
|
| | | # # 非跨服服务器不处理某些key
|
| | | # if dictName in [ShareDefine.Def_Notify_WorldKey_Merge_King] and not GameWorld.IsMergeServer():
|
| | | # if dictName in [ShareDefine.Def_Notify_WorldKey_Merge_King] and not GameWorld.IsCrossServer():
|
| | | # return False
|
| | | #
|
| | | # return True
|
| | |
| | | # #领地争夺战
|
| | | # if dictName == ShareDefine.Def_Notify_WorldKey_ManorWar:
|
| | | # PlayerManorWar.ManorWar_ChangeState(isOpen)
|
| | | # #跨服boss
|
| | | # elif dictName == ShareDefine.Def_Notify_WorldKey_MergeBoss:
|
| | | # GameWorldMergeBoss.MergeBoss_ChangeState(isOpen)
|
| | | # #跨服PK
|
| | | # elif dictName == ShareDefine.Def_Notify_WorldKey_Merge_PK:
|
| | | # GameWorldMergePK.OnMergePKMatchStateChange(isOpen)
|
| | | # #跨服王者争霸
|
| | | # elif dictName == ShareDefine.Def_Notify_WorldKey_Merge_King:
|
| | | # GameWorldMergeKing.OnMergeKingStateChange(isOpen)
|
| | | # #答题活动
|
| | | # elif dictName == ShareDefine.Def_Notify_WorldKey_Game_EXAM:
|
| | | # PlayerExam.Exam_ChangeState(isOpen)
|
| | |
| | | #骑宠争夺
|
| | | elif dictName == ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyRobBoss:
|
| | | GameWorldBoss.OnHorsePetRobBossActionChange(isOpen)
|
| | | #跨服PK
|
| | | elif dictName == ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_CrossReamPK:
|
| | | CrossRealmPK.OnCrossRealmPKDailyActionStateChange(isOpen)
|
| | | return
|
| | |
|
| | | #------------------------------------------------------------------------------
|
| | |
| | | # @return: None
|
| | | def SendBroadcastMergeOpenActionDay():
|
| | | mergeServerOpenActionDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MergeServerOpenActionDay)
|
| | | MergeBroadcast.SendBroadcastMerge(ChConfig.Def_MergeServerOpenActionDay, 0, {"Day":mergeServerOpenActionDay})
|
| | | #.SendBroadcastMerge(ChConfig.Def_MergeServerOpenActionDay, 0, {"Day":mergeServerOpenActionDay})
|
| | | return
|
| | |
|
| | | #-------------------------------------------------------------------------------
|
| | |
| | | # @param None
|
| | | # @return None
|
| | | def Dispose_ActionGoOnByDayKey():
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | GameWorld.DebugLog("处理特惠状态信息...")
|
| | | openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|