refactor(battle-node): unify IMatchingBridge.RegisterBattle signature
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).
This commit is contained in:
@@ -3,8 +3,8 @@ using SVSim.BattleNode.Bridge;
|
||||
namespace SVSim.BattleNode.Sessions;
|
||||
|
||||
/// <summary>
|
||||
/// Sparse pre-connect record: viewer id + the per-battle MatchContext snapshot. Enough to
|
||||
/// validate the incoming WS connect, resolve the viewer, and seed the BattleSession with the
|
||||
/// player-half lifecycle data. Full BattleSession is created on connect.
|
||||
/// 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, long ViewerId, MatchContext Context);
|
||||
public sealed record PendingBattle(string BattleId, BattleType Type, BattlePlayer P1, BattlePlayer? P2);
|
||||
|
||||
Reference in New Issue
Block a user