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:
@@ -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