mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 08:23:12 +09:00
Fixed crash on !shout
This commit is contained in:
1 parent
dc19457471
commit
1bd87c4cc9
2 files changed
+9
-2
No files matched your search
@@ -504,7 +504,9 @@ function instanceManagement() {
|
|||||||
}
|
}
|
||||||
for(let i = 0; i < stuff.length; i++) {
|
for(let i = 0; i < stuff.length; i++) {
|
||||||
if(stuff[i] && !stuff[i].includes('\u0000\u0000')) {
|
if(stuff[i] && !stuff[i].includes('\u0000\u0000')) {
|
||||||
plugins[I].scriptOutput(stuff[i]);
|
try{
|
||||||
|
plugins[I].scriptOutput(stuff[i]);
|
||||||
|
}catch(e){console.log(e)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ module.exports = class remoteCommands {
|
|||||||
this.socket.on("gameChat", data => {
|
this.socket.on("gameChat", data => {
|
||||||
if(data.instanceID && data.instanceID != this.config.unique.toString()){
|
if(data.instanceID && data.instanceID != this.config.unique.toString()){
|
||||||
if(data.data.includes("[CHAT]") && data.data.toLowerCase().includes("!shout")){
|
if(data.data.includes("[CHAT]") && data.data.toLowerCase().includes("!shout")){
|
||||||
let chatMessage = "["+data.instanceID+"]"+ data.data.trim().split(" ").shift().shift().shift().join(" ");
|
let message = data.data.trim().split(" ");
|
||||||
|
message.shift();
|
||||||
|
message.shift();
|
||||||
|
message.shift();
|
||||||
|
message.join(" ");
|
||||||
|
let chatMessage = "["+data.instanceID+"]"+ message;
|
||||||
this.messageInterface("/c game.print('"+chatMessage+"')");
|
this.messageInterface("/c game.print('"+chatMessage+"')");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user