From 9eb92913145bf9f08122ee26e381b79d0d7436c0 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Thu, 12 Sep 2019 13:24:57 +0200 Subject: [PATCH 1/3] Port update node-factorio-api to 0.3.8 Note that the versions 0.3.6 and 0.3.7 had issues with an old mod_cache.json being present. This is a port of 78de723. --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c366087c..8c787f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,11 @@ Version 2.0.0 Version 1.2.1 ------------- +- Updated node-factorio-api to v0.3.8 to fix mod downloads randomly breaking + ([#229][#229].) + +[#229]: https://github.com/clusterio/factorioClusterio/issues/229 + ### Breaking Changes - Added authentication to the socket.io server running on the master. diff --git a/package.json b/package.json index 58815988..cd6e2b38 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "moment": "^2.22.2", "ncp": "^2.0.0", "needle": "^2.4.0", - "node-factorio-api": "^0.3.5", + "node-factorio-api": "^0.3.8", "node-forge": "^0.7.1", "prom-client": "^10.2.3", "rcon-client-fork": "^3.2.0", From 7d1942b615340a5adce603ebd8707e7bde1b71a6 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Thu, 12 Sep 2019 17:38:11 +0200 Subject: [PATCH 2/3] Port spawn factorio server deteached in client.js Sending ^C via the terminal on Linux may cause SIGINT to be sent twice to the factorio process, causing it to exit without completing the saving. This happens because the shell sends the interupt to all members of the process group for the job and this includes both the node client process and the factorio server process. Avoid this situation by passing detached to spawn when the platform is Linux, which causes the process to be created with its own process group and therefore not targeted by a SIGINT from the shell. This unfortunately does not work on Windows as we can't send SIGINT or ^C to a process there. Doing subprocces.kill on Windows terminates the process similarly to how SIGKILL works on Linux. This is a port of 6b090cd. --- CHANGELOG.md | 3 +++ client.js | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c787f92..a48e67e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,10 @@ Version 1.2.1 - Updated node-factorio-api to v0.3.8 to fix mod downloads randomly breaking ([#229][#229].) +- Fixed SIGINT being sent twice to Factorio server when interrupted by CTRL+C + on Linux ([#217][#217].) +[#217]: https://github.com/clusterio/factorioClusterio/issues/217 [#229]: https://github.com/clusterio/factorioClusterio/issues/229 ### Breaking Changes diff --git a/client.js b/client.js index 4de02024..f4318ae4 100644 --- a/client.js +++ b/client.js @@ -395,7 +395,8 @@ write-data=${ instance.path() }\r\n '--rcon-port', Number(process.env.RCONPORT) || instconf.clientPort, '--rcon-password', instconf.clientPassword, ], { - 'stdio': ['pipe', 'pipe', 'pipe'] + 'stdio': ['pipe', 'pipe', 'pipe'], + 'detached': process.platform === "linux", } ); factorio.stdout.on("data", data => { @@ -504,7 +505,8 @@ write-data=${ instance.path() }\r\n '--server-settings', instance.path("server-settings.json"), '--port', args.port || Number(process.env.FACTORIOPORT) || instanceconfig.factorioPort ], { - 'stdio': ['pipe', 'pipe', 'pipe'] + 'stdio': ['pipe', 'pipe', 'pipe'], + 'detached': process.platform === "linux", } ); From 0b3e4fe6f453d92b3800bd81175c422e4ac49d6b Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 11 Sep 2019 17:09:43 +0200 Subject: [PATCH 3/3] Port fix license in package.json Correct license entry being ISC instead of MIT in package.json. This is a port of 7e2ca58. --- CHANGELOG.md | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a48e67e0..824e2746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ Version 1.2.1 ([#229][#229].) - Fixed SIGINT being sent twice to Factorio server when interrupted by CTRL+C on Linux ([#217][#217].) +- Fixed package.json incorrectly reporting the license as ISC. [#217]: https://github.com/clusterio/factorioClusterio/issues/217 [#229]: https://github.com/clusterio/factorioClusterio/issues/229 diff --git a/package.json b/package.json index cd6e2b38..8570fbce 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "factorio" ], "author": "Danielv123", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=10" },