From f1feca4954870372a217edb8c01b6afa389587eb Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Fri, 10 Apr 2026 17:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=89=93=E5=8C=85=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=89=93=E5=8C=85=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/Scripts/HotUpdate/GameLauncher.cs | 76 +------------------ ProjectNLD/Assets/PhxhSDK | 2 +- 2 files changed, 3 insertions(+), 75 deletions(-) diff --git a/ProjectNLD/Assets/Code/Scripts/HotUpdate/GameLauncher.cs b/ProjectNLD/Assets/Code/Scripts/HotUpdate/GameLauncher.cs index 5cddebbfdb0..100d095acf6 100644 --- a/ProjectNLD/Assets/Code/Scripts/HotUpdate/GameLauncher.cs +++ b/ProjectNLD/Assets/Code/Scripts/HotUpdate/GameLauncher.cs @@ -24,8 +24,6 @@ using UnityEngine.Android; public class GameLauncher : MonoBehaviour { - private const string VersionDisplayPlaceholder = "----"; - #if USE_OBFUZ private static bool _isSetUpStaticSecret = false; /// @@ -219,7 +217,7 @@ public class GameLauncher : MonoBehaviour UpdateLocalInfo localInfo = PackDataInst.Inst.localInfo; string acquiring = LocalizeMono.Instance.GetLocalizeText("Acquiring"); // 获取中... - string displayLocalVersion = FormatVersionForDisplay(localInfo.localFullVersion); + string displayLocalVersion = VersionDisplayFormatter.Format(localInfo.localFullVersion, "[LTRes]GameLauncher"); Debug.Log("[LTRes]GameLauncher - ShowVersion关键日志 stage=LaunchInit, fullOldVersion=" + localInfo.localFullVersion + ", fullNewVersion=" + acquiring + ", displayOldVersion=" + displayLocalVersion + ", displayNewVersion=" + acquiring + ", serverName=" + acquiring); versionUpdateUI.ShowVersion(Application.version, localInfo.workSpace, displayLocalVersion, acquiring, acquiring); @@ -254,7 +252,7 @@ public class GameLauncher : MonoBehaviour downloadResult = await PreConfig.instance.DownloadConfig(); versionUpdateUI.UpdateProgressText(LocalizeMono.Instance.GetLocalizeText("RequestConfigurationComplete")); // 请求APPConfig结束 - string displayLocalVersionAfterConfig = FormatVersionForDisplay(localInfo.localFullVersion); + string displayLocalVersionAfterConfig = VersionDisplayFormatter.Format(localInfo.localFullVersion, "[LTRes]GameLauncher"); Debug.Log("[LTRes]GameLauncher - ShowVersion关键日志 stage=ConfigReady, fullOldVersion=" + localInfo.localFullVersion + ", fullNewVersion=" + acquiring + ", displayOldVersion=" + displayLocalVersionAfterConfig + ", displayNewVersion=" + acquiring + ", serverName=" + PreConfig.instance.ServerName); versionUpdateUI.ShowVersion(Application.version, localInfo.workSpace, displayLocalVersionAfterConfig, acquiring, PreConfig.instance.ServerName); BIToolinAOT.Instance.TrackEventInAOT("app_config_response", new System.Collections.Generic.Dictionary(){ @@ -384,76 +382,6 @@ public class GameLauncher : MonoBehaviour { realProgess = progress; } - - private static string FormatVersionForDisplay(string fullVersion) - { - if (string.IsNullOrWhiteSpace(fullVersion)) - return VersionDisplayPlaceholder; - - if (string.Equals(fullVersion, "unknown", StringComparison.OrdinalIgnoreCase)) - return fullVersion; - - try - { - string defaultVersion = null; - string dllVersion = null; - string configVersion = null; - - string[] segments = fullVersion.Split('|'); - foreach (string segment in segments) - { - if (string.IsNullOrWhiteSpace(segment)) - continue; - - string[] keyValue = segment.Split(new[] { ':' }, 2); - if (keyValue.Length != 2) - continue; - - string key = keyValue[0].Trim(); - string value = keyValue[1].Trim(); - if (string.IsNullOrEmpty(value)) - continue; - - if (string.Equals(key, "default", StringComparison.OrdinalIgnoreCase)) - { - defaultVersion = value; - } - else if (string.Equals(key, "dll", StringComparison.OrdinalIgnoreCase)) - { - dllVersion = value; - } - else if (string.Equals(key, "config", StringComparison.OrdinalIgnoreCase)) - { - configVersion = value; - } - } - - if (defaultVersion == null && dllVersion == null && configVersion == null) - return fullVersion; - - return string.Join("-", new[] - { - ToShortVersionSegment(defaultVersion), - ToShortVersionSegment(dllVersion), - ToShortVersionSegment(configVersion) - }); - } - catch (Exception ex) - { - Debug.LogWarning("[LTRes]GameLauncher - 版本短显示格式化失败, fullVersion=" + fullVersion + ", error=" + ex.Message); - return fullVersion; - } - } - - private static string ToShortVersionSegment(string versionSegment) - { - if (string.IsNullOrWhiteSpace(versionSegment)) - return VersionDisplayPlaceholder; - - return versionSegment.Length <= 4 - ? versionSegment - : versionSegment.Substring(versionSegment.Length - 4, 4); - } #region iOS_DeviceHelper diff --git a/ProjectNLD/Assets/PhxhSDK b/ProjectNLD/Assets/PhxhSDK index c5d78568a5f..6d2c5aca872 160000 --- a/ProjectNLD/Assets/PhxhSDK +++ b/ProjectNLD/Assets/PhxhSDK @@ -1 +1 @@ -Subproject commit c5d78568a5f67dd577c7c668a677866be33f90b5 +Subproject commit 6d2c5aca872b1ba333cb3af84b3435228fb769e3