From 1a81c331e39c3968aea504e0804145dcd1f1f56e Mon Sep 17 00:00:00 2001 From: "Liubing\\LB" Date: Tue, 13 Oct 2026 20:39:03 +0800 Subject: [PATCH] =?UTF-8?q?build(kv):=20=E5=AE=8C=E5=96=84=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=AE=8F=E5=A4=84=E7=90=86=E5=92=8C=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=9C=8D=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Assets/Editor/BuildTool.cs | 38 +++++++++-- Client/Assets/Editor/DebugConfig.cs | 70 ++++++++++++++++++-- Client/ProjectSettings/ProjectSettings.asset | 2 +- 3 files changed, 100 insertions(+), 10 deletions(-) diff --git a/Client/Assets/Editor/BuildTool.cs b/Client/Assets/Editor/BuildTool.cs index b0b6afa91..a11737041 100644 --- a/Client/Assets/Editor/BuildTool.cs +++ b/Client/Assets/Editor/BuildTool.cs @@ -631,9 +631,24 @@ public class BuildTool { var buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup; PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup, out string[] symbols); - if (symbols.Contains(dfs)) return; var newDefines = new List(symbols); - newDefines.Add(dfs); + var changed = false; + foreach (var symbol in dfs.Split(';')) + { + if (string.IsNullOrEmpty(symbol)) + { + continue; + } + if (!newDefines.Contains(symbol)) + { + newDefines.Add(symbol); + changed = true; + } + } + if (!changed) + { + return; + } PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, string.Join(";", newDefines.ToArray())); } @@ -641,9 +656,24 @@ public class BuildTool { var buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup; PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup, out string[] symbols); - if (!symbols.Contains(dfs)) return; var newDefines = new List(symbols); - newDefines.Remove(dfs); + var changed = false; + foreach (var symbol in dfs.Split(';')) + { + if (string.IsNullOrEmpty(symbol)) + { + continue; + } + if (newDefines.Contains(symbol)) + { + newDefines.Remove(symbol); + changed = true; + } + } + if (!changed) + { + return; + } PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, string.Join(";", newDefines.ToArray())); } diff --git a/Client/Assets/Editor/DebugConfig.cs b/Client/Assets/Editor/DebugConfig.cs index 4f0efc66c..7bb07567e 100644 --- a/Client/Assets/Editor/DebugConfig.cs +++ b/Client/Assets/Editor/DebugConfig.cs @@ -25,6 +25,7 @@ public class DebugConfig private const string s101StaicResUrl = "http://s101.local:8080/{0}"; private const string s101AddrUrl = "http://s101.local:8080/{0}/{1}"; private const string s101EventAPIUrl = "http://s101.local:18080/"; + private const string localTestEventAPIUrl = "http://172.16.69.228:8080/"; private const string s101RTMPid = "80000560"; private const string s101RTMServerEndpoint = "rtm-nx-front.ilivedata.com:13321"; private const string s101RTMHmacSecret = "7a1ba6bb85a4473d96fa4bf45b01f1dd"; @@ -97,10 +98,15 @@ public class DebugConfig public static bool MustaphSvrValidation() { var config = Config; - if (config != null && config.StaticResURL == string.Format(mustaphaStaicResUrl, VersionTool.PackVer)) + if (config != null && config.StaticResURL == string.Format(mustaphaStaicResUrl, VersionTool.PackVer) && + config.EventApiURL == mustaphaEventAPIUrl) + { Menu.SetChecked("Tools/Debug/Mustaph Svr", true); + } else + { Menu.SetChecked("Tools/Debug/Mustaph Svr", false); + } return true; } @@ -125,10 +131,15 @@ public class DebugConfig public static bool LiubingSvrValidation() { var config = Config; - if (config != null && config.StaticResURL == string.Format(liubingStaicResUrl, VersionTool.PackVer)) + if (config != null && config.StaticResURL == string.Format(liubingStaicResUrl, VersionTool.PackVer) && + config.EventApiURL == liubingEventAPIUrl) + { Menu.SetChecked("Tools/Debug/Liubing Svr", true); + } else + { Menu.SetChecked("Tools/Debug/Liubing Svr", false); + } return true; } @@ -156,10 +167,49 @@ public class DebugConfig public static bool Svr101Validation() { var config = Config; - if (config != null && config.StaticResURL == string.Format(s101StaicResUrl, VersionTool.PackVer)) + if (config != null && config.StaticResURL == string.Format(s101StaicResUrl, VersionTool.PackVer) && + config.EventApiURL == s101EventAPIUrl) + { Menu.SetChecked("Tools/Debug/Svr 101", true); + } else + { Menu.SetChecked("Tools/Debug/Svr 101", false); + } + return true; + } + + [MenuItem("Tools/Debug/Svr Local 172.16.69.228")] + public static void SvrLocal() + { + Newtonsoft.Json.Linq.JObject config; + if (File.Exists(DebugConfigPath)) + { + config = Newtonsoft.Json.Linq.JObject.Parse(File.ReadAllText(DebugConfigPath)); + } + else + { + config = Newtonsoft.Json.Linq.JObject.FromObject(new TmpClas + { + EventApiURL = s101EventAPIUrl, + StaticResURL = string.Format(s101StaicResUrl, VersionTool.PackVer), + Custom_Addressable_URL = string.Format(s101AddrUrl, VersionTool.PackVer, EditorUserBuildSettings.activeBuildTarget), + RTMPid = s101RTMPid, + RTMServerEndpoint = s101RTMServerEndpoint, + RTMHmacSecret = s101RTMHmacSecret, + FuncUrl = s101FuncUrl, + FuncKey = s101FuncKey + }); + } + config["EventApiURL"] = localTestEventAPIUrl; + File.WriteAllText(DebugConfigPath, config.ToString(Formatting.Indented)); + } + + [MenuItem("Tools/Debug/Svr Local 172.16.69.228", true)] + public static bool SvrLocalValidation() + { + var config = Config; + Menu.SetChecked("Tools/Debug/Svr Local 172.16.69.228", config != null && config.EventApiURL == localTestEventAPIUrl); return true; } @@ -208,10 +258,15 @@ public class DebugConfig public static bool SvrDevValidation() { var config = Config; - if (config != null && config.StaticResURL == string.Format(devStaicResUrl, VersionTool.PackVer)) + if (config != null && config.StaticResURL == string.Format(devStaicResUrl, VersionTool.PackVer) && + config.EventApiURL == devEventAPIUrl) + { Menu.SetChecked("Tools/Debug/Svr Dev", true); + } else + { Menu.SetChecked("Tools/Debug/Svr Dev", false); + } return true; } @@ -243,10 +298,15 @@ public class DebugConfig public static bool SvrTimeshiftValidation() { var config = Config; - if (config != null && config.StaticResURL == string.Format(timeShiftStaicResUrl, VersionTool.PackVer)) + if (config != null && config.StaticResURL == string.Format(timeShiftStaicResUrl, VersionTool.PackVer) && + config.EventApiURL == timeShiftEventAPIUrl) + { Menu.SetChecked("Tools/Debug/Svr timeshift", true); + } else + { Menu.SetChecked("Tools/Debug/Svr timeshift", false); + } return true; } diff --git a/Client/ProjectSettings/ProjectSettings.asset b/Client/ProjectSettings/ProjectSettings.asset index 4c33c0ea6..77cbb02c4 100644 --- a/Client/ProjectSettings/ProjectSettings.asset +++ b/Client/ProjectSettings/ProjectSettings.asset @@ -881,7 +881,7 @@ PlayerSettings: webGLMemoryGeometricGrowthCap: 96 webGLPowerPreference: 2 scriptingDefineSymbols: - Android: UNITY_POST_PROCESSING_STACK_V2;CREST_OCEAN;RTM_BUILD_NO_AUDIO;ACTK_WALLHACK_LINK_XML + Android: UNITY_POST_PROCESSING_STACK_V2;CREST_OCEAN;RTM_BUILD_NO_AUDIO;ACTK_WALLHACK_LINK_XML;USE_KV Bratwurst: UNITY_POST_PROCESSING_STACK_V2 EmbeddedLinux: UNITY_POST_PROCESSING_STACK_V2;ACTK_WALLHACK_LINK_XML GameCoreScarlett: ACTK_WALLHACK_LINK_XML