Page 2 of 4

Re: Steam Dedicated Server

Posted: Wed Mar 09, 2016 10:25 pm
by MADMEYN
posila wrote:
MADMEYN wrote:I made another config.ini file and named it config-server.ini. Do I keep both of .ini files in the config folder? Or do I need to move one?
They can stay in the same folder. Don't forget to change port number in one of the configs otherwise you won't be able to connect to multiplayer while server is running.

So I can arbitrarily change either of the ports? Could you give an example?

Re: Steam Dedicated Server

Posted: Wed Mar 09, 2016 10:39 pm
by posila
MADMEYN wrote:So I can arbitrarily change either of the ports? Could you give an example?
My recommendation is to change port number in client's config.ini and leave port in config-server.ini to default value (34197). That way people won't have to type port number when they try to connect to your server.
I usually change ports by incrementing default value (34198), or to something that is easy to remember, just in case I would want to host a game from client (ie. 34444, 34567)

Re: Steam Dedicated Server

Posted: Wed Mar 09, 2016 10:49 pm
by MADMEYN
Okay, I've made progress. I currently can run both the server and game. To test the port problem, I kept both ports as 34197, and tried to connect. I got the error that the port was already in use, as expected.

So then I went into the original config file and changed the port to 34198. When I try to connect now, it says "Couldnt establish network communication with server"

Also, I am trying to connect to the local IP that google gives me. Does the server now have it's own unique IP or do I in fact connect to my own IP?

Thank you for the help by the way! Didn't expect such a fast response!

UPDATE: I tried connecting by leaving the IP field blank, and now I'm in. Looking at the server's cmd window, I can see that the server has recognized me joining. So, I now assume that my friends will not leave the IP blank, but will enter my IP in order to connect.

Re: Steam Dedicated Server

Posted: Wed Mar 09, 2016 11:09 pm
by prg
Connecting to your router's external IP address might not work so well from within your LAN, try localhost instead.

Edit: Oh, you already did. Nevermind.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 4:21 pm
by KoblerMan
Hello,

I am interested in running a headless server and playing on the same PC, I have Steam and I have followed all of the steps that posila has outlined. I am STILL getting the error message "The process cannot access the file because it is being used by another process".

I don't understand what I'm doing wrong here. I can launch the server just fine and my server.bat file looks like this:

Code: Select all

start /wait Factorio.exe --start-server World.zip -c "%appdata%"\Factorio\config\config-server.ini
My config files look like this:

Code: Select all

## config.ini
write-data=__PATH__system-write-data__

Code: Select all

## config-server.ini
write-data=__PATH__system-write-data__/server
I even have an empty folder marked "server" in my \AppData\Roaming\Factorio folder.

Help?

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 4:38 pm
by prg
Does the "Write data path" in the output when you start the server contain what you expect? (The server doesn't get restarted through Steam and still produces output, right? Otherwise look at the log file)

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 4:49 pm
by KoblerMan
My server's command window looks like this:

Code: Select all

0.002 Write data path: C:/Users/Ryan/AppData/Roaming/Factorio
Does the "Write data path" in the output when you start the server contain what you expect?
That's just the issue, I really don't know what to expect.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:04 pm
by prg
That seems to be missing the /server at the end. Does the config file exist in the place you specify? Try 'type "%appdata%"\Factorio\config\config-server.ini' and see if that returns the contents of the file or an error message.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:09 pm
by KoblerMan
prg wrote:That seems to be missing the /server at the end. Does the config file exist in the place you specify? Try 'type "%appdata%"\Factorio\config\config-server.ini' and see if that returns the contents of the file or an error message.
I'm not sure I understand. Where do I type this?

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:13 pm
by prg
Oh, a cmd window. Thought you were using that already. Also if you get some output, make sure it's the values you expect, not some default ones. (maybe the config was missing and got automatically generated while the file you actually want to use is in some different directory)

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:17 pm
by KoblerMan
Ok, I did that and it returned the entire config file. However, as you suggested might be the case, I didn't see /server at the end of the write data path.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:19 pm
by prg
So it might be an automatically generated one. Either find the file with your own values and specify that, or edit the file you're currently specifying to contain the values you want.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:27 pm
by KoblerMan
Alright. The issue was that I had the files that I was editing open while I was trying to run the server. All of the values are in order now, but when I open the server it appears to minimize or close immediately and I cannot connect to it with my client using my local IP OR my internet IP.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:31 pm
by prg
Anything interesting in the log file/output when running in a terminal?

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:35 pm
by KoblerMan
Here, have a look at it. Says something about "shutting down" in there but I don't know much about Factorio log files.

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:38 pm
by prg
Can't find the save game.

Code: Select all

Error MultiplayerManager.cpp:110: MultiplayerManager failed: "Opening zip C:/Users/Ryan/AppData/Roaming/Factorio/server/saves/World failed"

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:44 pm
by KoblerMan
Is there a way I can synchronize the two saves folders so that I don't have to drag and drop all the time?

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 5:54 pm
by KoblerMan
Awesome, I can connect with my local IP. Now I just need my friend to get on so they can test it too.

EDIT: Nope. "Following peers are not responding: Unknown username"

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 6:16 pm
by Bisa
KoblerMan wrote:EDIT: Nope. "Following peers are not responding: Unknown username"
If you want your friend to connect from outside (the internet) you need to setup port-forward/NAT correctly to the server in your router.
(+ for simplicity sake I suggest you start the server without the --peer-to-peer option if you happened to add that)

Re: Steam Dedicated Server

Posted: Fri Mar 18, 2016 6:17 pm
by Bisa
also, hop on irc, lotsa helpful people around that can help you real-time =)