From e07415f4cb1a195e89956ba58c873921c2723e9d Mon Sep 17 00:00:00 2001 From: mei23 Date: Tue, 9 Oct 2018 03:22:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?config=20serverMonitoring=E3=81=8C=E5=8A=B9?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.ts | 1 + src/modules/server/index.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/config.ts b/src/config.ts index 7e3f632..f729155 100644 --- a/src/config.ts +++ b/src/config.ts @@ -5,6 +5,7 @@ type Config = { apiUrl: string; keywordEnabled: boolean; reversiEnabled: boolean; + serverMonitoring: boolean; mecab?: string; }; diff --git a/src/modules/server/index.ts b/src/modules/server/index.ts index ca00db9..49a9ada 100644 --- a/src/modules/server/index.ts +++ b/src/modules/server/index.ts @@ -20,6 +20,8 @@ export default class ServerModule implements IModule { private statsLogs: any[] = []; public install = (ai: 藍) => { + if (!config.serverMonitoring) return; + this.ai = ai; this.connection = new ReconnectingWebSocket(`${config.wsUrl}/server-stats`, [], { From bce44c7c052373a56f7eacfa09120faf6d378196 Mon Sep 17 00:00:00 2001 From: mei23 Date: Tue, 9 Oct 2018 04:55:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=AA=E3=83=90=E3=83=BC=E3=82=B7?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=81=AA=E3=82=89=E6=8E=A5=E7=B6=9A?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/reversi/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/reversi/index.ts b/src/modules/reversi/index.ts index 364e51a..6f6423a 100644 --- a/src/modules/reversi/index.ts +++ b/src/modules/reversi/index.ts @@ -20,6 +20,8 @@ export default class ReversiModule implements IModule { private reversiConnection?: any; public install = (ai: 藍) => { + if (!config.reversiEnabled) return; + this.ai = ai; this.reversiConnection = new ReconnectingWebSocket(`${config.wsUrl}/games/reversi?i=${config.i}`, [], {