New file |
| | |
| | | #!/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) |
| | | |