Merge branch 'dev'

This commit is contained in:
Danielv123 committed 2017-04-02 15:17:27 +02:00
commit a21df015a8
3 files changed
+29 -6

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
FROM node:latest
RUN apt-get update && apt install git -y && git clone https://github.com/Danielv123/factorioClusterio.git && cd factorioClusterio && npm install && curl -o factorio.tar.gz -L https://www.factorio.com/get-download/latest/headless/linux64 && tar -xvzf factorio.tar.gz
LABEL maintainer "danielv@live.no"
EXPOSE 8080 34167
VOLUME /factorioClusterio/instances
WORKDIR factorioClusterio
CMD node $MODE\.js start $INSTANCE
+17 -5
View File
@@ -1,4 +1,4 @@
#factorioClusterio # factorioClusterio
If you want to connect to a clusterio cluster, please reffer to the [client](https://github.com/Danielv123/factorioClusterioClient) If you want to connect to a clusterio cluster, please reffer to the [client](https://github.com/Danielv123/factorioClusterioClient)
@@ -18,7 +18,7 @@ Connection diagram:
There can be any number of clients connected to each slave, and any sumber of slaves connected to a master but there can only be one master server. There can be any number of clients connected to each slave, and any sumber of slaves connected to a master but there can only be one master server.
#Ubuntu setup # Ubuntu setup
NodeJS does not support EOL ubuntu releases. Make sure you are on the most recent LTS release or newer. NodeJS does not support EOL ubuntu releases. Make sure you are on the most recent LTS release or newer.
@@ -48,7 +48,19 @@ To launch an instance with pm2
use `nano config.json` to change settings. use `nano config.json` to change settings.
#Windows setup **Ubuntu with Docker**
Clusterio has limited support for using docker.
sudo docker build -t clusterio --no-cache --force-rm factorioClusterio
sudo docker run --name master -e MODE=master -p 1234:8080 -d -it --restart=unless-stopped danielvestol/clusterio
sudo docker run --name slave -e MODE=client -e INSTANCE=world1 -v /srv/clusterio/instances:/factorioClusterio/instances -p 1235:34167 -it --restart=unless-stopped danielvestol/clusterio
The -v flag is used to specify the instance directory. Your instances (save files etc) will be stored there.
# Windows setup
Clusterio is built up of multiple parts. Here is a quick guide: Clusterio is built up of multiple parts. Here is a quick guide:
@@ -86,7 +98,7 @@ reboot when you are done, then proceed to the next steps. *reboots matter*
3. Type `node client.js start [instancename]` to create a new instance. 3. Type `node client.js start [instancename]` to create a new instance.
To connect to a master server running on a remote machine, open config.json with your favourite text editor (notepad++). You can also set it up to use the official server browser server. To connect to a master server running on a remote machine, open config.json with your favourite text editor (notepad++). You can also set it up to use the official server browser.
Change masterIP to something like 31.152.123.14 (provided by master server owner) Change masterIP to something like 31.152.123.14 (provided by master server owner)
@@ -96,7 +108,7 @@ Repeat step 3 for more servers on one machine. You should be able to find its po
**GameClient** **GameClient**
Alternative experimental client that may be broken: [clusterioClient](https://github.com/Danielv123/factorioClusterioClient) Fancy game client that does the following steps automatically: [clusterioClient](https://github.com/Danielv123/factorioClusterioClient)
1. Download the same version of the mod as the slave is running from [the mod portal](https://mods.factorio.com/mods/Danielv123/clusterio) or [github](https://github.com/Danielv123/factorioClusterioMod 1. Download the same version of the mod as the slave is running from [the mod portal](https://mods.factorio.com/mods/Danielv123/clusterio) or [github](https://github.com/Danielv123/factorioClusterioMod
+1 -1
View File
@@ -354,7 +354,7 @@ function instanceManagement() {
if(fs.existsSync(instancedirectory + "/script-output/tempfile.txt")) { if(fs.existsSync(instancedirectory + "/script-output/tempfile.txt")) {
var data = fs.readFileSync(instancedirectory + "/script-output/tempfile.txt", "utf8").split("\n"); var data = fs.readFileSync(instancedirectory + "/script-output/tempfile.txt", "utf8").split("\n");
// delete when we are done // delete when we are done
fs.unlink(instancedirectory + "/script-output/tempfile.txt"); fs.unlink(instancedirectory + "/script-output/tempfile.txt", function(){});
} }
// if we actually got anything from the file, proceed to categorize it // if we actually got anything from the file, proceed to categorize it
if (data && data[0]) { if (data && data[0]) {