mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 07:24:52 +09:00
5 files changed
+47
-10
No files matched your search
@@ -1,5 +1,13 @@
|
||||
const needle = require("needle");
|
||||
const config = require("./config.json");
|
||||
const cli = require("cli");
|
||||
const config = require("./../config.json");
|
||||
|
||||
let options = cli.parse()
|
||||
cli.setUsage(`node cluster_rcon.js /c game.player.force = "player"`)
|
||||
if(process.argv.length < 3){
|
||||
cli.getUsage()
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const masterIP = `${config.masterIP}:${config.masterPort}`;
|
||||
const token = config.masterAuthToken
|
||||
@@ -30,4 +38,4 @@ let killBiters = `/silent-command local surface=game.surfaces[1] for key, entity
|
||||
// console.log(resp.body)
|
||||
// });
|
||||
// }, 1000*60*5);
|
||||
})();
|
||||
})();
|
||||
@@ -0,0 +1,19 @@
|
||||
const needle = require("needle")
|
||||
const config = require("./../config.json")
|
||||
const cli = require("cli")
|
||||
|
||||
let options = cli.parse({
|
||||
name: ["n", "Name of the player to delete, case sensitive", "string"],
|
||||
token: [false, "Factorio auth token", "string", config.masterAuthToken]
|
||||
})
|
||||
if(!options.name){
|
||||
cli.getUsage()
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
needle.post(config.masterIP+":"+config.masterPort+"/api/playerManager/deletePlayer", {
|
||||
name: options.name,
|
||||
token: options.token
|
||||
}, (err, resp) => {
|
||||
console.log(resp.body)
|
||||
});
|
||||
@@ -6,7 +6,7 @@ const path = require('path');
|
||||
const syncRequest = require('sync-request');
|
||||
const request = require("request");
|
||||
const ncp = require('ncp').ncp;
|
||||
const Rcon = require('rcon-client').Rcon;
|
||||
const Rcon = require('rcon-client-fork').Rcon;
|
||||
const hashFiles = require('hash-files');
|
||||
const _ = require('underscore');
|
||||
const deepmerge = require("deepmerge");
|
||||
|
||||
+2
-1
@@ -30,6 +30,7 @@
|
||||
"bcryptjs": "^2.4.3",
|
||||
"body-parser": "^1.18.2",
|
||||
"cache-require-paths": "^0.3.0",
|
||||
"cli": "^1.0.1",
|
||||
"cli-interact": "^0.1.9",
|
||||
"codecov": "^3.0.1",
|
||||
"compression": "^1.7.2",
|
||||
@@ -56,7 +57,7 @@
|
||||
"node-factorio-api": "^0.3.1-alpha",
|
||||
"node-forge": "^0.7.1",
|
||||
"prom-client": "^10.2.3",
|
||||
"rcon-client": "^3.1.6",
|
||||
"rcon-client-fork": "^3.2.0",
|
||||
"request": "^2.83.0",
|
||||
"right-pad": "^1.0.1",
|
||||
"rmdir-sync": "^1.0.1",
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
|
||||
if game.forces['player'].technologies['{tech_name}'] then
|
||||
if 1 == {tech_infinite} then
|
||||
game.forces['player'].technologies['{tech_name}'].level = {tech_level}
|
||||
else
|
||||
game.forces['player'].technologies['{tech_name}'].researched = true
|
||||
end
|
||||
local function updateTech()
|
||||
script.raise_event(defines.events.on_research_finished, {research=game.forces['player'].technologies['{tech_name}'], by_script=true})
|
||||
if {notify} then
|
||||
if 1 == {tech_infinite} then
|
||||
@@ -15,3 +10,17 @@ if game.forces['player'].technologies['{tech_name}'] then
|
||||
game.play_sound({path="utility/research_completed"})
|
||||
end
|
||||
end
|
||||
|
||||
if game.forces['player'].technologies['{tech_name}'] then
|
||||
if 1 == {tech_infinite} then
|
||||
if (game.forces['player'].technologies['{tech_name}'].level ~= level) then
|
||||
game.forces['player'].technologies['{tech_name}'].level = {tech_level}
|
||||
updateTech()
|
||||
end
|
||||
else
|
||||
if not game.forces['player'].technologies['{tech_name}'].researched then
|
||||
game.forces['player'].technologies['{tech_name}'].researched = true
|
||||
updateTech()
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user