pvp:添加PVP任务
This commit is contained in:
@@ -246,6 +246,22 @@ export async function getAchievement(roleId: string, userTask: UserTaskType) {
|
||||
return { point, taskList, box }
|
||||
}
|
||||
|
||||
export async function getPvpTask(roleId: string) {
|
||||
let type = TASK_FUN_TYPE.PVP;
|
||||
let recMap = await UserTaskRecModel.findByRoleAndType(roleId, type); // group=>userTaskRec
|
||||
|
||||
let taskList: TaskListReturn[] = [];
|
||||
for (let [id, dic] of gameData.pvpDailyTask) {
|
||||
let dbRec = recMap.get(dic.taskType)?.get(dic.group);
|
||||
if (dbRec) {
|
||||
taskList.push({ type, id, count: dbRec.count, received: dbRec.received.includes(id) });
|
||||
} else {
|
||||
taskList.push({ type, id, count: 0, received: false });
|
||||
}
|
||||
}
|
||||
return { taskList }
|
||||
}
|
||||
|
||||
// 刷新每日任务
|
||||
export async function refDailyTask(roleId: string, sid: string) {
|
||||
let userTask = await UserTaskModel.findByRole(roleId);
|
||||
|
||||
Reference in New Issue
Block a user