mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
25 lines
610 B
JavaScript
25 lines
610 B
JavaScript
module.exports = class remoteCommands {
|
|
constructor(mergedConfig, messageInterface, extras){
|
|
this.messageInterface = messageInterface;
|
|
this.config = mergedConfig;
|
|
this.socket = extras.socket;
|
|
|
|
if(this.config.allowRemoteCommandExecution){
|
|
this.socket.on("runCommand", data => {
|
|
let {commandID} = data;
|
|
this.messageInterface(data.command);
|
|
if(commandID){
|
|
this.socket.emit("runCommandReturnValue", {
|
|
commandID,
|
|
body: {
|
|
info: "Command was sent to factorio",
|
|
},
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
scriptOutput(data){
|
|
// we don't return anything yet
|
|
}
|
|
} |