任务:埋点30/70
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user