refactor(matching): extend PairUpResult with IsAiFallback flag

Pure shape change ahead of Phase 3 AI-fallback wiring — all current
callers pass IsAiFallback: false. TK2 will always emit false (PvpOnly
policy); rank-battle's PvpFirstThenAiFallback branch sets true after
the threshold elapses.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-02 00:57:25 -04:00
parent d7bb44973a
commit 3866c93065
2 changed files with 9 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ public sealed class InProcessPairUp : IMatchingPairUpService
if (slot.Resolved.TryGetValue(player.ViewerId, out var cached))
{
slot.Resolved.Remove(player.ViewerId);
return Task.FromResult<PairUpResult?>(new PairUpResult(cached, IsOwner: true));
return Task.FromResult<PairUpResult?>(new PairUpResult(cached, IsOwner: true, IsAiFallback: false));
}
// 2. Someone already waiting in this slot? Pair with them.
@@ -46,7 +46,7 @@ public sealed class InProcessPairUp : IMatchingPairUpService
var match = _bridge.RegisterBattle(p1, p2, BattleType.Pvp);
// Cache the result for the FIRST arriver's next poll (consume-on-read).
slot.Resolved[p1.ViewerId] = match;
return Task.FromResult<PairUpResult?>(new PairUpResult(match, IsOwner: false));
return Task.FromResult<PairUpResult?>(new PairUpResult(match, IsOwner: false, IsAiFallback: false));
}
// 3. Empty slot — park this caller.