Add default mod packs (#735)

This commit is contained in:
Cooldude2606 authored and GitHub committed 2025-02-14 14:47:26 +00:00
1 parent 7b8945ff15
commit 8996671bea
6 files changed
+72 -1

No files matched your search

+4
View File
@@ -127,6 +127,10 @@ export default class Controller {
lib.ModPack.fromJSON.bind(lib.ModPack)
).bootstrap());
if (modPacks.size === 0) {
modPacks.setMany(lib.ModPack.defaultModPacks);
}
const userManager = new UserManager(config);
await userManager.load(path.join(databaseDirectory, "users.json"));
+21
View File
@@ -383,6 +383,27 @@ export default class ModPack {
}
}
/** Array of default mod packs which should exist on a newly installed cluster */
static defaultModPacks = [
...["0.17", "0.18", "1.0", "1.1", "2.0"]
.map(version => this.fromJSON({
name: `Base Game ${version}`,
description: `Factorio ${version} with no extra mods.`,
factorio_version: version,
} as any)),
...["2.0"]
.map(version => this.fromJSON({
name: `Space Age ${version}`,
description: `Factorio ${version} with Space Age expansion.`,
factorio_version: version,
mods: [
{ name: "elevated-rails", enabled: true, version },
{ name: "quality", enabled: true, version },
{ name: "space-age", enabled: true, version },
],
} as any)),
];
/**
* Returns an array of ModInfo containing all mods included in factorio
*
+5
View File
@@ -189,6 +189,11 @@ export abstract class Datastore<
return this.data.get(key);
}
// Allow getting the size of the datastore
get size() {
return this.data.size;
}
// Allow iterating through the datastore like a Map.
[Symbol.iterator](): IterableIterator<[K, Readonly<V>]> {
return this.data.entries();