From e6c706a83e62625aa4de62c7bd9bd19c9be9d28b Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sat, 26 May 2018 13:16:59 +0200 Subject: [PATCH] globalChat no longer breaks when the master is restarted --- sharedPlugins/globalChat/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sharedPlugins/globalChat/index.js b/sharedPlugins/globalChat/index.js index 246d1904..52de1c11 100644 --- a/sharedPlugins/globalChat/index.js +++ b/sharedPlugins/globalChat/index.js @@ -7,7 +7,9 @@ module.exports = class remoteCommands { this.socket = extras.socket; console.log(mergedConfig) this.instances = {}; - this.socket.emit("registerChatReciever"); + + this.socket.on("hello", () => this.socket.emit("registerChatReciever")); + this.socket.on("gameChat", async data => { if(data.instanceID && data.instanceID != this.config.unique.toString()){ if(data.data.includes("[CHAT]") && (data.data.toLowerCase().includes("/shout") || data.data.toLowerCase().includes("!shout"))){