8855 【主干】【BT2】【后端】活动通用逻辑,新增字段支持配置按世界等级开启(限时礼包支持)
5个文件已修改
74 ■■■■■ 已修改文件
PySysDB/PySysDBG.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBG.h
@@ -401,6 +401,7 @@
    dict        NotifyInfoStart;    //全服提示信息 - 相对开始时间
    dict        NotifyInfoEnd;    //全服提示信息 - 相对结束时间
    list        NotifyInfoLoop;    //全服提示信息 - 循环广播[间隔分钟, 广播key]
    WORD        LimitWorldLV;    //限制开启的最低世界等级
    WORD        LVLimit;    //限制等级
    BYTE        IsDayReset;    //是否每天重置
};
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -151,6 +151,43 @@
    ## 运营活动类型
    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
    
@@ -180,10 +217,13 @@
    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:
        
@@ -363,6 +403,29 @@
                              % (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, ...}
@@ -476,6 +539,7 @@
                    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)
ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py
@@ -341,6 +341,7 @@
                        ("dict", "NotifyInfoStart", 0),
                        ("dict", "NotifyInfoEnd", 0),
                        ("list", "NotifyInfoLoop", 0),
                        ("WORD", "LimitWorldLV", 0),
                        ("WORD", "LVLimit", 0),
                        ("BYTE", "IsDayReset", 0),
                        ),
@@ -1347,6 +1348,7 @@
        self.NotifyInfoStart = {}
        self.NotifyInfoEnd = {}
        self.NotifyInfoLoop = []
        self.LimitWorldLV = 0
        self.LVLimit = 0
        self.IsDayReset = 0
        return
@@ -1363,6 +1365,7 @@
    def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
    def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
    def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
    def GetLimitWorldLV(self): return self.LimitWorldLV # 限制开启的最低世界等级
    def GetLVLimit(self): return self.LVLimit # 限制等级
    def GetIsDayReset(self): return self.IsDayReset # 是否每天重置
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1117,7 +1117,7 @@
                                Def_UniversalGameRecType_ArenaBattleRecord, # 竞技场玩家挑战记录 15
                                Def_UniversalGameRecType_CrossActInfo, # 跨服运营活动信息记录 16
                                Def_UniversalGameRecType_FeastWish, #节日祝福大奖记录17
                                Def_UniversalGameRecType_18,
                                Def_UniversalGameRecType_ActWorldLVLimitInfo, # 运营活动世界等级限制开启信息 18
                                Def_UniversalGameRecType_19,
                                Def_UniversalGameRecType_20,
                                Def_UniversalGameRecType_21,
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1117,7 +1117,7 @@
                                Def_UniversalGameRecType_ArenaBattleRecord, # 竞技场玩家挑战记录 15
                                Def_UniversalGameRecType_CrossActInfo, # 跨服运营活动信息记录 16
                                Def_UniversalGameRecType_FeastWish, #节日祝福大奖记录17
                                Def_UniversalGameRecType_18,
                                Def_UniversalGameRecType_ActWorldLVLimitInfo, # 运营活动世界等级限制开启信息 18
                                Def_UniversalGameRecType_19,
                                Def_UniversalGameRecType_20,
                                Def_UniversalGameRecType_21,