Single RegisterBattle(p1, p2?, type) with contract validation throws on invalid combinations (Pvp requires both; Bot requires p2==null; Scripted accepts either). PendingBattle carries Type + P1 + nullable P2. Handler + controller adapt; v1.2 behaviour preserved because Scripted is the only type used today (Phase 2 adds Pvp, Phase 3 adds Bot).
11 lines
399 B
C#
11 lines
399 B
C#
using SVSim.BattleNode.Bridge;
|
|
|
|
namespace SVSim.BattleNode.Sessions;
|
|
|
|
/// <summary>
|
|
/// Sparse pre-connect record. Carries the battle type + one or two players. The
|
|
/// WebSocket handler reads this to validate the incoming WS connect and to
|
|
/// construct the right participants.
|
|
/// </summary>
|
|
public sealed record PendingBattle(string BattleId, BattleType Type, BattlePlayer P1, BattlePlayer? P2);
|