From eb63e35d04e6d7bd55ada7f6dfce2567a8577edb Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 28 十一月 2025 18:30:53 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(机器人增加名字配置)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py          |    4 +++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py |    3 +--
 PySysDB/PySysDBPY.h                                                                           |    1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index a164c34..b56fd56 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -2832,5 +2832,6 @@
 struct	Robot
 {
 	DWORD		_ID;	//机器人ID,同玩家ID
+	char		RobotName;
 	char		ViewCache;	//机器人缓存
 };
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 5e912cc..e256cec 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -2213,6 +2213,7 @@
 
                 "Robot":(
                         ("DWORD", "ID", 1),
+                        ("char", "RobotName", 0),
                         ("char", "ViewCache", 0),
                         ),
                 }
@@ -5517,7 +5518,8 @@
         return
         
     def GetID(self): return self.attrTuple[0] # 机器人ID,同玩家ID DWORD
-    def GetViewCache(self): return self.attrTuple[1] # 机器人缓存 char
+    def GetRobotName(self): return self.attrTuple[1] # char
+    def GetViewCache(self): return self.attrTuple[2] # 机器人缓存 char
 
 
 def Log(msg, playerID=0, par=0):
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 3b1065d..1f63b95 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
@@ -160,7 +160,6 @@
         GameWorld.DebugLog("加载机器人缓存: %s" % playerID)
         curCache = viewCacheMgr.AddPlayerViewCache(playerID)
         curCache = UpdRobotViewCache(curCache, playerID)
-        curCache.SetPlayerName("%s%s" % (GameWorld.GbkToCode("主公"), playerID))
         
     # 假玩家,默认添加
     elif ShareDefine.FackPlayerIDStart <= playerID <= ShareDefine.FackPlayerIDMax:
@@ -365,7 +364,7 @@
     
     #curCache.SetAccID(dbPlayer.AccID)
     
-    curCache.SetPlayerName(robotInfo.get("PlayerName", "p%s" % robotID))
+    curCache.SetPlayerName(GameWorld.GbkToCode(robotIpyData.GetRobotName()))
     curCache.SetLV(robotInfo.get("LV", 1))
     curCache.SetJob(robotInfo.get("Job", 1))
     curCache.SetRealmLV(robotInfo.get("RealmLV", 0))

--
Gitblit v1.8.0