From ffa8a645ed6a92a3c723bbf5c7f1eb4d5425c826 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 17 十一月 2021 15:15:34 +0800 Subject: [PATCH] 9341 【BT5】【主干】【后端】情缘系统(优化情缘系统) --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py index 586d56e..088920e 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerBillboard.py @@ -26,8 +26,11 @@ import NetPackCommon import DataRecordPack import PlayerFamily +import PyDataManager +import PlayerViewCache import time +import random Def_Key_BillboardSortTick = "BillboardSortTick_%s" # 排行榜是否排序tick,参数(排行榜类型) Def_Key_BillboardNeedSort = "BillboardNeedSort_%s" # 排行榜是否需要排序,参数(排行榜类型) @@ -522,6 +525,53 @@ #GameWorld.DebugLog("__UpdateBillboardSortState:bType=%s,autoSort=%s,isUpd=%s,needSort=%s" % (bType, autoSort, isUpd, gameWorld.GetDictByKey(key))) return +def GetBillboardOperateInfo(curPlayer): + # 排行榜中所保存的运营商相关信息 + platform = curPlayer.GetAccID() + if platform in ["tencent"]: + return curPlayer.GetOperateInfo() + return platform + +def UpdatePlayerBillboardEx(curPlayer, playerID, bType, cmpValue, cmpValue2=0, cmpValue3=0, value1=0, value2=0, autoSort=False): + ## 更新玩家排行榜 + # @param curPlayer: 可能为None + + playerOpInfo = "" + playerJob = 0 + playerName = "" + playerRealmLV = 0 + + if curPlayer: + playerID = curPlayer.GetID() + playerJob = curPlayer.GetJob() + playerName = curPlayer.GetName() + playerRealmLV = curPlayer.GetOfficialRank() + playerOpInfo = GetBillboardOperateInfo(curPlayer) + else: + socialPlayer = PyDataManager.GetPersonalSocialManager().GetSocialPlayer(playerID) + if socialPlayer: + playerJob = socialPlayer.playerInfo.Job + playerName = socialPlayer.playerInfo.PlayerName + playerRealmLV = socialPlayer.playerInfo.RealmLV + else: + curCache = PlayerViewCache.FindViewCache(playerID) + if curCache: + cacheDict = PlayerViewCache.GetCachePropDataDict(curCache) + playerJob = cacheDict["Job"] + playerName = cacheDict["Name"] + playerRealmLV = cacheDict["RealmLV"] + + if not playerName and playerID < 10000: + playerJob = random.choice([1, 2]) + playerName = "testName%s" % playerID + playerRealmLV = random.randint(1, 10) + + if bType in ShareDefine.BTValue1_OfficialRankList: + value1 = playerRealmLV + + UpdatePlayerBillboard(playerID, playerName, playerOpInfo, bType, playerJob, value1, value2, cmpValue, autoSort, cmpValue2, cmpValue3) + return + #--------------------------------------------------------------------- #=============================================================================== # void SetType(int inputType); //_I_KEY_INDEX_排行榜类型 -- Gitblit v1.8.0