hxp
2020-12-07 8a7181b35a5f4063fb84fcb3120394faeaba2f77
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py
@@ -151,6 +151,33 @@
    GameWorld.Log('billboardIndex %s clear.'%billboardIndex)
    return
def UpdateBillboardMaxCount(billboardIndex, updMaxCount, isDelExtra=True):
    ''' 变更竞技场榜单最大数据数
    @param updMaxCount: 更新的最大数据排名
    @param isDelExtra: 是否删除原榜单排名数据超过更新后的最大排名,默认删除
    '''
    billBoard = GameWorld.GetBillboard().FindBillboard(billboardIndex)
    if not billBoard:
        return
    curCount = billBoard.GetCount()
    curMaxCount = billBoard.GetMaxCount()
    # 不超过程序内置配置的最大数量
    if billboardIndex in ChConfig.Def_BT_Cnt:
        updMaxCount = min(updMaxCount, ChConfig.Def_BT_Cnt[billboardIndex])
    if curMaxCount == updMaxCount:
        return
    billBoard.SetMaxCount(updMaxCount)
    GameWorld.Log("    变更榜单最大数据数! billboardIndex=%s,curCount=%s,curMaxCount=%s,updMaxCount=%s"
                  % (billboardIndex, curCount, curMaxCount, updMaxCount))
    # 清除多余榜单数据
    if isDelExtra and curCount > updMaxCount:
        for delIndex in xrange(curCount - 1, updMaxCount - 1, -1):
            if delIndex >= 0:
                GameWorld.Log("        DeleteByIndex: %s" % delIndex)
                billBoard.DeleteByIndex(delIndex)
    return
####################################################################################################
#class   IPY_GSetWatchBillboardState
@@ -213,6 +240,9 @@
    if packType in ChConfig.Def_InterdictLook_BT_Type:
        #不可通过此封包查看
        return
    if ChConfig.Def_BT_Cnt.get(packType, 0) > 100:
        GameWorld.DebugLog("该榜单最大名次较大,需使用分页查询! A9 A2 查看排行榜#tagCPYWatchBillboard")
        return
    if not __CheckWatchCD(curPlayer, packType, tick):
        return