feat: Upgrade server with HyNB v2.4 modular architecture, minigames, admin GM web panel, companion summons, and car radio

This commit is contained in:
CAtlas0784 committed 2026-10-29 02:44:24 +07:00
1 parent 74e2963a12
commit 3e5adf1dc5
1571 files changed
+336468 -6348

No files matched your search

+3 -1
View File
@@ -13,7 +13,9 @@ public sealed class Connection
private readonly TcpSession _session;
private readonly CancellationToken _token;
internal Connection(TcpSession session, CancellationToken token)
// 2026-09-23: 放宽为 public —— 旧式 TcpSession handler(如 GameRouter.Wanted.cs)拿不到
// attributed-handler 框架注入的 Connection,需要自己从 session 包一个出来。
public Connection(TcpSession session, CancellationToken token)
{
_session = session;
_token = token;
+6 -19
View File
@@ -65,13 +65,10 @@ public sealed class RpcRouter
{
packet = RpcPacketReader.Parse(frame.Payload);
}
catch (Exception ex)
catch
{
// A malformed RPC body must never kill the socket: log it and keep the session
// alive (the client just sees a dropped packet, not a Reconnecting loop).
RuntimeLogs.RawFrame(session.Log.Scope, "C2S", frame.Mode, frame.Payload, "RPC_PARSE_FAILED");
session.Log.Error($"rpc parse failed size={frame.Payload.Length} — session kept", ex);
return;
throw;
}
var ctx = new RpcContext(session, packet, token);
@@ -129,20 +126,10 @@ public sealed class RpcRouter
session.Log.Error($"handler failed method={Display(packet.MethodId)}", ex);
if (packet.Kind == RpcPacketKind.Invoke)
{
// The fallback reply must itself never throw — a failing fallback used to
// escape DispatchAsync and tear the session down (client: Reconnecting).
try
{
if (_unknownInvokeHandler is not null)
await _unknownInvokeHandler(ctx);
else
await ctx.ReturnEmptyOkAsync();
}
catch (Exception fallbackEx)
when (fallbackEx is not OperationCanceledException)
{
session.Log.Error($"fallback reply failed method={Display(packet.MethodId)}", fallbackEx);
}
if (_unknownInvokeHandler is not null)
await _unknownInvokeHandler(ctx);
else
await ctx.ReturnEmptyOkAsync();
}
}
}