diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d74489..ff0d2d82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Version 2.0.0 - Removed undocumented --port and --rcon-port arguments to client. - Removed undocumented FACTORIOPORT and RCONPORT enviroment variable handling in client. +- Removed redundant call to /api/slaves in globalChat plugin. ### Breaking Changes diff --git a/sharedPlugins/globalChat/index.js b/sharedPlugins/globalChat/index.js index f520ec85..da9246fc 100644 --- a/sharedPlugins/globalChat/index.js +++ b/sharedPlugins/globalChat/index.js @@ -1,12 +1,9 @@ -const needle = require("needle"); - module.exports = class remoteCommands { constructor(mergedConfig, messageInterface, extras){ this.messageInterface = messageInterface; this.config = mergedConfig; this.socket = extras.socket; this.instances = {}; - this.getInstanceName = require("lib/clusterTools/getInstanceName")(mergedConfig); this.socket.on("hello", () => this.socket.emit("registerChatReciever")); @@ -25,11 +22,10 @@ module.exports = class remoteCommands { words.shift(); let message = words.join(" ").replace(/[";]/g, " ").replace(/[']/g,"").replace("/shout ", "").replace("!shout ","").replace(/\[gps=.*?\]/g, "").replace(/\[train=.*?\]/g, ""); - let instance = await this.getInstanceName(data.instanceID); if(data.data.includes("[gps=")){ //Nothing }else{ - this.messageInterface("/silent-command game.print('[" + instance + "] " + message + "')"); + this.messageInterface("/silent-command game.print('[" + data.instanceName + "] " + message + "')"); } } } @@ -39,6 +35,7 @@ module.exports = class remoteCommands { try{ this.socket.emit("gameChat", { instanceID: this.config.unique.toString(), + instanceName: this.config.name, data, }); if(data.includes("[CHAT]") && data.includes("!info")){