Spawn master, slave, and clusterctl in separate processes in the
clusterio integration tests and leave the test master and slave process
available for the whole test duration to allow plugins to use them as
well. This removes the need for reimplementing the startup logic in the
test code and makes the existing startup code covered by tests.
Replace socket.io with plain WebSocket using the ws library as it
doesn't really provide any useful tools over plain WebSocket when it
comes to implementing reliable communication that works across
reconnects. The widespread browser support for WebSocket also means
it has little value to add for the web interface over WebSocket.
Add a library mod for wrapping the Clusterio remote API and providing
related utilities. This eases development of Clusterio related Lua code
by providing the same interface for both mods and modules and also makes
the serialize library available without having to duplicate it.
It is not possible to implement this through save patching as mods
cannot load Lua code from the level code like they can with code from
other mods.
Close active connections and http servers during master shutdown and let
node exit on its own. If this fails with an error set output streams to
blocking and report it then shutdown with process.exit.
Also add double SIGINT handling to immediately shutdown.
The maintainers of bcrypt have in their infinite wisdom decided to stop
distributing Windows binaries. Their inner workings remain a mystery.
This is a port of 5fe98a0.
Rework client.js to support running multiple instances at once and be
managed remotely and implement the neccessary communication
infrastructure for this.
Due to circular dependencies on the implementation of this the master
branch is significantly broken after this.
Remove the .js suffix from help texts of node invocations as well as
actual invocations as this is not necessary. Removing it opens up the
possibility of restructuring the code into a directory with the same
name.
Remove Hotpatch and implement a save patcher in its place. The save
patcher takes a normal Factorio save and adds modules to it that's
loaded by a generated control.lua file. This greatly reduces the
difficulty of adding an existing game to Clusterio and using scenario
code in plugins.
The mechanism for selecting what code to patch into the saves from
plugins is temorary and expected to change with #220.
Break out the server process management to a new FactorioServer class in
lib/factorio. This class takes responsibility for managing a factorio
server, communicating with it and handling the stopping of it. It also
replaces the previous effort to do this in lib/factorioServer.
This change also updates the version of rcon-client, and since the
author of it has updated it to use UTF-8 the fork is no longer
necessary. It also removes the messageInterface implementation
in favor of just calling the rcon-client library directly since
this has rate limiting logic built in.
The lib/factorio library is intended to abstract all the interfacing
that happens with Factorio.
Add symlinkMods function which takes an instance and a shared mods
folder as input and updates or creates the instance mods folder from it
by symlinking the mods in the shared mods folder to the instance mods
folder.
On Windows this uses hard links as the symlinks require elevated
privileges.
Remove the explicit ignoring of the exit status of the test scripts.
This makes the Travis CI build be considered a failure if one of the
tests fail. Also rewrite the fast-test script to use the test script.
Update old dependencies. Fix change in mocha causing it to not exist
afer the tests are done and a change in the command parsing causing the
tests to no longer be detected.
Update instructions, Dockerfile and Travis CI to use Node.js 10.
Specify that Node.js version 10 or greater is needed in the engines
section of package.json (note that this is only advisory.) And document
this as a breaking change in CHANGELOG.md.
Do not install git, tar and curl as these packages are installed by
default on Travis CI. Move the codecov upload to the travis script and
do not include the codecov token as it's not needed when uploaded from
Travis CI. Make the cover npm script into something that can be runned
locally and move the Travis CI version to a new ci-cover script. Remove
the verbose flag from the tar extration of the factorio headless server.
Use nyc instead of istanbul as the later has been deprecated and is no
longer being developed. Fix the cover and test scripts to work again
with nyc and add the output dir for nyc into .gitignore.
A 50 kb library is not needed to make a function run once, especially
not when it doesn't work. _.once does not modify the function passed to
it to only run once it returns a new function that only runs once.
Since the result of once was discarded, it had no effect.
Remove underscore and implement instanceManagement running once properly
with 3 lines of code.
This saved 30ms of the startup on my machine. Even if it saved a second
it's still pretty pointless as we're not depending on the master server
startup being super fast.
Replace the 10 MB of dependencies that is hash-files with a homebrew
Promise based implementation of hashFile that uses crypto and fs. This
somehow also ends up being the same amount of code as the one using
hash-files.
It's not supposed to be installed as a dependency in the first place,
and this seems like the wrong solution to there being too many stinking
dependencies to keep track the security of.
The 0.3.5 release of node-factorio-api removed the dependency to
documentation, which itself pulls in another 500 dependencies. Update
to 0.3.5 to avoid having this pulled in.
#add tailing of files to prevent lost data between factorio and clusterio
#move socketio connect to the bottom after the plugins are loaded
to prevent plugins not getting the connection event
#add some more transfer compression in different places
Move the contents of node_modules/_app into lib/ as there shouldn't be
any content in node_modules. This directory is automatically managed
and pruned by npm.
Add lib/ as a local package in package.json, this allows scripts
everywhere to require it's content as "lib/path" instead of relying on
local paths. This shadows the StdLib Node.js Bindings package, but I
could care less.
Change all requires with lib as a local path and _app to use just lib.