refactor(battle-node): remove ScriptedBotParticipant and dev-affordance wiring
Deletes the scripted opponent and every entry point that created a BattleType.Scripted session (the ?scripted=1 query opt-in, the SoloDefaultsToScripted toggle, the resolver short-circuit, the WS handler case, the bridge validation arm). Real two-client PvP and the Bot matchmaking-timeout fallback are untouched. ResolveAsync drops its scriptedOptIn parameter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -10,10 +10,7 @@ namespace SVSim.EmulatedEntrypoint.Matching;
|
||||
/// regardless of which URL family carried the request:
|
||||
/// </para>
|
||||
/// <list type="number">
|
||||
/// <item>Honor the dev-affordance scripted opt-in (route flag and/or
|
||||
/// <see cref="BattleNodeOptions.SoloDefaultsToScripted"/>) — bypass pair-up,
|
||||
/// register a Scripted match, return immediately.</item>
|
||||
/// <item>Otherwise consult <see cref="IMatchingPairUpService"/> and translate the
|
||||
/// <item>Consult <see cref="IMatchingPairUpService"/> and translate the
|
||||
/// resulting <see cref="PairUpResult"/> into a wire matching_state per the
|
||||
/// 3002 / 3004 / 3007 / 3011 vocabulary.</item>
|
||||
/// </list>
|
||||
@@ -33,15 +30,9 @@ public interface IMatchingResolver
|
||||
/// <c>"rotation_rank_battle"</c>, <c>"unlimited_rank_battle"</c>).
|
||||
/// </param>
|
||||
/// <param name="player">Caller's <see cref="BattlePlayer"/> (viewer-id + built MatchContext).</param>
|
||||
/// <param name="scriptedOptIn">
|
||||
/// Per-request opt-in from a controller-specific signal (e.g. TK2's <c>?scripted=1</c>
|
||||
/// query param). OR'd with <see cref="BattleNodeOptions.SoloDefaultsToScripted"/>;
|
||||
/// either being true short-circuits to a Scripted match.
|
||||
/// </param>
|
||||
Task<MatchingResolution> ResolveAsync(
|
||||
string mode,
|
||||
BattlePlayer player,
|
||||
bool scriptedOptIn,
|
||||
CancellationToken ct);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using SVSim.BattleNode.Bridge;
|
||||
using SVSim.BattleNode.Sessions;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Matching;
|
||||
|
||||
@@ -8,7 +7,6 @@ public sealed class MatchingResolver : IMatchingResolver
|
||||
{
|
||||
private readonly IMatchingBridge _bridge;
|
||||
private readonly IMatchingPairUpService _pairUp;
|
||||
private readonly BattleNodeOptions _options;
|
||||
|
||||
public MatchingResolver(
|
||||
IMatchingBridge bridge,
|
||||
@@ -17,25 +15,13 @@ public sealed class MatchingResolver : IMatchingResolver
|
||||
{
|
||||
_bridge = bridge;
|
||||
_pairUp = pairUp;
|
||||
_options = options;
|
||||
}
|
||||
|
||||
public Task<MatchingResolution> ResolveAsync(
|
||||
string mode,
|
||||
BattlePlayer player,
|
||||
bool scriptedOptIn,
|
||||
CancellationToken ct)
|
||||
{
|
||||
// Dev-affordance short-circuit. Either a per-request flag (e.g. ?scripted=1) or the
|
||||
// process-wide BattleNodeOptions.SoloDefaultsToScripted toggle puts us here.
|
||||
// Registers a Scripted match (server-side scripted opponent in BattleSession) and
|
||||
// returns matching_state=3004 SUCCEEDED so the client opens the WS and proceeds.
|
||||
if (scriptedOptIn || _options.SoloDefaultsToScripted)
|
||||
{
|
||||
var m = _bridge.RegisterBattle(player, p2: null, BattleType.Scripted);
|
||||
return Task.FromResult(new MatchingResolution(3004, m.BattleId, m.NodeServerUrl));
|
||||
}
|
||||
|
||||
return ResolveViaPairUpAsync(mode, player, ct);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user