diff --git a/SVSim.BattleNode/Sessions/BattleSession.cs b/SVSim.BattleNode/Sessions/BattleSession.cs index d503b23..a96f6a4 100644 --- a/SVSim.BattleNode/Sessions/BattleSession.cs +++ b/SVSim.BattleNode/Sessions/BattleSession.cs @@ -44,6 +44,7 @@ public sealed class BattleSession [NetworkBattleUri.TurnEndFinal] = new TurnEndFinalHandler(), [NetworkBattleUri.Retire] = new RetireKillHandler(), [NetworkBattleUri.Kill] = new RetireKillHandler(), + [NetworkBattleUri.TurnStart] = new TurnStartHandler(), }; private FrameDispatchContext BuildContext(IBattleParticipant from, MsgEnvelope env) => diff --git a/SVSim.BattleNode/Sessions/Dispatch/Handlers/TurnStartHandler.cs b/SVSim.BattleNode/Sessions/Dispatch/Handlers/TurnStartHandler.cs new file mode 100644 index 0000000..ff7e102 --- /dev/null +++ b/SVSim.BattleNode/Sessions/Dispatch/Handlers/TurnStartHandler.cs @@ -0,0 +1,15 @@ +using SVSim.BattleNode.Protocol; + +namespace SVSim.BattleNode.Sessions.Dispatch.Handlers; + +internal sealed class TurnStartHandler : IFrameHandler +{ + public IReadOnlyList Handle(FrameDispatchContext ctx) + { + // Forward the opponent's turn-open to the other side. Union of the two legacy arms: + // BothAfterReady (PvP / scripted real player) OR a scripted-bot emission (test stub path). + if (ctx.BothAfterReady() || ctx.IsScriptedBot(ctx.From)) + return new[] { new DispatchRoute(ctx.Other, ctx.Env, false) }; + return Array.Empty(); + } +}