| | |
| | | ## 运营活动类型
|
| | | return actNum / 10
|
| | |
|
| | | def __SaveActWorldLVLimitInfo(actWorldLVLimitInfo):
|
| | | GameWorld.GetUniversalRecMgr().Delete(ShareDefine.Def_UniversalGameRecType_ActWorldLVLimitInfo)
|
| | | recDataList = GameWorld.GetUniversalRecMgr().GetTypeList(ShareDefine.Def_UniversalGameRecType_ActWorldLVLimitInfo)
|
| | | GameWorld.Log("保存运营活动世界等级限制开启信息: %s" % len(actWorldLVLimitInfo))
|
| | | for actName, cfgLimitInfoDict in actWorldLVLimitInfo.items():
|
| | | for cfgID, limitInfo in cfgLimitInfoDict.items():
|
| | | recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV = limitInfo
|
| | | recData = recDataList.AddRec()
|
| | | recData.SetStrValue1(recStartDateStr)
|
| | | recData.SetStrValue2(recEndDateStr)
|
| | | recData.SetStrValue3(actName)
|
| | | recData.SetValue1(cfgID)
|
| | | recData.SetValue2(recLimitWorldLV)
|
| | | recData.SetValue3(recWorldLV)
|
| | | GameWorld.Log(" actName=%s,cfgID=%s,recStartDateStr=%s,recEndDateStr=%s,recLimitWorldLV=%s,recWorldLV=%s" |
| | | % (actName, cfgID, recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV))
|
| | | return
|
| | |
|
| | | def __GetActWorldLVLimitInfo():
|
| | | actWorldLVLimitInfo = {}
|
| | | recDataList = GameWorld.GetUniversalRecMgr().GetTypeList(ShareDefine.Def_UniversalGameRecType_ActWorldLVLimitInfo)
|
| | | GameWorld.Log("加载运营活动世界等级限制开启信息: %s" % recDataList.Count())
|
| | | for index in xrange(recDataList.Count()):
|
| | | recData = recDataList.At(index)
|
| | | recStartDateStr = recData.GetStrValue1()
|
| | | recEndDateStr = recData.GetStrValue2()
|
| | | actName = recData.GetStrValue3()
|
| | | cfgID = recData.GetValue1()
|
| | | recLimitWorldLV = recData.GetValue2()
|
| | | recWorldLV = recData.GetValue3()
|
| | | if actName not in actWorldLVLimitInfo:
|
| | | actWorldLVLimitInfo[actName] = {}
|
| | | actWorldLVLimitInfo[actName][cfgID] = [recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV]
|
| | | GameWorld.Log(" actName=%s,cfgID=%s,recStartDateStr=%s,recEndDateStr=%s,recLimitWorldLV=%s,recWorldLV=%s" |
| | | % (actName, cfgID, recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV))
|
| | | return actWorldLVLimitInfo
|
| | |
|
| | | def __GetOperationActionInfo(isRefreshState=True):
|
| | | # @return: isReload, OperationActionInfo
|
| | |
|
| | |
| | | serverGroupID = GameWorld.GetServerGroupID()
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | curWeekday = curDateTime.weekday() + 1 # 今天星期几, 1代表星期1
|
| | | curWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | actWorldLVLimitInfoOld = __GetActWorldLVLimitInfo()
|
| | | actWorldLVLimitInfoNew = {}
|
| | |
|
| | | GameWorld.Log("===== 加载本日运营活动信息: %s, serverGroupID=%s,openServerDay=%s,customMaxServerDay=%s,isMixServer=%s,mixServerDay=%s,maxCustomServerDayMix=%s,reloadSign=%s ====="
|
| | | % (curDateTime, serverGroupID, openServerDay, customMaxServerDay, isMixServer, mixServerDay, maxCustomServerDayMix, reloadSign))
|
| | | GameWorld.Log(" 今日周%s" % (curWeekday))
|
| | | GameWorld.Log(" 今日周%s, curWorldLV=%s" % (curWeekday, curWorldLV))
|
| | |
|
| | | for actName in ShareDefine.OperationActionNameList:
|
| | |
|
| | |
| | | % (activityIpyData.GetCfgID(), cfgID, advanceMinutes, minNotifyStartMinute, startDayDateJudge))
|
| | | continue
|
| | |
|
| | | # 在需要处理的时间内附加世界等级开启限制,未达到最低世界等级要求的不开,活动时间从未达到到达到也不开
|
| | | limitWorldLV = 0 if not hasattr(ipyData, "GetLimitWorldLV") else ipyData.GetLimitWorldLV() # 限制开启世界等级
|
| | | if limitWorldLV:
|
| | | GameWorld.Log(" limitWorldLV=%s,curWorldLV=%s" % (limitWorldLV, curWorldLV))
|
| | | recInfoType = ""
|
| | | worldLVLimitInfo = actWorldLVLimitInfoOld.get(actName, {})
|
| | | # 注: 该逻辑是在活动时间内的额外处理,所以需要判断此逻辑的前提理论上都在活动时间内,故只要有记录则以当时的记录为准
|
| | | if cfgID in worldLVLimitInfo:
|
| | | recInfoType = "Old"
|
| | | recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV = worldLVLimitInfo[cfgID]
|
| | | else:
|
| | | recInfoType = "New"
|
| | | recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV = startDateStr, endDateStr, limitWorldLV, curWorldLV
|
| | | |
| | | if actName not in actWorldLVLimitInfoNew:
|
| | | actWorldLVLimitInfoNew[actName] = {}
|
| | | actWorldLVLimitInfoNew[actName][cfgID] = [recStartDateStr, recEndDateStr, recLimitWorldLV, recWorldLV]
|
| | | |
| | | if recLimitWorldLV > recWorldLV:
|
| | | GameWorld.Log(" 活动时间内,但服务器世界等级未达到开启活动世界等级,不处理!recLimitWorldLV=%s > recWorldLV=%s %s" |
| | | % (recLimitWorldLV, recWorldLV, recInfoType))
|
| | | continue
|
| | | |
| | | startList = [] # [startDateTime, ...]
|
| | | endList = [] # [endDateTime, ...]
|
| | | startNotifyDict = {} # {notifyDateTime:notifyInfo, ...}
|
| | |
| | | mapServerOperationActionDict[actName] = activityInfoDict
|
| | |
|
| | | OperationActionInfo = IpyGameDataPY.SetConfigEx(key, [reloadSign, operationTodayActionDict, mapServerOperationActionDict])
|
| | | __SaveActWorldLVLimitInfo(actWorldLVLimitInfoNew)
|
| | |
|
| | | GameWorld.Log("本日运营活动信息加载完毕!reloadSign=%s,isRefreshState=%s" % (reloadSign, isRefreshState))
|
| | | GameWorld.Log(" operationTodayActionDict=%s" % operationTodayActionDict)
|