diff --git a/SVSim.BattleNode/Sessions/BattleSession.cs b/SVSim.BattleNode/Sessions/BattleSession.cs index a96f6a4..374714e 100644 --- a/SVSim.BattleNode/Sessions/BattleSession.cs +++ b/SVSim.BattleNode/Sessions/BattleSession.cs @@ -45,6 +45,7 @@ public sealed class BattleSession [NetworkBattleUri.Retire] = new RetireKillHandler(), [NetworkBattleUri.Kill] = new RetireKillHandler(), [NetworkBattleUri.TurnStart] = new TurnStartHandler(), + [NetworkBattleUri.Judge] = new JudgeHandler(), }; private FrameDispatchContext BuildContext(IBattleParticipant from, MsgEnvelope env) => diff --git a/SVSim.BattleNode/Sessions/Dispatch/Handlers/JudgeHandler.cs b/SVSim.BattleNode/Sessions/Dispatch/Handlers/JudgeHandler.cs new file mode 100644 index 0000000..4ba8146 --- /dev/null +++ b/SVSim.BattleNode/Sessions/Dispatch/Handlers/JudgeHandler.cs @@ -0,0 +1,14 @@ +using SVSim.BattleNode.Protocol; + +namespace SVSim.BattleNode.Sessions.Dispatch.Handlers; + +internal sealed class JudgeHandler : IFrameHandler +{ + public IReadOnlyList Handle(FrameDispatchContext ctx) + { + // Only a scripted-bot Judge is forwarded. A real player's Judge has no routing rule (drops). + if (ctx.IsScriptedBot(ctx.From)) + return new[] { new DispatchRoute(ctx.Other, ctx.Env, false) }; + return Array.Empty(); + } +}