From 77bba22f0fc0a0e620548731bfb9974553033164 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 07 五月 2026 17:27:37 +0800
Subject: [PATCH] 512 跨服演武场

---
 Main/System/Arena/ArenaPlayerTop3Cell.cs                  |    8 +++-
 Main/Config/ConfigBase.cs                                 |    3 +
 Main/Config/ConfigManager.cs                              |    3 +
 Main/Config/Configs/RobotConfig.cs.meta                   |   11 +++++
 Main/System/Arena/ArenaRecordCell.cs                      |    5 ++
 Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs |    4 ++
 Main/System/Arena/ArenaChallengeCell.cs                   |    7 ++-
 Main/System/Arena/ArenaPlayerRankCell.cs                  |    5 ++
 Main/Config/Configs/RobotConfig.cs                        |   38 +++++++++++++++++++
 Main/System/Arena/ArenaManager.cs                         |    5 ++
 Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs     |    5 ++
 11 files changed, 86 insertions(+), 8 deletions(-)

diff --git a/Main/Config/ConfigBase.cs b/Main/Config/ConfigBase.cs
index e51fef1..c38f266 100644
--- a/Main/Config/ConfigBase.cs
+++ b/Main/Config/ConfigBase.cs
@@ -92,7 +92,8 @@
             var index = line.IndexOf("\t");
             if (index == -1)
             {
-                continue;
+                string result = line.Trim();
+                index = result.Length;
             }
 
             string strKey = line.Substring(0, index);
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 8dc9afe..e9e2723 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -111,6 +111,7 @@
             typeof(PresetUnlockConfig),
             typeof(PriorBundleConfig),
             typeof(RandomNameConfig),
+            typeof(RobotConfig),
             typeof(SignInConfig),
             typeof(SkillSkinConfig),
             typeof(StoreConfig),
@@ -423,6 +424,8 @@
         ClearConfigDictionary<PriorBundleConfig>();
         // 娓呯┖ RandomNameConfig 瀛楀吀
         ClearConfigDictionary<RandomNameConfig>();
+        // 娓呯┖ RobotConfig 瀛楀吀
+        ClearConfigDictionary<RobotConfig>();
         // 娓呯┖ SignInConfig 瀛楀吀
         ClearConfigDictionary<SignInConfig>();
         // 娓呯┖ SkillSkinConfig 瀛楀吀
diff --git a/Main/Config/Configs/RobotConfig.cs b/Main/Config/Configs/RobotConfig.cs
new file mode 100644
index 0000000..7bceaf4
--- /dev/null
+++ b/Main/Config/Configs/RobotConfig.cs
@@ -0,0 +1,38 @@
+锘�//--------------------------------------------------------
+//    [Author]:           YYL
+//    [  Date ]:           Thursday, May 7, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class RobotConfig : ConfigBase<int, RobotConfig>
+{
+    static RobotConfig()
+    {
+        // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+        visit = true; 
+    }
+
+    public int ID;
+
+    public override int LoadKey(string _key)
+    {
+        int key = GetKey(_key);
+        return key;
+    }
+
+    public override void LoadConfig(string input)
+    {
+        try {
+        string[] tables = input.Split('\t');
+        int.TryParse(tables[0],out ID); 
+        }
+        catch (Exception exception)
+        {
+            Debug.LogError(exception);
+        }
+    }
+}
diff --git a/Main/Config/Configs/RobotConfig.cs.meta b/Main/Config/Configs/RobotConfig.cs.meta
new file mode 100644
index 0000000..136fea6
--- /dev/null
+++ b/Main/Config/Configs/RobotConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fcdec0934a6834f498bdf03a22e215c5
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/Arena/ArenaChallengeCell.cs b/Main/System/Arena/ArenaChallengeCell.cs
index da67da5..e63148d 100644
--- a/Main/System/Arena/ArenaChallengeCell.cs
+++ b/Main/System/Arena/ArenaChallengeCell.cs
@@ -49,7 +49,10 @@
         {
             txtAddScore.SetActive(false);
             txtServerName.SetActive(true);
-            txtServerName.text = ServerListCenter.Instance.GetServerName((int)arenaMatchInfo.ServerID);
+            if (ArenaManager.Instance.IsRobot((int)arenaMatchInfo.PlayerID))
+                txtServerName.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+            else
+                txtServerName.text = ServerListCenter.Instance.GetServerName((int)arenaMatchInfo.ServerID);
             txtAddCrossScore.SetActive(true);
             txtAddCrossScore.text = Language.Get("Arena16", ArenaManager.Instance.GetChallengePoints(index));
         }
@@ -80,4 +83,4 @@
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/Main/System/Arena/ArenaManager.cs b/Main/System/Arena/ArenaManager.cs
index d82cdd9..4323c33 100644
--- a/Main/System/Arena/ArenaManager.cs
+++ b/Main/System/Arena/ArenaManager.cs
@@ -503,6 +503,11 @@
         DateTime sunday = seasonStartDate.AddDays(6);
         seasonEndDate = new DateTime(sunday.Year, sunday.Month, sunday.Day, 23, 59, 59);
     }
+
+    public bool IsRobot(int playerID)
+    {
+        return RobotConfig.HasKey(playerID);
+    }
 }
 
 
diff --git a/Main/System/Arena/ArenaPlayerRankCell.cs b/Main/System/Arena/ArenaPlayerRankCell.cs
index 760ec17..aaeec05 100644
--- a/Main/System/Arena/ArenaPlayerRankCell.cs
+++ b/Main/System/Arena/ArenaPlayerRankCell.cs
@@ -68,7 +68,10 @@
             // 璺ㄦ湇鏄剧ず鏈嶅姟鍣ㄥ悕绉�
             if (isCross && serverText != null)
             {
-                serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(rankData.name2));
+                if (ArenaManager.Instance.IsRobot((int)rankData.id))
+                    serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+                else
+                    serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(rankData.name2));
             }
 
             avatarCell.SetListener(() =>
diff --git a/Main/System/Arena/ArenaPlayerTop3Cell.cs b/Main/System/Arena/ArenaPlayerTop3Cell.cs
index 5296485..7ae89e0 100644
--- a/Main/System/Arena/ArenaPlayerTop3Cell.cs
+++ b/Main/System/Arena/ArenaPlayerTop3Cell.cs
@@ -42,12 +42,16 @@
 
         if (isCross && serverText != null)
         {
-            serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(rankData.name2));
+            if (ArenaManager.Instance.IsRobot((int)rankData.id))
+                serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+            else
+                serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(rankData.name2));
         }
 
         queryPlayerBtn.SetListener(() =>
         {
-            AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena);
+            int serverID = (ArenaManager.Instance.IsOpenCrossServer() && rankData.id != PlayerDatas.Instance.baseData.PlayerID) ? UIHelper.GetServerIDByAccount(rankData.name2) : 0;
+            AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
         });
     }
 
diff --git a/Main/System/Arena/ArenaRecordCell.cs b/Main/System/Arena/ArenaRecordCell.cs
index 419044a..f1e817b 100644
--- a/Main/System/Arena/ArenaRecordCell.cs
+++ b/Main/System/Arena/ArenaRecordCell.cs
@@ -52,7 +52,10 @@
             {
                 // 璺ㄦ湇璁板綍锛氭樉绀鸿法鏈嶆椂闂村拰璺ㄦ湇鏈嶅姟鍣�
                 txtCrossDate.text = FormatTime(arenaGameRec.Time);
-                txtServerName.text = ServerListCenter.Instance.GetServerName((int)arenaGameRec.ServerID);
+                if (ArenaManager.Instance.IsRobot((int)arenaGameRec.Value3))
+                    txtServerName.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+                else
+                    txtServerName.text = ServerListCenter.Instance.GetServerName((int)arenaGameRec.ServerID);
             }
             else
             {
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
index 7223cd5..4a15e9a 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
@@ -31,6 +31,10 @@
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
     }
 
+    public bool IsRobot(int playerID)
+    {
+        return RobotConfig.HasKey(playerID);
+    }
 
     public void OnBeforePlayerDataInitializeEventOnRelogin()
     {
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
index 3a5249a..5aeea57 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
@@ -155,7 +155,10 @@
     {
         txtPlayerName.text = viewPlayerData.PlayerName;
         txtPlayerId.text = Language.Get("OtherPlayerDetail02", viewPlayerData.PlayerID);
-        txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(viewPlayerData.ServerID));
+        if (OtherPlayerDetailManager.Instance.IsRobot(viewPlayerData.PlayerID))
+            txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID)));
+        else
+            txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(viewPlayerData.ServerID));
         txtLV.text = viewPlayerData.LV.ToString();
         avatarCell.InitUI(AvatarHelper.GetAvatarModel(viewPlayerData.PlayerID, viewPlayerData.Face, viewPlayerData.FacePic));
         officialTitle.InitUI(viewPlayerData.RealmLV, viewPlayerData.TitleID, 0.65f);

--
Gitblit v1.8.0