feat(battle-node): EchoHandler consumes Echo instead of relaying

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-03 18:03:19 -04:00
parent 506d286529
commit 6b580c622d
3 changed files with 11 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ public sealed class BattleSession
[NetworkBattleUri.TurnStart] = new TurnStartHandler(),
[NetworkBattleUri.Judge] = new JudgeHandler(),
[NetworkBattleUri.PlayActions] = new PlayActionsHandler(),
[NetworkBattleUri.Echo] = forwardWhenReady,
[NetworkBattleUri.Echo] = new EchoHandler(),
[NetworkBattleUri.TurnEndActions] = forwardWhenReady,
[NetworkBattleUri.JudgeResult] = forwardWhenReady,
};

View File

@@ -0,0 +1,8 @@
namespace SVSim.BattleNode.Sessions.Dispatch.Handlers;
/// <summary>Echo is the receiver's per-frame ack; the client has no inbound Echo handler, so the
/// node consumes it (bullet-2 audit). Relaying would risk an echo->echo storm.</summary>
internal sealed class EchoHandler : IFrameHandler
{
public IReadOnlyList<DispatchRoute> Handle(FrameDispatchContext ctx) => Array.Empty<DispatchRoute>();
}