Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/model/ApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ export class ApiClient {
return this.request('POST', '/api/expedition/check');
}

async expeditionAutoCheck(allowRepair = true): Promise<ApiResponse> {
return this.request('POST', '/api/expedition/auto_check', { allow_repair: allowRepair });
}

// ── 游戏状态查询 ──

async gameContext(): Promise<ApiResponse<GameContextData>> {
Expand Down
12 changes: 7 additions & 5 deletions src/model/scheduler/Scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,16 @@ export class Scheduler {

Logger.debug(`consumeNext: 「${task.name}」 type=${task.type} remaining=${task.remainingTimes}/${task.totalTimes} req=${JSON.stringify(task.request)}`, 'scheduler');

// 远征任务: 直接调用远征 API,不走 taskStart 流程
// 远征任务: 调用挂机专用自动检查端点,不走 taskStart 流程
// 若队列里还有后续任务,则禁止自动维修,避免任务间隙占用舰队
if (task.type === 'expedition') {
const allowRepair = this._taskQueue.length === 0;
try {
this.emitLog('info', '正在检查远征...');
await this.api.expeditionCheck();
this.emitLog('info', '远征检查完成');
this.emitLog('info', '正在执行自动远征检查...');
await this.api.expeditionAutoCheck(allowRepair);
this.emitLog('info', '自动远征检查完成');
} catch {
this.emitLog('debug', '远征检查跳过');
this.emitLog('debug', '自动远征检查跳过');
}
this.currentTask = null;
this.consumeNext();
Expand Down