Remove remoteCommands plugin and interface

Remove the half baked remote rcon command interface in preparation for a
better version based on a new socket.io communication layer.
This commit is contained in:
Hornwitser committed 2019-11-20 22:37:25 +01:00
1 parent ca2967e255
commit 27fc68da0f
7 files changed
+2 -141

No files matched your search

-40
View File
@@ -1,40 +0,0 @@
const needle = require("needle");
const cli = require("cli");
const config = require("./../config.json");
let options = cli.parse()
cli.setUsage(`node cluster_rcon /c game.player.force = "player"`)
if(process.argv.length < 3){
cli.getUsage()
process.exit(1)
}
const token = config.masterAuthToken
let commandArray = process.argv;
commandArray.shift();
commandArray.shift();
const needleOptionsWithTokenAuthHeader = {
headers: {
'x-access-token': token,
},
};
let command = commandArray.join(" ");
let killBiters = `/silent-command local surface=game.surfaces[1] for key, entity in pairs(surface.find_entities_filtered({force="enemy"})) do entity.destroy() end`;
(async ()=>{
needle.post(config.masterURL+"/api/runCommand", {
broadcast:true,
command,
}, needleOptionsWithTokenAuthHeader, (err, resp) => {
console.log(resp.body)
});
// setInterval(()=>{
// needle.post(config.masterURL+"/api/runCommand", {
// broadcast:true,
// command: killBiters,
// }, needleOptionsWithTokenAuthHeader, (err, resp) => {
// console.log(resp.body)
// });
// }, 1000*60*5);
})();