From bfd8fd4b9c4b77451c7e7e4889b7660764ac2a31 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 16 三月 2021 10:03:46 +0800
Subject: [PATCH] 4986 【主干】【BT2】测试外网数据限时礼包更新后 显示异常(修复活动封包顺序问题)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py
index 57e9abd..f604d6c 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py
+++ b/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
--
Gitblit v1.8.0