Added config settings for globalChat (broadcast all messages)

This commit is contained in:
Daniel Vestøl committed 2018-06-27 11:40:20 +02:00
1 parent ca49564fb7
commit cf0c3b012a
2 files changed
+8 -2

No files matched your search

+3 -1
View File
@@ -49,5 +49,7 @@
"logItemTransfers": false,
"uploadModsToMaster": true,
"msBetweenCommands": 10,
"allowRemoteCommandExecution": true
"allowRemoteCommandExecution": true,
"enableCrossServerShout": true,
"mirrorAllChat": false
}
+5 -1
View File
@@ -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();