Tie data exports to mod packs

Store the export manifest in ModPack to allow mulitple mod packs to have
different data exported. This is necessary as the export contains the
settings prototypes needed to create a proper UI for mod settings.

For now the useLocale and useItemMetadata interfaces uses the manifest
for a default mod pack set in the master config.
This commit is contained in:
Hornwitser committed 2023-02-02 00:28:58 +01:00
1 parent 7c6aaeb05d
commit 13e12f7335
16 files changed
+146 -34

No files matched your search

+12
View File
@@ -93,6 +93,18 @@ class BaseConnection extends libLink.Link {
}
return { mod_pack: modPack.toJSON() };
}
async getDefaultModPackRequestHandler(message) {
let id = this._master.config.get("master.default_mod_pack_id");
if (id === null) {
throw new libErrors.RequestError("Default mod pack not set on master");
}
let modPack = this._master.modPacks.get(id);
if (!modPack) {
throw new libErrors.RequestError(`Default mod pack configured (${id}) does not exist`);
}
return { mod_pack: modPack.toJSON() };
}
}
module.exports = BaseConnection;