Implement mod pack loading for shared mods

Wipe and reconstruct the instances' mods/ folder using the configured
ModPack for the case were the mods folder is shared with the master
server.  This assumes the master server will check the mod checksums
before sending the start request.
This commit is contained in:
Hornwitser committed 2022-11-10 00:28:50 +01:00
1 parent 0ebb2f5858
commit fb4ffaffed
14 files changed
+124 -165

No files matched your search

+9
View File
@@ -8,6 +8,7 @@ const phin = require("phin");
const util = require("util");
const events = require("events");
const libData = require("@clusterio/lib/data");
const libLink = require("@clusterio/lib/link");
const { LineSplitter } = require("@clusterio/lib/stream");
const { ConsoleTransport, logger } = require("@clusterio/lib/logging");
@@ -220,6 +221,14 @@ before(async function() {
controlConnector.token = controlToken;
control = new TestControl(controlConnector);
await controlConnector.connect();
const testPack = new libData.ModPack();
testPack.id = 12;
testPack.name = "subspace_storage-pack";
testPack.factorioVersion = "1.1.0";
testPack.mods.set("subspace_storage", { name: "clusterio_lib", enabled: true, version: "0.1.2" });
testPack.mods.set("subspace_storage", { name: "subspace_storage", enabled: true, version: "1.99.8" });
libLink.messages.createModPack.send(control, { mod_pack: testPack.toJSON() });
});
after(async function() {