任务:埋点30/70

This commit is contained in:
luying
2021-04-19 13:17:17 +08:00
parent bc07e1ea31
commit 9f4f346447
38 changed files with 1088 additions and 692 deletions
@@ -4,10 +4,11 @@ import Role, { RoleModel } from '../db/Role'
import { getLvByExp, getExpByLv, gameData } from '../pubUtils/data';
import { updateUserInfo } from './redisService';
import { switchOnFunc } from './funcSwitchService';
import { FUNC_OPT_TYPE } from '../consts';
import { FUNC_OPT_TYPE, TASK_TYPE } from '../consts';
import { BackendSession } from 'pinus';
import { REDIS_KEY } from '../consts';
import { Rank } from './rankService';
import { checkTask } from './taskService';
export async function roleLevelup(roleId: string, kingExp: number, session: BackendSession) {
let role = await RoleModel.findByRoleId(roleId);
@@ -29,6 +30,9 @@ export async function roleLevelup(roleId: string, kingExp: number, session: Back
let r = new Rank(REDIS_KEY.USER_LV, { serverId: role.serverId });
await r.setRankWithRoleInfo(roleId, newLv, Date.now(), role);
// 任务
await checkTask(roleId, session.get('sid'), TASK_TYPE.ROLE_LV, newLv, false, {});
}
let actordata = [];
for(let i = lv; i <= newLv; i++) {