From 2334c75ef35c5ef5432f883c0eb2f4a22209a94a Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 11 六月 2025 17:18:56 +0800 Subject: [PATCH] 10263 【越南】【BT】增加后台执行命令清除本服榜单某个玩家ID数据: ClearBillboardData --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py | 52 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 20 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py index ca043b2..28611ad 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerGeTui.py @@ -25,7 +25,6 @@ import PyDataManager import time import json -import cPickle # VIP权限 Def_Onoff_VIPCount = 5 ( @@ -87,14 +86,6 @@ # 检查是否可以个推,geTuiType小于0的代表默认可推,无VIP限制 def CheckCanGeTui(playerCache, geTuiType=-1): - if not playerCache.get("GeTuiClientID", ""): - return False - - # 离线超过24小时不再推送,目前极光推送的特点是推送ID同机器不同包都是同一个ID - if not playerCache.get("Time", 0): - return False - if time.time() - playerCache.get("Time", 0) > 24*60*60: - return False if not playerCache.get("VIPLV", 0): if geTuiType < 0: @@ -264,6 +255,16 @@ return True return True +# 个推基础判定 +def CanGeTuiByCache(curCache): + if not curCache.GeTuiID: + return False + + # 离线超过24小时不再推送,目前极光推送的特点是推送ID同机器不同包都是同一个ID + if time.time() - curCache.OffTime > 24*60*60: + return False + return True + def BossAttentionGeTui(bossData, bossID): if bossData.GetMapID() == ChConfig.Def_FBMapID_SealDemon: # 非VIP玩家 封魔坛个推 @@ -282,17 +283,24 @@ curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID) if curPlayer and not PlayerControl.GetIsTJG(curPlayer): continue - - recordDict = cPickle.loads(bossAttentionData.RecordData) + + # 离线玩家 + curCache = PlayerViewCache.FindViewCache(playerID) + if not curCache: + continue + + if not CanGeTuiByCache(curCache): + #无推送资格,减少检索和eval + continue + + recordDict = eval(bossAttentionData.RecordData) if recordDict.get(bossID, 0) in [0, 9]: #0-默认未关注, 1-主动关注, 2-自动关注, 9-主动取消关注 continue - curCache = PlayerViewCache.ViewCacheMgr.FindCache(playerID) - if not curCache: - continue - cacheDict = cPickle.loads(curCache.GetPropData()) + + cacheDict = PlayerViewCache.GetCachePropDataDict(curCache) if not CheckCanGeTui(cacheDict, geTuiType): - # 过滤个推 + # 个推逻辑检查 continue if not CheckBossGeTuiCnt(playerID, bossID, geTuiType, cacheDict): @@ -303,7 +311,7 @@ if appID not in appIDDict: appIDDict[appID] = [] - appIDDict[appID].append([cacheDict.get("GeTuiClientID", ""), cacheDict.get("Name", "")]) + appIDDict[appID].append([curCache.GeTuiID, cacheDict.get("Name", "")]) if not appIDDict: @@ -324,17 +332,21 @@ # 私聊 def ChatMiGeTui(playerID, playerName, tagPlayerName): - curCache = PlayerViewCache.ViewCacheMgr.FindCache(playerID) + curCache = PlayerViewCache.FindViewCache(playerID) if not curCache: return - cacheDict = cPickle.loads(curCache.GetPropData()) + if not CanGeTuiByCache(curCache): + #无推送资格,基础判定 + return + + cacheDict = PlayerViewCache.GetCachePropDataDict(curCache) if not CheckCanGeTui(cacheDict, Def_Onoff_Chat): # 过滤个推 return showStr = GameWorld.GbkToCode(IpyGameDataPY.GetFuncCfg("GeTuiOffLine", 3))%(tagPlayerName) # 文字信息 - GeTuiNotify({cacheDict.get("AppID", ""):[[cacheDict.get("GeTuiClientID", ""), playerName]]}, showStr) + GeTuiNotify({cacheDict.get("AppID", ""):[[curCache.GeTuiID, playerName]]}, showStr) return # 下线时,低级玩家没有离线时间的玩家提示, 上线清空 -- Gitblit v1.8.0