Replace ini packages with homebrew module

The INI format Factorio use differs from what the ini package parse and
produce.  Most notably no escape mechanism exists in Factorio's parser
which causes instance paths containing among other thing the # character
to completely break.  Fix by replacing the ini package with a Factorio
compatible implementation of INI parsing and serialization.

Resolves the problem in #414.
This commit is contained in:
Hornwitser committed 2021-09-27 03:45:52 +02:00
1 parent 642504874b
commit f529457f96
5 files changed
+192 -6

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ const events = require("events");
const util = require("util");
const crypto = require("crypto");
const ini = require("ini");
const libIni = require("../ini");
const rconClient = require("rcon-client");
const libErrors = require("../errors");
const { logger } = require("../logging");
@@ -1167,7 +1167,7 @@ class FactorioServer extends events.EventEmitter {
}
async _writeConfigIni() {
let content = ini.encode({
let content = libIni.stringify({
path: {
"read-data": this.dataPath(),
"write-data": this.writePath(),