任务:埋点30/70

This commit is contained in:
luying
2021-04-18 11:21:04 +08:00
parent bc07e1ea31
commit 9f4f346447
38 changed files with 1088 additions and 692 deletions

View File

@@ -7,7 +7,7 @@ import { Application } from 'pinus';
import {FrontendSession} from 'pinus';
import { HeroModel } from './../../../db/Hero';
import { resResult } from '../../../pubUtils/util';
import { COM_BTL_QUALITY, ROLE_SELECT, HERO_SELECT, GUILD_SELECT, USER_GUILD_SELECT, DEBUG_MAGIC_WORD, REDIS_KEY } from '../../../consts';
import { COM_BTL_QUALITY, ROLE_SELECT, HERO_SELECT, GUILD_SELECT, USER_GUILD_SELECT, DEBUG_MAGIC_WORD, REDIS_KEY, TASK_TYPE } from '../../../consts';
import { getAp } from '../../../services/actionPointService';
import { ItemModel } from '../../../db/Item';
import { chackFunOpenWhenLogin } from '../../../services/funcSwitchService';
@@ -22,6 +22,7 @@ import { getMails } from '../../../services/mailService';
import { addRoleToGuildChannel, addRoleToSysChannel, addRoleToWorldChannel, leaveGuildChannel, leaveSysChannel, leaveWorldChannel, recentGuildMsgs, recentPrivateChatInfos, recentSysMsgs, recentWorldMsgs } from '../../../services/chatService';
import { reportOneOnline } from '../../../services/timeTaskService';
import { Rank } from '../../../services/rankService';
import { checkTaskWithRole } from '../../../services/taskService';
export default function (app: Application) {
return new EntryHandler(app);
}
@@ -46,7 +47,7 @@ export class EntryHandler {
return resResult(STATUS.TOKEN_ERR);
}
let role = await RoleModel.findByUid(user.uid, serverId, ROLE_SELECT.ENTRY, true);
let role = await RoleModel.findByUidAndSetTime(user.uid, serverId, ROLE_SELECT.ENTRY, true);
if (!role) {
return resResult(STATUS.ROLE_NOT_FOUND);
}
@@ -110,6 +111,10 @@ export class EntryHandler {
let r2 = new Rank(REDIS_KEY.SUM_CE_RANK, { serverId });
r2.setRankWithRoleInfo(role.roleId, role.lv, role.updatedAt.getTime(), role);
// 任务
checkTaskWithRole(role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SUM, role);
checkTaskWithRole(role.roleId, self.app.get('serverId'), TASK_TYPE.LOGIN_SERIES, role);
role['heros'] = heros;
role['equips'] = equips;
role['consumeGoods'] = items;