7874 【主干】【后端】跨服匹配机器人段位限制变更(去除上榜条件限制)
1个文件已修改
49 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py
@@ -238,17 +238,9 @@
    
    # 进行匹配
    if requestType == 1:
        dayFreeMatchCountMax = IpyGameDataPY.GetFuncCfg("CrossRealmPKMatchCount", 1)
        if dayFreeMatchCountMax:
            todayPKCount  = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount)
            todayBuyCount  = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayBuyCount)
            todayItemAddCount  = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
            if todayPKCount >= (dayFreeMatchCountMax + todayBuyCount + todayItemAddCount):
                GameWorld.DebugLog("PK次数不足,无法发起匹配! todayPKCount=%s >= (dayFreeMatchCountMax=%s + todayBuyCount=%s + todayItemAddCount=%s)"
                                   % (todayPKCount, dayFreeMatchCountMax, todayBuyCount, todayItemAddCount), playerID)
                return
        if not CheckHavePKCount(curPlayer):
            return
        dataMsg = {
                   "seasonID":GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID), # 赛季ID
                   "pkZoneID":GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID), # PK赛区
@@ -276,6 +268,20 @@
        GameWorld.Log("    发送取消匹配到GameServer sendMsg=%s" % str(sendMsg), playerID)
        
    return
def CheckHavePKCount(curPlayer):
    ## 检查是否有PK次数
    dayFreeMatchCountMax = IpyGameDataPY.GetFuncCfg("CrossRealmPKMatchCount", 1)
    if dayFreeMatchCountMax:
        todayPKCount  = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount)
        todayBuyCount  = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayBuyCount)
        todayItemAddCount  = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
        if todayPKCount >= (dayFreeMatchCountMax + todayBuyCount + todayItemAddCount):
            GameWorld.DebugLog("PK次数不足,无法发起匹配! todayPKCount=%s >= (dayFreeMatchCountMax=%s + todayBuyCount=%s + todayItemAddCount=%s)"
                               % (todayPKCount, dayFreeMatchCountMax, todayBuyCount, todayItemAddCount), curPlayer.GetPlayerID())
            return False
    return True
def CrossServerMsg_PKOverInfo(curPlayer, overInfo):
    ## 收到跨服服务器的PK结算信息
@@ -369,15 +375,18 @@
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    playerID = curPlayer.GetPlayerID()
    isWinner = clientData.IsWin
    billboardCfg = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKCfg", 1, [])
    if not billboardCfg or len(billboardCfg) != 2:
        GameWorld.ErrLog("跨服竞技场排行榜配置错误!")
        return
    danLVLimit = billboardCfg[1]
    playerDanLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_DanLV)
    #策划设计该机器人目的为了前期体验,这里只验证是否超过上榜段位即可,即使作弊也不管,只要有次数即可
    if playerDanLV >= danLVLimit:
        GameWorld.ErrLog("该段位不允许与机器人匹配PK!playerDanLV=%s,danLVLimit=%s" % (playerDanLV, danLVLimit), playerID)
#    billboardCfg = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKCfg", 1, [])
#    if not billboardCfg or len(billboardCfg) != 2:
#        GameWorld.ErrLog("跨服竞技场排行榜配置错误!")
#        return
#    danLVLimit = billboardCfg[1]
#    playerDanLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_DanLV)
#    #策划设计该机器人目的为了前期体验,这里只验证是否超过上榜段位即可,即使作弊也不管,只要有次数即可
#    if playerDanLV >= danLVLimit:
#        GameWorld.ErrLog("该段位不允许与机器人匹配PK!playerDanLV=%s,danLVLimit=%s" % (playerDanLV, danLVLimit), playerID)
#        return
    if not CheckHavePKCount(curPlayer):
        return
    
    zoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)