Added initial support for optional mods.

Optional mods are stored by ID in the configuration. Their enabled state is stored here. The mod configurations are updated each time the distro index is refreshed. Configurations are stored by server id. If the id no longer exists (changed/removed), the mod configuration is removed. If new optional mods are added, they are added to the configuration. If they are removed, they are removed from the configuration.

Currently only top level optional mods are supported.
This commit is contained in:
Daniel Scalzi
2018-06-23 15:17:26 -04:00
parent 4196856d31
commit 145a2fe77b
4 changed files with 166 additions and 26 deletions

View File

@@ -247,6 +247,20 @@ class AssetGuard extends EventEmitter {
return cs.join('/')
}
/**
* Resolves an artiface id without the version. For example,
* 'net.minecraftforge:forge:1.11.2-13.20.0.2282' becomes
* 'net.minecraftforge:forge'.
*
* @param {string} artifactid The artifact id string.
* @returns {string} The resolved identifier without the version.
*/
static _resolveWithoutVersion(artifactid){
let ps = artifactid.split(':')
return ps[0] + ':' + ps[1]
}
// #endregion
// Static Hash Validation Functions