mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Add load scenario command
Add alternative method of starting an instance by loading a scenario. Since there's no save when starting a scenario it can only be used if the save patching is disabled.
This commit is contained in:
1 parent
9458155a1b
commit
8c6130adba
4 files changed
+99
-11
No files matched your search
@@ -395,6 +395,23 @@ commands.push(new Command({
|
||||
},
|
||||
}));
|
||||
|
||||
commands.push(new Command({
|
||||
definition: ["load-scenario", "Start instance by loading a scenario", (yargs) => {
|
||||
yargs.options({
|
||||
"instance": { describe: "Instance to start", nargs: 1, type: "string", demandOption: true },
|
||||
"scenario": { describe: "Scenario to load", nargs: 1, type: "string" },
|
||||
});
|
||||
}],
|
||||
handler: async function(args, control) {
|
||||
let instanceId = await resolveInstance(control, args.instance);
|
||||
await link.messages.setInstanceOutputSubscriptions.send(control, { instance_ids: [instanceId] });
|
||||
let response = await link.messages.loadScenario.send(control, {
|
||||
instance_id: instanceId,
|
||||
scenario: args.scenario || null,
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
||||
commands.push(new Command({
|
||||
definition: ["stop-instance", "Stop instance", (yargs) => {
|
||||
yargs.options({
|
||||
|
||||
Reference in new issue
Block a user