ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldArena.py
@@ -270,6 +270,7 @@
    # 删除对战记录
    GameWorld.GetUniversalRecMgr().Delete(Def_RecType_ArenaBattleRecord)
    PyGameData.g_arenaPlayerBattleRecDict = {}
    PyGameData.g_arenaPlayerMatchDict = {}
    
    # 更新新赛季信息
    if openServerDay <= customMaxServerDay and OSSeasonState == 0:
@@ -526,7 +527,7 @@
    
    # 匹配刷新
    if cmd == "MatchRefresh":
        __DoArenaMatchRefresh(curPlayer, cmdDict["isRefresh"], cmdDict["playerLV"], cmdDict["playerScore"])
        __DoArenaMatchRefresh(curPlayer, cmdDict["isRefresh"], cmdDict["playerLV"], cmdDict["playerScore"], cmdDict.get("gmMatchIDList"))
        
    # 对战结算
    elif cmd == "BattleResult":
@@ -534,7 +535,7 @@
        
    return msgList + [retDict]
def __DoArenaMatchRefresh(curPlayer, isRefresh, playerLV, playerScore):
def __DoArenaMatchRefresh(curPlayer, isRefresh, playerLV, playerScore, gmMatchIDList=None):
    ## 玩家刷新匹配对手
    
    playerID = curPlayer.GetPlayerID()
@@ -568,13 +569,13 @@
        playerOrder = maxOrder + 1
        
    GameWorld.DebugLog("    maxOrder=%s,playerOrder=%s" % (maxOrder, playerOrder), playerID)
    highRandOrder, lowRandOrder = IpyGameDataPY.GetFuncEvalCfg("ArenaMatch", 5) # 前X名匹配比自己高名次时直接随机
    matchOrderList = [] # 匹配到的名次
    # 非第一名的匹配比自身名次高的
    if playerOrder > 1 and higherOrderPerList:
        higherOrderCount = playerOrder - 1 # 比玩家高的名次的个数
        # 小于10个的直接纯随机
        if 0 < higherOrderCount < 10:
        if 0 < higherOrderCount < highRandOrder:
            randOrderList = range(1, playerOrder)
            random.shuffle(randOrderList)
            matchOrderList.extend(randOrderList[:len(higherOrderPerList)])
@@ -582,7 +583,7 @@
                               % (higherOrderCount, randOrderList, matchOrderList), playerID)
            
        # 按比例划分
        elif higherOrderCount >= 10:
        elif higherOrderCount >= highRandOrder:
            randMaxOrder = playerOrder - 1
            for per in higherOrderPerList:
                per = min(per, 100) # 最多到100
@@ -605,7 +606,7 @@
    if 1 <= playerOrder < maxOrder and lowerOrderPerList:
        lowerOrderCount = maxOrder - playerOrder # 比玩家低的名次的个数
        # 小于10个的直接纯随机
        if 0 < lowerOrderCount < 10:
        if 0 < lowerOrderCount < lowRandOrder:
            randOrderList = range(playerOrder + 1, maxOrder + 1)
            random.shuffle(randOrderList)
            matchOrderList.extend(randOrderList[:len(lowerOrderPerList)])
@@ -613,7 +614,7 @@
                               % (lowerOrderCount, randOrderList, matchOrderList), playerID)
            
        # 按比例划分
        elif lowerOrderCount >= 10:
        elif lowerOrderCount >= lowRandOrder:
            randMinOrder = playerOrder + 1
            for per in lowerOrderPerList:
                per = min(per, 100) # 最多到100
@@ -643,17 +644,44 @@
                                       % (higherLackCount, randOrderMin, randOrderMax, randOrder, matchOrderList), playerID)
                    
    matchOrderList.sort()
    # GM指定匹配测试
    if gmMatchIDList != None and curPlayer.GetGMLevel():
        gmMatchOrderList = []
        for gmMatchID in gmMatchIDList:
            if gmMatchID == playerID:
                GameWorld.DebugAnswer(curPlayer, "目标ID不能是自己!无法匹配!%s" % gmMatchID)
                continue
            gmMatchOrder = billBoard.IndexOfByID(gmMatchID) + 1
            if gmMatchOrder <= 0:
                GameWorld.DebugAnswer(curPlayer, "目标ID不在榜单上!无法匹配!%s" % gmMatchID)
                continue
            if gmMatchOrder in matchOrderList:
                continue
            gmMatchOrderList.append(gmMatchOrder)
            GameWorld.DebugAnswer(curPlayer, "指定匹配ID(%s),order(%s)" % (gmMatchID, gmMatchOrder), playerID)
        GameWorld.DebugLog("matchOrderList=%s,needMatchCount=%s" % (str(matchOrderList), needMatchCount))
        if matchOrderList:
            matchOrderList = matchOrderList[:needMatchCount - len(gmMatchOrderList)]
        matchOrderList += gmMatchOrderList
        matchOrderList.sort()
    matchRobotRate = IpyGameDataPY.GetFuncCfg("ArenaMatch", 4) # 每次可直接匹配一个机器人概率
    if matchRobotRate and matchOrderList and len(matchOrderList) >= needMatchCount and GameWorld.CanHappen(matchRobotRate, 100):
        popOrder = matchOrderList.pop(-1) # 去掉最后一个
        GameWorld.DebugLog("    概率匹配到一个机器人,去掉最后一个! matchRobotRate=%s,popOrder=%s" % (matchRobotRate, popOrder), playerID)
    GameWorld.DebugLog("    最终匹配到的名次列表: matchOrderList=%s" % matchOrderList, playerID)
    
    # 随机机器人备用信息
    openJobList = IpyGameDataPY.GetFuncEvalCfg("OpenJob", 1)
    openJobList = IpyGameDataPY.GetFuncEvalCfg("OpenJob", 1)
    
    randRobotLVPerRange = IpyGameDataPY.GetFuncEvalCfg("ArenaMatch", 3)
    minLV, maxLV = IpyGameDataPY.GetFuncEvalCfg("ArenaRobot", 2) # 机器人最小、最大等级
    randMinLV = min(minLV, int(playerLV * randRobotLVPerRange[0] / 100.0))
    randMaxLV = min(maxLV, int(playerLV * randRobotLVPerRange[1] / 100.0))
    minLV, _ = IpyGameDataPY.GetFuncEvalCfg("ArenaRobot", 2) # 机器人最小、最大等级
    randMinLV, randMaxLV = minLV - 10, minLV
    #randMinLV = min(minLV, int(playerLV * randRobotLVPerRange[0] / 100.0))
    #randMaxLV = min(maxLV, int(playerLV * randRobotLVPerRange[1] / 100.0))
    
    randRobotScorePerRange = IpyGameDataPY.GetFuncEvalCfg("ArenaMatch", 4)
    randRobotScorePerRange = IpyGameDataPY.GetFuncEvalCfg("ArenaMatch", 3)
    randMinScore = int(playerScore * randRobotScorePerRange[0] / 100.0)
    randMaxScore = int(playerScore * randRobotScorePerRange[1] / 100.0)