| | |
| | | GameWorld.Log("加载运营活动: actName=%s,platform=%s,serverGroupID=%s" % (actName, platform, serverGroupID))
|
| | | curServerActIpyDataList = __GetOperationActionServerIpyDataList(ipyDataMgr, platform, serverGroupID, actName)
|
| | | GameWorld.Log(" 可处理条数=%s" % (len(curServerActIpyDataList)))
|
| | | actNumDisableWeekIpyDataInfo, disableWeekCfgIDList = __GetOperationActionDisableWeekIpyDataInfo(actName, curDateTime, curServerActIpyDataList)
|
| | | actNumDisableWeekIpyDataInfo, disableWeekCfgIDDict = __GetOperationActionDisableWeekIpyDataInfo(actName, curDateTime, curServerActIpyDataList)
|
| | |
|
| | | for ipyData in curServerActIpyDataList:
|
| | |
|
| | |
| | | % (cfgID, startWeekDate, startDateStr, endWeekDate, endDateStr, ymdCfgID, ymdStartDate, ymdEndDate))
|
| | | continue
|
| | |
|
| | | if cfgID in disableWeekCfgIDList:
|
| | | GameWorld.Log(" 常规活动,按星期开启的未到开启循环日期或已结束循环日期,不处理! cfgID=%s,startDateStr=%s,endDateStr=%s" |
| | | % (cfgID, startDateStr, endDateStr))
|
| | | if cfgID in disableWeekCfgIDDict:
|
| | | GameWorld.Log(" 常规活动,按星期开启的未到开启循环日期或已结束循环日期,不处理! cfgID=%s,startDateStr=%s,endDateStr=%s, %s" |
| | | % (cfgID, startDateStr, endDateStr, disableWeekCfgIDDict[cfgID]))
|
| | | continue
|
| | |
|
| | | if actByWeek:
|
| | |
| | | ## 获取不可用的按星期X开启的配置数据信息,按星期X开启的 活动优先级小于按日期的,当有重叠时以日期的为准
|
| | | #curWeekday = curDateTime.weekday() + 1 # 今天星期几, 1代表星期1
|
| | | actNumWeekYMDIpyDataInfo = {} # {actNum:[weekIpyDataList, ymdIpyDatList], ...}
|
| | | disableWeekCfgIDList = [] # [cfgID, ...]
|
| | | disableWeekCfgIDDict = {} # {cfgID:[startDateStr, endDateStr], ...}
|
| | | |
| | | curDateTimeYmdStr = "%d-%d-%d" % (curDateTime.year, curDateTime.month, curDateTime.day)
|
| | | curDateTimeYmd = GameWorld.ChangeStrToDatetime(curDateTimeYmdStr, ChConfig.TYPE_Time_YmdFormat)
|
| | |
|
| | | for ipyData in curServerActIpyDataList:
|
| | | cfgID = ipyData.GetCfgID()
|
| | |
| | | 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)
|
| | | if startWeekDate > curDateTimeYmd or curDateTimeYmd > endWeekDate: # 还未开始的循环 or 已经强制结束的循环
|
| | | disableWeekCfgIDDict[cfgID] = [startDateStr, endDateStr]
|
| | | else:
|
| | | weekIpyDataList.append([ipyData, startWeekDate, endWeekDate])
|
| | |
|
| | |
| | | ymdCfgID = ymdIpyData.GetCfgID()
|
| | | actNumDisableWeekIpyDataInfo[actNum][cfgID] = [startWeekDate, endWeekDate, ymdCfgID, ymdStartDate, ymdEndDate]
|
| | |
|
| | | return actNumDisableWeekIpyDataInfo, disableWeekCfgIDList
|
| | | return actNumDisableWeekIpyDataInfo, disableWeekCfgIDDict
|
| | |
|
| | | def TransferOperationActDBKeyValue():
|
| | | ''' 服务器启动时调用
|