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:
@@ -27,20 +27,13 @@ public class ArenaTwoPickBattleController : SVSimController
|
||||
[HttpPost("do_matching")]
|
||||
public async Task<IActionResult> DoMatching(
|
||||
[FromBody] DoMatchingRequest req,
|
||||
[FromQuery(Name = "scripted")] string? scripted = null,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
if (!TryGetViewerId(out var vid)) return Unauthorized();
|
||||
// Accept "1" or "true" (case-insensitive) as per-request opt-in for the Scripted
|
||||
// path. ASP.NET's default bool binder rejects "1", so parse permissively here.
|
||||
// BattleNodeOptions.SoloDefaultsToScripted is the process-wide equivalent and is
|
||||
// applied inside the resolver.
|
||||
var scriptedOptIn = scripted is not null
|
||||
&& (scripted == "1" || string.Equals(scripted, "true", StringComparison.OrdinalIgnoreCase));
|
||||
try
|
||||
{
|
||||
var ctx = await _matchContextBuilder.BuildForTwoPickAsync(vid);
|
||||
var r = await _resolver.ResolveAsync("arena_two_pick_battle", new BattlePlayer(vid, ctx), scriptedOptIn, ct);
|
||||
var r = await _resolver.ResolveAsync("arena_two_pick_battle", new BattlePlayer(vid, ctx), ct);
|
||||
return Ok(new DoMatchingResponseDto
|
||||
{
|
||||
MatchingState = r.MatchingState,
|
||||
|
||||
@@ -132,10 +132,7 @@ public sealed class RankBattleController : ControllerBase
|
||||
return Ok(new DoMatchingResponseDto { MatchingState = 3001, NodeServerUrl = "" });
|
||||
}
|
||||
|
||||
// Rank battle has no ?scripted=1 query opt-in (no live capture has shown such a
|
||||
// param on the rank URLs). The process-wide BattleNodeOptions.SoloDefaultsToScripted
|
||||
// toggle is the only scripted entry point and is honored inside the resolver.
|
||||
var r = await _resolver.ResolveAsync(mode, new BattlePlayer(vid, ctx), scriptedOptIn: false, ct);
|
||||
var r = await _resolver.ResolveAsync(mode, new BattlePlayer(vid, ctx), ct);
|
||||
|
||||
return Ok(new DoMatchingResponseDto
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user