炼器堂,练兵场,事件开启,redlock注释

This commit is contained in:
mamengke01
2021-02-24 15:13:46 +08:00
parent dd995e67eb
commit 0e933d1ec4
14 changed files with 157 additions and 85 deletions

View File

@@ -1,10 +1,9 @@
import { BackendSession, FrontendSession, pinus } from "pinus";
import { getGamedata } from "../pubUtils/gamedata";
import { RoleModel } from "../db/Role";
import { resResult } from "../pubUtils/util";
import { STATUS, FUNC_OPT_TYPE } from "../consts";
import { eventOnPlayerLvUp } from '../services/playerEventService';
import { checkesetTrain } from '../services/guildTrainService';
import { checkResetTrain } from '../services/guildTrainService';
import { getUserGuildWithRefActive } from '../services/guildService';
// 开启功能
export async function switchOnFunc(roleId: string, type: number, param: number, session: (BackendSession|FrontendSession)) {
@@ -14,10 +13,10 @@ export async function switchOnFunc(roleId: string, type: number, param: number,
let addFuncs = new Array<number>();
switch (type) {
case FUNC_OPT_TYPE.LEVEL_UP:
case FUNC_OPT_TYPE.LEVEL_UP://等级提升,触发事件
await eventOnPlayerLvUp(roleId, param, addFuncs, dataFuncs);
break;
case FUNC_OPT_TYPE.BATTLE_END:
case FUNC_OPT_TYPE.BATTLE_END://战斗结束,触发事件
//开启奇遇
break;
}
@@ -32,9 +31,13 @@ export async function switchOnFunc(roleId: string, type: number, param: number,
return recs;
}
}
/**
* 登录检查刷新
* @param role
* @param session
*/
export async function chackFunOpenWhenLogin(role: any, session: BackendSession|FrontendSession) {
await switchOnFunc(role.roleId, FUNC_OPT_TYPE.LEVEL_UP, role.lv, session);
await checkesetTrain(role.roleId, role.serverId);
await checkResetTrain(role.roleId, role.serverId);
await getUserGuildWithRefActive(role.roleId, '', true)
}