From 51f7430a4b79d0ed1c9038e69b5585e650c6180f Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 24 Nov 2023 21:02:15 +0100 Subject: [PATCH] Add warning to generated server-settings.json Leave a warning in case someone opens and tries to modify the server-settings.json file in the instance folder, as any changes made will be lost when it's overwritten. --- packages/host/src/Instance.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/host/src/Instance.ts b/packages/host/src/Instance.ts index dd9e7e21..50965248 100644 --- a/packages/host/src/Instance.ts +++ b/packages/host/src/Instance.ts @@ -592,7 +592,11 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " "); * factorio_settings config entry. */ async writeServerSettings() { - let serverSettings = await this.resolveServerSettings(this.config.get("factorio.settings")); + const warning = "Changes to this file will be overwitten by the factorio.settings config on the instance."; + const serverSettings = { + "_comment_warning": warning, + ...await this.resolveServerSettings(this.config.get("factorio.settings")), + }; await lib.safeOutputFile( this.server.writePath("server-settings.json"), JSON.stringify(serverSettings, null, 4)