Merge branch 'bugfix' into release

This commit is contained in:
xichaoyin 2024-01-08 18:20:03 +08:00
commit 5d3508aa40

View File

@ -4,6 +4,7 @@ import {taskType} from "../shared/protocols/task/type";
import { PublicShared } from "../shared/public/public"; import { PublicShared } from "../shared/public/public";
import { PeijianFun } from "./peijian"; import { PeijianFun } from "./peijian";
import { manager } from "./taskclass"; import { manager } from "./taskclass";
import ApiRecTask from "../api_s2c/event/zhanling/ApiRecTask";
let taskDict = {}; let taskDict = {};
const SHUJUKU = "task"; const SHUJUKU = "task";
@ -260,6 +261,28 @@ export class TaskFun {
delete _w["finish"]; delete _w["finish"];
} }
let _tmp = await this.getUserTaksList(call.uid, _w); let _tmp = await this.getUserTaksList(call.uid, _w);
// 没有未完成任务
// 检测是否有新加任务
if (_tmp.length == 0) {
let rectask = (await G.mongodb.collection('task').find(
{ uid: call.uid, type: _type }, { projection: { taskid: 1, _id: 0 } }
).toArray()).map(e => e.taskid);
for (let taskid of rectask) {
let conf = G.gc.task[_type][taskid];
// 配置不存在
// 没有后续任务
// 后续任务已完成
if (!conf || !conf.followtask || rectask.includes(conf.followtask)) {
continue
}
// 生成后续任务
await this.setTaskInfo(call, conf.followtask, { type: _type });
break;
}
_tmp = await this.getUserTaksList(call.uid, _w);
}
_r[_type] = _tmp; _r[_type] = _tmp;
} }
return _r; return _r;