From ce1444c541211107fa3300d75982ae36589b5451 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 31 十月 2025 15:01:22 +0800
Subject: [PATCH] 165 【挑战】天子的考验-服务端(优化生命条变更时B419同步最新当前生命最大生命;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
index a6c0330..6a8d932 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
@@ -278,6 +278,39 @@
     curCache.SetOffTime(GameWorld.ChangeTimeStrToNum(dbPlayer.LogoffTime) if dbPlayer.LogoffTime else 0)
     return curCache
 
+def GetPlayerBaseViewInfo(playerID, curPlayer=None):
+    ## 获取玩家基础查看信息
+    baseInfo = {}
+    if not curPlayer:
+        curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
+    if curPlayer:
+        baseInfo = {
+                    "Name":curPlayer.GetPlayerName(),
+                    "LV":curPlayer.GetLV(),
+                    "Job":curPlayer.GetJob(),
+                    "RealmLV":curPlayer.GetOfficialRank(),
+                    "Face":curPlayer.GetFace(),
+                    "FacePic":curPlayer.GetFacePic(),
+                    "TitleID":PlayerControl.GetTitleID(curPlayer),
+                    "ServerID":GameWorld.GetPlayerServerID(curPlayer),
+                    "FightPower":PlayerControl.GetFightPower(curPlayer),
+                    }
+    else:
+        viewCache = FindViewCache(playerID)
+        if viewCache:
+            baseInfo = {
+                        "Name":viewCache.GetPlayerName(),
+                        "LV":viewCache.GetLV(),
+                        "Job":viewCache.GetJob(),
+                        "RealmLV":viewCache.GetRealmLV(),
+                        "Face":viewCache.GetFace(),
+                        "FacePic":viewCache.GetFacePic(),
+                        "TitleID":viewCache.GetTitleID(),
+                        "ServerID":viewCache.GetServerID(),
+                        "FightPower":viewCache.GetFightPowerTotal(),
+                        }
+    return baseInfo
+
 def GetRobotByViewCache(curCache):
     ## 根据缓存内容获取机器人数据
     if not curCache:

--
Gitblit v1.8.0