炼器堂,练兵场,事件开启,redlock注释
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user