From 518c04fdb49857f19b15e8411d0f345241d6d3db Mon Sep 17 00:00:00 2001 From: Kei-Luna Date: Wed, 27 May 2026 07:12:31 +0900 Subject: [PATCH] Fixed an issue where clicking on a feature not yet implemented on the server side would cause an infinite loading loop. --- GameServer/Server/CallGS/CallGSRouter.cs | 10 ++++++++++ version.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/GameServer/Server/CallGS/CallGSRouter.cs b/GameServer/Server/CallGS/CallGSRouter.cs index 6ea0281..e3cadb3 100644 --- a/GameServer/Server/CallGS/CallGSRouter.cs +++ b/GameServer/Server/CallGS/CallGSRouter.cs @@ -8,6 +8,7 @@ public static class CallGSRouter { private static readonly Logger Logger = new("CallGS"); private static readonly Dictionary Handlers = []; + private const string UnavailableTipKey = "ui.TxtNotOpen"; public static void Init() { @@ -32,11 +33,13 @@ public static class CallGSRouter catch (Exception e) { Logger.Error($"[{req.Api}] {e.Message}", e); + await SendUnavailableResponse(connection, req.Api); } return; } Logger.Error($"No handler for CallGS API: {req.Api}"); + await SendUnavailableResponse(connection, req.Api); } public static async Task SendScript(Connection connection, string api, string arg, NtfSyncPlayer extra = null!) @@ -44,4 +47,11 @@ public static class CallGSRouter var rsp = new NtfCallScript { Api = api, Arg = arg, ExtraSync = extra }; await connection.SendPacket(CmdIds.NtfScript, rsp); } + + private static Task SendUnavailableResponse(Connection connection, string api) + { + // Many client Lua handlers treat sErr/sError as a recoverable failure path, + // which is preferable to leaving the request hanging forever. + return SendScript(connection, api, $$"""{"sErr":"{{UnavailableTipKey}}","sError":"{{UnavailableTipKey}}"}"""); + } } diff --git a/version.txt b/version.txt index b1f6473..28b8e5b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v=4.4 \ No newline at end of file +v=4.5 \ No newline at end of file