Revert "fix:"

This reverts commit 7e775e90e1.
This commit is contained in:
xcy 2023-12-18 20:05:26 +08:00
parent 28e4aca1f2
commit e57fad35d8
3 changed files with 23 additions and 42 deletions

View File

@ -4,12 +4,10 @@ import {XstaskFun} from '../../public/xstask';
import { ReqAllGet, ResAllGet } from "../../shared/protocols/xstask/PtlAllGet"; import { ReqAllGet, ResAllGet } from "../../shared/protocols/xstask/PtlAllGet";
import { HongDianChange } from "../hongdian/fun"; import { HongDianChange } from "../hongdian/fun";
import { PublicShared } from "../../shared/public/public"; import { PublicShared } from "../../shared/public/public";
import {TeQuanFun} from "../../public/tequan";
export default async function (call: ApiCall<ReqAllGet, ResAllGet>) { export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
const taskList = JSON.parse(JSON.stringify(await XstaskFun.getAllTask(call.uid))); const taskList = JSON.parse(JSON.stringify(await XstaskFun.getAllTask(call.uid)));
let taskInfo = await XstaskFun.getInfo(call.uid); let taskInfo = await XstaskFun.getInfo(call.uid);
let tequan = await TeQuanFun.getXsTaskNum(call);
let prizeArr:atn[] = [] let prizeArr:atn[] = []
for(let task of taskList) { for(let task of taskList) {
const taskConf = G.gc.xstask[task?.taskId]; const taskConf = G.gc.xstask[task?.taskId];
@ -40,14 +38,6 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
XstaskFun.changeInfo(call.uid, change); XstaskFun.changeInfo(call.uid, change);
await PlayerFun.sendPrize(call, taskConf.prize); await PlayerFun.sendPrize(call, taskConf.prize);
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']); HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
if (!tequan) {
prizeArr.push(...taskConf.prize)
} else {
for (let i = 0; i < 3; i++) {
prizeArr.push(...taskConf.prize)
}
}
prizeArr.push(...taskConf.prize) prizeArr.push(...taskConf.prize)
} }
call.succ({ call.succ({

View File

@ -4,7 +4,6 @@ import {XstaskFun} from '../../public/xstask';
import { ReqGet, ResGet } from "../../shared/protocols/xstask/PtlGet"; import { ReqGet, ResGet } from "../../shared/protocols/xstask/PtlGet";
import { HongDianChange } from "../hongdian/fun"; import { HongDianChange } from "../hongdian/fun";
import { PublicShared } from '../../shared/public/public'; import { PublicShared } from '../../shared/public/public';
import {TeQuanFun} from "../../public/tequan";
export default async function (call: ApiCall<ReqGet, ResGet>) { export default async function (call: ApiCall<ReqGet, ResGet>) {
@ -36,20 +35,12 @@ export default async function (call: ApiCall<ReqGet, ResGet>) {
XstaskFun.finishTask(call.uid, call.req._id) XstaskFun.finishTask(call.uid, call.req._id)
} }
// XstaskFun.delTask(call.uid, call.req._id); // XstaskFun.delTask(call.uid, call.req._id);
let send_prize = [];
XstaskFun.changeInfo(call.uid, change); XstaskFun.changeInfo(call.uid, change);
if (!await TeQuanFun.getXsTaskNum(call)) { await PlayerFun.sendPrize(call, taskConf.prize);
send_prize = taskConf.prize;
} else {
for (let i = 0; i < 3; i++) {
send_prize = send_prize.concat(taskConf.prize)
}
}
await PlayerFun.sendPrize(call, send_prize);
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']); HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
call.succ({ call.succ({
taskList: await XstaskFun.getAllTask(call.uid), taskList: await XstaskFun.getAllTask(call.uid),
prize: send_prize prize: taskConf.prize
}); });
} }

View File

@ -36,7 +36,7 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
XstaskFun.delTasks(call.uid, delTask.map(task => task._id)); XstaskFun.delTasks(call.uid, delTask.map(task => task._id));
} }
// needAddTask += await TeQuanFun.getXsTaskNum(call); needAddTask += await TeQuanFun.getXsTaskNum(call);
needAddTask && await XstaskFun.addTasks(call.uid, XstaskFun.randomTasks(taskInfo?.lv || changeInfo.lv, needAddTask)); needAddTask && await XstaskFun.addTasks(call.uid, XstaskFun.randomTasks(taskInfo?.lv || changeInfo.lv, needAddTask));
let { _id, uid, type, ...info } = taskInfo || changeInfo as typeof taskInfo; let { _id, uid, type, ...info } = taskInfo || changeInfo as typeof taskInfo;