feat(battle-node): add RealParticipant.Phase for per-side handshake state

Internal setter; defaults to AwaitingInitNetwork. PvP needs A and B to
progress through the handshake states independently, which the
session-level BattleSession.Phase can't model. Session migration to read
realFrom.Phase is the next task.
This commit is contained in:
gamer147
2026-06-01 21:25:11 -04:00
parent b75eb512ea
commit ac78473a3e
2 changed files with 44 additions and 0 deletions

View File

@@ -28,6 +28,13 @@ public sealed class RealParticipant : IBattleParticipant
public InboundTracker Inbound { get; } = new();
public OutboundSequencer Outbound { get; } = new();
/// <summary>Per-side handshake progression. Session reads this when gating
/// handshake-phase synthesis (Matched / BattleStart / Deal / Swap response /
/// Ready). Session transitions via the setter after dispatch. Defaults to
/// AwaitingInitNetwork; only RealParticipant tracks this — bots have no phase
/// because they never send the gating URIs.</summary>
internal BattleSessionPhase Phase { get; set; } = BattleSessionPhase.AwaitingInitNetwork;
public event Func<MsgEnvelope, CancellationToken, Task>? FrameEmitted;
public RealParticipant(WebSocket ws, long viewerId, MatchContext context,