// 服务器名 import { readFileAndParse } from '../util' import { FILENAME } from '../../consts' interface ProtectApi { // id readonly id: number; // 描述 readonly desc: string; // 接口 readonly route: string; // 参数 readonly param: any; // 频率 毫秒 readonly interval: number; } interface CloseApi { // id readonly id: number; // 描述 readonly desc: string; // 接口 readonly route: string; // 参数 readonly param: any; } export interface DicServerConst { // 保护的接口 readonly PROTECT_API: ProtectApi[]; // 某些api功能关闭 readonly API_IS_CLOSE: number; // 关闭的接口 readonly CLOSE_APIS: CloseApi[]; // 是否直接关掉登录 readonly CLOSE_LOGIN: number; // 是否当检测在线玩家过多是关掉登录 readonly CLOSE_LOGIN_WHEN_ONLINE_MAX: number; // 最大在线人数 readonly MAX_ONLINE_USER_COUNT: number; // 是否开启支付0.01元 readonly DEBUG_PAY: number; // 是否开启时间修改 readonly DEBUG_TIME: number; // 是否检查屏蔽词 readonly CHECK_WORD: number; // 是否可以支付 readonly CAN_PAY: number; // 请求timestamp差距 readonly TIME_STAMP_OVER: number; // 请求参数过期时间 readonly ACCESS_CODE_EXPIRE_TIME: number; // 是否跳过加密 readonly SKIP_ENCODE: number; // 是否返利 readonly NEED_REBATE: number; // 推送 readonly PUSH_MSG_ENV: string; // 是否关闭剧情弹幕 readonly CLOSE_SCRIPT_BARRAGE: 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; }