Page 1 of 1

Headless server and client on same host

Posted: Thu Apr 27, 2017 7:30 am
by iterat0r
I want to have a headless server and then have a client on the same machine to connect to it.
Trying this gives an error about log file already being in use.

Is there a way to specify log file name on the command line?
or other way to make this work?

Re: Headless server and client on same host

Posted: Thu Apr 27, 2017 12:56 pm
by rhox
Looks like I was able to get it going using

Code: Select all

--console-log my-log.txt --no-log-rotation
Though, I'm not sure where it actually put 'my-log.txt', as I don't see it in the directory I was in, nor in %appdata%\Factorio. But, at least with the --no-log-rotation, that seemed to be enough to get me running both!

Re: Headless server and client on same host

Posted: Thu Apr 27, 2017 2:36 pm
by iterat0r
Hmm no luck for me - my factorio doesn't have the --console-log option.

Re: Headless server and client on same host

Posted: Thu Apr 27, 2017 3:51 pm
by ChoMar
I think youre supposed to put the line in the shortcut to the exe.

Re: Headless server and client on same host

Posted: Thu Apr 27, 2017 5:59 pm
by rhox
iterat0r wrote:Hmm no luck for me - my factorio doesn't have the --console-log option.
Hm, perhaps it's a 0.15.x only switch? I don't have a copy of 0.14 on this machine to check. Can you do --help and see if the option is listed?

Re: Headless server and client on same host

Posted: Wed May 03, 2017 6:54 pm
by iterat0r
I have the logs option in 0.15.2
however i still get the error about inability to move current.log
Ill try to launch the client with a bat file naming a different log file.
This works!

Re: Headless server and client on same host

Posted: Wed May 03, 2017 7:04 pm
by iterat0r
Now I get the error message (when connecting to the server).
Cannot join. The following mod script files are not identical between you and the server:
level

Re: Headless server and client on same host

Posted: Thu May 04, 2017 12:08 am
by noliVe
you need the server and game in different folders

we are running them like this

screen -dmS factorio_port_number_40006 /opt/factorio/factorio/0.14.22/bin/x64/factorio --config /opt/factorio/username_40006/config.ini --port 40006 --server-settings /opt/factorio/username_40006/server-settings.json --start-server /opt/factorio/username_40006/saves/savegame.zip

with each user have a different config. it even says in the config file where to write down temp and logs
see

Code: Select all

; version=2
[path]
read-data=/opt/factorio/factorio/0.15.6/data
write-data=/opt/factorio/nolive_40017

[general]
locale=de
change this file " config.ini " to the path you want to write everything

Re: Headless server and client on same host

Posted: Thu May 04, 2017 12:10 am
by noliVe
iterat0r wrote:Now I get the error message (when connecting to the server).
Cannot join. The following mod script files are not identical between you and the server:
level
copie your mods directly from the server. somehow there are changes between your mods and the servers mods.
only once these are the same the game starts

Re: Headless server and client on same host

Posted: Thu Nov 29, 2018 11:58 am
by hooiberg
You even get this error when running a server and a client on the same machine with vanilla factorio. The error message somehow drags mods into it.

Re: Headless server and client on same host

Posted: Thu Nov 29, 2018 12:07 pm
by Zavian
hooiberg wrote:
Thu Nov 29, 2018 11:58 am
You even get this error when running a server and a client on the same machine with vanilla factorio. The error message somehow drags mods into it.
If you want to run 2 copies of Factorio on the same machine, then you need to make sure they aren't both attempting to use the same directories for things like mods/logs/savefiles etc. The easiest way to achieve that is to make sure that they are completely separate installs, and to use the .zip package for at least one of the installs. (The .zip package extracts to a completely self contained copy of Factorio).

Re: Headless server and client on same host

Posted: Sat Dec 01, 2018 6:28 pm
by hooiberg
Thank you very much.
I copied the default Steam directory some place else, used that to start the server, and run the client from Steam.
It all works like a charm, now.