Implement new configuration system

Replace current configuration mess with a trimmed down version of the
original vision of #200.  Configs are collection of config groups that
have fields that can be set.  These groups allow organizing the fields
as well as opertunity for plugins to add their own groups.  By default
plugins have an auto generated group with the enabled field.
This commit is contained in:
Hornwitser committed 2020-03-09 20:48:13 +01:00
1 parent 370ee9ed04
commit 5e5149dc93
24 files changed
+2364 -498

No files matched your search

+2 -3
View File
@@ -809,11 +809,10 @@ class FactorioServer extends events.EventEmitter {
*
* Loads server-settings.example.json from the data dir.
*
* @param {string} dataDir - The data directory for Factorio
* @returns {object} the parsed server-settings.
*/
static async exampleSettings(dataDir) {
return JSON.parse(await fs.readFile(path.join(dataDir, "server-settings.example.json"), "utf-8"));
async exampleSettings(dataDir) {
return JSON.parse(await fs.readFile(this.dataPath("server-settings.example.json"), "utf-8"));
}
async _writeConfigIni() {