mirror of
https://github.com/syuilo/ai.git
synced 2024-11-22 05:08:00 +00:00
Merge pull request #15 from mei23/mei-1009-config-flags
configの設定が効かなかったりするのを修正
This commit is contained in:
commit
8512a8e393
|
@ -5,6 +5,7 @@ type Config = {
|
||||||
apiUrl: string;
|
apiUrl: string;
|
||||||
keywordEnabled: boolean;
|
keywordEnabled: boolean;
|
||||||
reversiEnabled: boolean;
|
reversiEnabled: boolean;
|
||||||
|
serverMonitoring: boolean;
|
||||||
mecab?: string;
|
mecab?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ export default class ReversiModule implements IModule {
|
||||||
private reversiConnection?: any;
|
private reversiConnection?: any;
|
||||||
|
|
||||||
public install = (ai: 藍) => {
|
public install = (ai: 藍) => {
|
||||||
|
if (!config.reversiEnabled) return;
|
||||||
|
|
||||||
this.ai = ai;
|
this.ai = ai;
|
||||||
|
|
||||||
this.reversiConnection = new ReconnectingWebSocket(`${config.wsUrl}/games/reversi?i=${config.i}`, [], {
|
this.reversiConnection = new ReconnectingWebSocket(`${config.wsUrl}/games/reversi?i=${config.i}`, [], {
|
||||||
|
|
|
@ -20,6 +20,8 @@ export default class ServerModule implements IModule {
|
||||||
private statsLogs: any[] = [];
|
private statsLogs: any[] = [];
|
||||||
|
|
||||||
public install = (ai: 藍) => {
|
public install = (ai: 藍) => {
|
||||||
|
if (!config.serverMonitoring) return;
|
||||||
|
|
||||||
this.ai = ai;
|
this.ai = ai;
|
||||||
|
|
||||||
this.connection = new ReconnectingWebSocket(`${config.wsUrl}/server-stats`, [], {
|
this.connection = new ReconnectingWebSocket(`${config.wsUrl}/server-stats`, [], {
|
||||||
|
|
Loading…
Reference in a new issue