Allow the factorio_directory specified in the slave config to contain
multiple Factorio installs and add factior.version instance option to
select which install to use for the given instance.
When using the shell for spawning the master and slave integration
processes the shell becomes the process that is returned by the spawn
command. This in turn means that the SIGINT that was supposed to be
sent to the master and slave processes got ignored by the shell instead.
Fix by spawning the node process directly instead of through a shell.
Shutdown running instances and close the connection to the master server
on slave stop. Remove call to process.exit on shutdown as it's no
longer needed.
Use SIGINT instead of the default SIGTERM when signalling to shut down
the integration master and slave subprocesses. This should let nyc
properly write the coverage report before it exits.
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.
Validate messages sent over links with the json schema provided from
them. This aids debugging as an exception will be thrown from the code
sending the bad content.
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.
Add startup event to the Clusterio module API which is raised at startup
of a Factorio server. This is to server as a replacement for the
on_init and on_configuration_changed events which cannot be used in
modules.
Adds clusterio_patch_number global from the patcher in order to
implement this. This is a number that's incremented every time the save
is patched.
Add option to FactorioServer.sendRcon to throw on non-empty responses
from Factorio. This is useful for detecting errors returned by commands
that should not have a response.
Change module loading to use a module.json file describing the module
and patch in all files in a directory path passed to the patcher instead
of having to pass the files names and their content. This allows the
specification of which files should be passed to the event_handler lib
and an easy implementation of loading stand alone modules.
Add an implementation of a Prometheus client. This is because the
prom-client implementation seems to have missunderstood how Prometheus
is supposed to work and doesn't allow updating collectors via
asynchronous callback.
Change Instance class to be a subclass of Link and refactor the
communication to and establisment of instances to use a virtual
connection between the slave and the instance. This is simplifies the
implementation of plugin communication for instances.
Replace InstanceRequest with a forwardTo option to Request which does
the task of forwarding in a much cleaner way.
Replace the sources/targets concept with a links array in the message
definitions. Fixes the problem of the actual links the messages applies
to being ambigious when there's multiple sources and targets.
Remove connection and client subclasses of Link and put the connection
logic into a "connector" class. The connector deals with sending
and receiving messages, handling the connection and reconnection of lost
connections and giving sequence numbers to messages.
This move the logic of the actual connection away from the link
sub-classes, which in turn means the connection should be a lot easier
to mock in tests.
Check if Factorio terminated as a result of SIGKILL and throw an error
suggesting the system may be low on memory as a cause. Also print exit
code if the unexpected shutdown occured without a signal.
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.