diff --git a/config.json.dist b/config.json.dist index f0d466d8..ade686b6 100644 --- a/config.json.dist +++ b/config.json.dist @@ -49,5 +49,7 @@ "logItemTransfers": false, "uploadModsToMaster": true, "msBetweenCommands": 10, - "allowRemoteCommandExecution": true + "allowRemoteCommandExecution": true, + "enableCrossServerShout": true, + "mirrorAllChat": false } diff --git a/sharedPlugins/globalChat/index.js b/sharedPlugins/globalChat/index.js index 29c33a7a..3cb05edd 100644 --- a/sharedPlugins/globalChat/index.js +++ b/sharedPlugins/globalChat/index.js @@ -11,7 +11,11 @@ module.exports = class remoteCommands { 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"))){ + if(data.data.includes("[CHAT]") + // check if we are allowed to cross chat at all, default to true + && (mergedConfig.enableCrossServerShout == undefined || mergedConfig.enableCrossServerShout) + // check if we are supposed to relay this message + && (mergedConfig.mirrorAllChat || data.data.toLowerCase().includes("/shout") || data.data.toLowerCase().includes("!shout"))){ let words = data.data.trim().split(" "); words.shift(); words.shift();