feat: backup plugins

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-12-17 17:02:46 +08:00
parent 166b17b527
commit beef57d85d
11 changed files with 649 additions and 93 deletions

View File

@@ -46,7 +46,7 @@ export class MiaoExplorer extends interfaces.Plugin {
let consolePlugin: any = this.pluginManager.getPlugin('MiaoConsole')
this.token = consolePlugin.token
this.namespace = server.of('/MiaoExplorer')
this.namespace.on('connect', (client: SocketIOSocket) => {
this.namespace.on('connection', (client: SocketIOSocket) => {
if (!this.token) {
this.logger.console(`§6客户端 §b${client.id} §a请求连接 §4服务器尚未设置 Token 无法连接!`)
client.emit('unauthorized', () => client.disconnect(true))