mirror of
https://github.com/syuilo/ai.git
synced 2024-11-09 23:48:01 +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;
|
||||
keywordEnabled: boolean;
|
||||
reversiEnabled: boolean;
|
||||
serverMonitoring: boolean;
|
||||
mecab?: string;
|
||||
};
|
||||
|
||||
|
|
|
@ -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}`, [], {
|
||||
|
|
|
@ -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`, [], {
|
||||
|
|
Loading…
Reference in a new issue