feat(battle-node): WaitingRoom for PvP WS rendezvous

Per-BattleId slot keyed dict. Pair returns the first arriver to the
second; ParkAsync awaits a TCS and returns the second arriver. Timeout
defaults to BattleNodeOptions.WaitingRoomTimeout (60s); evict on timeout
keeps the dict clean. Singleton in DI; consumed by the handler in the
next task.
This commit is contained in:
gamer147
2026-06-01 21:55:11 -04:00
parent db054205b3
commit 2789dc08cb
5 changed files with 171 additions and 0 deletions

View File

@@ -8,4 +8,11 @@ namespace SVSim.BattleNode.Bridge;
public sealed class BattleNodeOptions
{
public string NodeServerUrl { get; set; } = "localhost:5148/socket.io/";
/// <summary>
/// How long the first arriver's WS waits for a partner before disconnecting.
/// Matches the architecture spec's 60s default; override (typically lower)
/// in tests via the factory.
/// </summary>
public TimeSpan WaitingRoomTimeout { get; set; } = TimeSpan.FromSeconds(60);
}