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:
@@ -32,7 +32,10 @@ public class BattleNodeFlowTests
|
||||
|
||||
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(15));
|
||||
var ct = cts.Token;
|
||||
var pending = bridge.RegisterPendingBattle(viewerId: 906243102, context: FixtureCtx());
|
||||
var pending = bridge.RegisterBattle(
|
||||
new SVSim.BattleNode.Bridge.BattlePlayer(906243102, FixtureCtx()),
|
||||
p2: null,
|
||||
SVSim.BattleNode.Sessions.BattleType.Scripted);
|
||||
|
||||
var key = MakeKey();
|
||||
var encryptedVid = NodeCrypto.EncryptForNode("906243102", key);
|
||||
@@ -132,7 +135,10 @@ public class BattleNodeFlowTests
|
||||
|
||||
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(15));
|
||||
var ct = cts.Token;
|
||||
var pending = bridge.RegisterPendingBattle(viewerId: vid, context: ctx);
|
||||
var pending = bridge.RegisterBattle(
|
||||
new SVSim.BattleNode.Bridge.BattlePlayer(vid, ctx),
|
||||
p2: null,
|
||||
SVSim.BattleNode.Sessions.BattleType.Scripted);
|
||||
|
||||
var key = MakeKey();
|
||||
var encryptedVid = NodeCrypto.EncryptForNode(vid.ToString(), key);
|
||||
|
||||
Reference in New Issue
Block a user