聊天:访问频率限制
This commit is contained in:
@@ -12,7 +12,7 @@ export const STATUS = {
|
||||
BLOCK_WORDS: { code: 9, simStr: '内容有不合法词汇' },
|
||||
BLOCKED: { code: 10, simStr: '您已被封禁' },
|
||||
BANNED: { code: 11, simStr: '您已被禁言' },
|
||||
ACCESS_BUSY: { code: 12, simStr: '您的操作过于繁忙' },
|
||||
ACCESS_BUSY: { code: 12, simStr: '您不久前发送过消息了,请稍等一下' },
|
||||
ONLINE_USER_MAX: { code: 13, simStr: '服务器繁忙,请稍后再试' },
|
||||
FUNCTION_CLOSE: { code: 14, simStr: '抱歉,该功能暂时关闭' },
|
||||
GLOBAL_ERR: { code: 1003, simStr: '服务器内部错误' },
|
||||
|
||||
@@ -2,11 +2,21 @@
|
||||
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;
|
||||
}
|
||||
export interface DicServerConst {
|
||||
// 保护接口,间隔时间
|
||||
readonly PROTECT_API_INTERVAL: number;
|
||||
// 保护的接口
|
||||
readonly PROTECT_API: string[];
|
||||
readonly PROTECT_API: ProtectApi[];
|
||||
// 某些api功能关闭
|
||||
readonly API_IS_CLOSE: number;
|
||||
// 关闭的接口
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"PROTECT_API_INTERVAL": 500,
|
||||
"PROTECT_API": [
|
||||
"chat.chatHandler.sendGroupMessage",
|
||||
"chat.chatHandler.sendPrivateMessage",
|
||||
"battle.barrageHandler.sendBarrage"
|
||||
],
|
||||
"API_IS_CLOSE": 0,
|
||||
"CLOSE_APIS": [],
|
||||
"CLOSE_LOGIN": 0,
|
||||
"CLOSE_LOGIN_WHEN_ONLINE_MAX": 1,
|
||||
"MAX_ONLINE_USER_COUNT": 5000
|
||||
"MAX_ONLINE_USER_COUNT": 5000,
|
||||
"PROTECT_API": [
|
||||
{ "id": 1, "desc": "世界聊天", "route": "chat.chatHandler.sendGroupMessage", "param": { "channel": "world" }, "interval": 20000 },
|
||||
{ "id": 2, "desc": "军团聊天", "route": "chat.chatHandler.sendGroupMessage", "param": { "channel": "guild" }, "interval": 5000 },
|
||||
{ "id": 3, "desc": "组团聊天", "route": "battle.comBattleHandler.sendTeamMsg", "param": {}, "interval": 5000 },
|
||||
{ "id": 4, "desc": "私聊", "route": "chat.chatHandler.sendPrivateMessage", "param": {}, "interval": 5000 },
|
||||
{ "id": 5, "desc": "发送弹幕", "route": "battle.barrageHandler.sendBarrage", "param": {}, "interval": 5000 }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user