From b313c600796dd03ad19bd52fdcd9f6c294dd52bf Mon Sep 17 00:00:00 2001 From: Blank Date: Sat, 10 Oct 2026 18:28:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(localization):=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=20Keys.Hotfix.StartUp=20=E4=B8=BA=20StartUpModule=20?= =?UTF-8?q?=E6=B6=88=E9=99=A4=20S3218=20=E9=81=AE=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 Keys.Hotfix 下嵌套类 StartUp 重命名为 StartUpModule,消除对 Keys.StartUp(Keys.StartUp.cs 公共键容器)的 Sonar S3218 嵌套遮蔽。同步 AppStartUpHotfixGameByMain.cs 5 处类型引用;const 字面量 Hotfix.StartUp.* 与外层 Keys.StartUp 公共 API 及双 resx 逐字不变。 Linear: GFX-884 --- .../StartUp/AppStartUpHotfixGameByMain.cs | 10 +++++----- GameFrameX.Localization/Keys.Hotfix.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GameFrameX.Hotfix/StartUp/AppStartUpHotfixGameByMain.cs b/GameFrameX.Hotfix/StartUp/AppStartUpHotfixGameByMain.cs index 5fd568d5..1327178b 100644 --- a/GameFrameX.Hotfix/StartUp/AppStartUpHotfixGameByMain.cs +++ b/GameFrameX.Hotfix/StartUp/AppStartUpHotfixGameByMain.cs @@ -105,7 +105,7 @@ public async Task RunServer(bool reload = false) protected override async ValueTask OnDisconnected(IAppSession appSession, CloseEventArgs disconnectEventArgs) { // Localization: Hotfix.StartUp.ClientDisconnected - 客户端断开连接 - 会话ID: {0}, 断开原因: {1} - LogHelper.Info(LocalizationService.GetString(Localization.Keys.Hotfix.StartUp.ClientDisconnected, appSession.SessionId, disconnectEventArgs.Reason)); + LogHelper.Info(LocalizationService.GetString(Localization.Keys.Hotfix.StartUpModule.ClientDisconnected, appSession.SessionId, disconnectEventArgs.Reason)); var session = PlayerSessionManager.Instance.Remove(appSession.SessionId); if (session != null && session.PlayerId > 0) { @@ -167,7 +167,7 @@ private async ValueTask HandleNetworkMessagePackageAsync(IAppSession session, Ne if (Setting.IsDebug && Setting.IsDebugReceive && Setting.IsDebugReceiveHeartBeat) { // Localization: Hotfix.StartUp.DataPackageReceiveHeartBeat - 数据包接收心跳: {0} - LogHelper.Debug(LocalizationService.GetString(Localization.Keys.Hotfix.StartUp.DataPackageReceiveHeartBeat, messagePackage.ToFormatMessageString(actorId))); + LogHelper.Debug(LocalizationService.GetString(Localization.Keys.Hotfix.StartUpModule.DataPackageReceiveHeartBeat, messagePackage.ToFormatMessageString(actorId))); } // 心跳消息回复 @@ -178,14 +178,14 @@ private async ValueTask HandleNetworkMessagePackageAsync(IAppSession session, Ne if (Setting.IsDebug && Setting.IsDebugReceive) { // Localization: Hotfix.StartUp.DataPackageReceive - 数据包接收: {0} - LogHelper.Debug(LocalizationService.GetString(Localization.Keys.Hotfix.StartUp.DataPackageReceive, messagePackage.ToFormatMessageString(actorId))); + LogHelper.Debug(LocalizationService.GetString(Localization.Keys.Hotfix.StartUpModule.DataPackageReceive, messagePackage.ToFormatMessageString(actorId))); } var handler = HotfixManager.GetTcpHandler(messagePackage.Header.MessageId); if (handler == null) { // Localization: Hotfix.StartUp.MessageHandlerNotFound - 数据包接收: 找不到消息处理器, 消息ID: {0}, 消息类型: {1} - LogHelper.Error(LocalizationService.GetString(Localization.Keys.Hotfix.StartUp.MessageHandlerNotFound, messagePackage.Header.MessageId, messagePackage.MessageType)); + LogHelper.Error(LocalizationService.GetString(Localization.Keys.Hotfix.StartUpModule.MessageHandlerNotFound, messagePackage.Header.MessageId, messagePackage.MessageType)); return; } @@ -197,7 +197,7 @@ private async ValueTask HandleNetworkMessagePackageAsync(IAppSession session, Ne catch (Exception exception) { // Localization: Hotfix.StartUp.MessageHandlerInvokeError - 数据包接收: 调用消息处理器出错, 消息ID: {0}, 消息类型: {1}, 异常: {2} - LogHelper.Fatal(LocalizationService.GetString(Localization.Keys.Hotfix.StartUp.MessageHandlerInvokeError, messagePackage.Header.MessageId, messagePackage.MessageType, exception)); + LogHelper.Fatal(LocalizationService.GetString(Localization.Keys.Hotfix.StartUpModule.MessageHandlerInvokeError, messagePackage.Header.MessageId, messagePackage.MessageType, exception)); } } diff --git a/GameFrameX.Localization/Keys.Hotfix.cs b/GameFrameX.Localization/Keys.Hotfix.cs index 44b6f300..06e8810d 100644 --- a/GameFrameX.Localization/Keys.Hotfix.cs +++ b/GameFrameX.Localization/Keys.Hotfix.cs @@ -73,7 +73,7 @@ public static class Hotfix /// /// StartUp 启动流程消息键。 /// - public static class StartUp + public static class StartUpModule { /// /// 客户端断开连接 - 会话ID: {0}, 断开原因: {1}