feedback7: watch-bonds' "after the own battle" test gets a real window — the guest's enemies spawn at twice their times (new fastServer hook SP_SLOW_SPAWNS, startRealServer fast.slowSpawns), the host fields its 萨尔贡 five without 菲莱 (the planner puts a zero-range guard on the road since PR #339 and she held the host's battle to 109 s of 110), and 返回战场 tolerates the battles ending; measured: at the scheduled times a leaker's walk outlasted the host by 5–11 s in 0.2.1 and 0.2.2 alike (the 0.2.2 full pass lost 返回战场 to 联防)

This commit is contained in:
sganggs committed 2026-10-09 00:52:08 +08:00
1 parent e5e3f05bb2
commit 9bacd9ad45
3 files changed
+40 -9

No files matched your search

+4 -2
View File
@@ -61,10 +61,11 @@ export function freePort() {
* `port`: e.g. the port of a server just stopped — a server restart the open clients reconnect to).
* @param {{ port?: number, fast?: { timerScale?: number, combatSpeed?: number, startRound?: 'boss'|'hidden'|number, kit?: number, chess?: string[],
* items?: string[], idleBots?: boolean, kits?: string[][], botChess?: string[], autoPlace?: boolean, eliminate?: number[], stage?: string,
* finishAfter?: number } }} [opts]
* finishAfter?: number, slowSpawns?: string } }} [opts]
* kits: per-human starter kits (seat order); botChess: the AI seats' kit; autoPlace: the kits go onto the board at the
* first prep; eliminate: humans (seat order) eliminated at the jump; stage: the stage of every match; finishAfter: the
* match ends (RESULT) once that round has settled — fastServer.mjs hooks
* match ends (RESULT) once that round has settled; slowSpawns: '<humanIdx>:<factor>' — that human's normal battles
* spawn at factor × the scheduled times — fastServer.mjs hooks
* @returns {Promise<{ base: string, port: number, logs: string[], stop: (o?: { hard?: boolean }) => Promise<void> }>}
*/
export async function startRealServer(opts = {}) {
@@ -90,6 +91,7 @@ export async function startRealServer(opts = {}) {
if (opts.fast.stage) env.SP_STAGE = String(opts.fast.stage);
if (opts.fast.level) env.SP_START_LEVEL = String(opts.fast.level);
if (opts.fast.finishAfter) env.SP_FINISH_AFTER = String(opts.fast.finishAfter);
if (opts.fast.slowSpawns) env.SP_SLOW_SPAWNS = String(opts.fast.slowSpawns);
}
const child = spawn(process.execPath, [entry], { cwd: ROOT, env, stdio: ['ignore', 'pipe', 'pipe'] });
const logs = [];