防护:添加人数过多防护措施
This commit is contained in:
29
shared/pubUtils/dictionary/DicServerConst.ts
Normal file
29
shared/pubUtils/dictionary/DicServerConst.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// 服务器名
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicServerConst {
|
||||
// 保护接口,间隔时间
|
||||
readonly PROTECT_API_INTERVAL: number;
|
||||
// 保护的接口
|
||||
readonly PROTECT_API: string[];
|
||||
// 这些api功能关闭
|
||||
readonly API_IS_CLOSE: number;
|
||||
// 关闭的接口
|
||||
readonly CLOSE_APIS: string[];
|
||||
// 是否直接关掉登录
|
||||
readonly CLOSE_LOGIN: number;
|
||||
// 是否当检测在线玩家过多是关掉登录
|
||||
readonly CLOSE_LOGIN_WHEN_ONLINE_MAX: number;
|
||||
// 最大在线人数
|
||||
readonly MAX_ONLINE_USER_COUNT: number;
|
||||
}
|
||||
|
||||
export const dicServerConst: DicServerConst = {} as DicServerConst;
|
||||
export function loadServerConst() {
|
||||
let json = readFileAndParse(FILENAME.DIC_SERVER_CONST);
|
||||
for(let key in json) {
|
||||
dicServerConst[key] = json[key];
|
||||
}
|
||||
json = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user