任务:添加debug接口
This commit is contained in:
@@ -128,8 +128,8 @@ export async function getCurTask(roleId: string, session: FrontendOrBackendSessi
|
||||
|
||||
if(shouldRefresh(dailyTaskRef, new Date(), 5)) {
|
||||
dailyTaskRef = new Date();
|
||||
userTask = await UserTaskModel.setRefDaily(roleId);
|
||||
await removeHistoryTask(roleId);
|
||||
userTask = await UserTaskModel.updateInfo(roleId, { dailyTaskRef });
|
||||
await removeHistoryTask(roleId, TASK_FUN_TYPE.DAILY);
|
||||
}
|
||||
session.set('refDaily', getSeconds(dailyTaskRef));
|
||||
session.push('refDaily', ()=> {});
|
||||
@@ -205,17 +205,17 @@ export async function refDailyTask(roleId: string, sid: string) {
|
||||
let taskList = await getDailyTask(roleId, userTask);
|
||||
|
||||
// 转移每日任务
|
||||
await removeHistoryTask(roleId);
|
||||
await removeHistoryTask(roleId, TASK_FUN_TYPE.DAILY);
|
||||
|
||||
let uids = [{uid: roleId, sid}];
|
||||
pinus.app.get('channelService').pushMessageByUids('onDailyTaskRefresh', resResult(STATUS.SUCCESS, { taskList }), uids);
|
||||
|
||||
}
|
||||
|
||||
export async function removeHistoryTask(roleId: string, today?: Date) {
|
||||
export async function removeHistoryTask(roleId: string, type: number, today?: Date) {
|
||||
|
||||
// 转移每日任务
|
||||
let history = await UserTaskRecModel.getHistoryRec(roleId, today);
|
||||
let history = await UserTaskRecModel.getHistoryRec(roleId, type, today);
|
||||
if(history.length > 0) {
|
||||
await UserTaskHistoryModel.pushUserTask(roleId, history);
|
||||
await UserTaskRecModel.deleteHistory(history);
|
||||
@@ -223,8 +223,8 @@ export async function removeHistoryTask(roleId: string, today?: Date) {
|
||||
}
|
||||
|
||||
// 刷新每日宝箱数量
|
||||
export async function refDailyTaskBox(roleId: string, sid: string) {
|
||||
let userTask = await UserTaskModel.refreshWeekly(roleId);
|
||||
export async function refDailyTaskBox(roleId: string, sid: string, debug = false) {
|
||||
let userTask = await UserTaskModel.refreshWeekly(roleId, debug);
|
||||
if(userTask) {
|
||||
let { dailyTaskPoint: point, dailyTaskPointWeekly: weeklyPoint, dailyTaskBox: box } = userTask;
|
||||
let uids = [{uid: roleId, sid}];
|
||||
|
||||
Reference in New Issue
Block a user