10263 【越南】【BT】增加后台执行命令清除本服榜单某个玩家ID数据: ClearBillboardData
1个文件已添加
56 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/GM/GMTExec/ClearBillboardData.py 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GM/GMTExec/ClearBillboardData.py
New file
@@ -0,0 +1,56 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Script.GM.GMTExec.ClearBillboardData
#
# @todo:清除本服榜单某个玩家数据
# @author hxp
# @date 2025-06-11
# @version 1.0
#
# 详细描述: 清除本服榜单某个玩家数据
#
#-------------------------------------------------------------------------------
#"""Version = 2025-06-11 17:30"""
#-------------------------------------------------------------------------------
def runMyCMD(exec_locals):
    ''' 运行命令函数
    @param exec_locals: GMT_Execfile 模块中的 DoLogic 函数 locals()
    import 其他模块需要写在此函数里,不然无法引用到
    '''
    import GameWorld
    import ShareDefine
    orderId = exec_locals["orderId"]
    cmdInfo = exec_locals["cmdInfo"]
    resultDict = exec_locals["resultDict"] # 建议都进行更新结果字典记录详细处理信息,GMT_Execfile 模块会统一写入流向
    ## ----------------------- 清除设置 -----------------------
    DelPlayerID = 443560 # 需要删除的玩家ID
    ## -------------------------------------------------------
    delInBillboardList = []
    for billboardIndex in ShareDefine.BillboardTypeList:
        if billboardIndex in ShareDefine.FamilyBillboardList:
            continue
        billboard = GameWorld.GetBillboard().FindBillboard(billboardIndex)
        if not billboard:
            continue
        if not billboard.FindByID(DelPlayerID):
            continue
        billboard.DeleteByID(DelPlayerID)
        billboard.Sort()
        delInBillboardList.append(billboardIndex)
    # 以下为详细处理逻辑
    GameWorld.Log("This is GameServer GMT_Execfile run %s. orderId=%s" % (cmdInfo, orderId))
    resultDict.update({"ret":1, "DelPlayerID":DelPlayerID, "delInBillboardList":delInBillboardList})
    return
exec_locals = locals()
if exec_locals.get("cmdInfo"):
    runMyCMD(exec_locals)