Page 1 of 1

Cannot get windows server to work.

Posted: Sat May 06, 2017 4:39 am
by Khameleon21
Hi there,

New to Factorio (only have 100 hrs in so far). I have been trying all night to setup a windows based server. I can get the server to run without pointing the batch file to a server-settings file. Whenever I put in a link to the server settings i get a crash.
Press any key to continue . . .
0.001 2017-05-06 00:32:47; Factorio 0.15.9 (build 29504, win64, steam)
0.001 Operating system: Windows 10 (version 1607)
0.001 Program arguments: "factorio.exe" "--start-server" "C:\Users\Adam\AppData\Roaming\Factorio\saves\ MP.zip" "--server-settings" "server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data""
0.001 Read data path: D:/Steam/SteamApps/common/Factorio/data
0.001 Write data path: C:/Users/Adam/AppData/Roaming/Factorio
0.001 Binaries path: D:/Steam/SteamApps/common/Factorio/bin
0.008 System info: [CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 8 cores, RAM: 16321MB]
0.008 Running in headless mode
0.013 Loading mod core 0.0.0 (data.lua)
0.018 Loading mod base 0.15.9 (data.lua)
0.117 Loading mod base 0.15.9 (data-updates.lua)
0.179 Checksum for core: 3409166051
0.180 Checksum of base: 3769930138
0.291 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1494044520
0.291 Info PlayerData.cpp:62: Cloud player-data.json unavailable
0.293 Custom inputs active: 0
0.298 Factorio initialised
0.299 Info ServerMultiplayerManager.cpp:139: Quitting multiplayer connection.
0.299 Info ServerMultiplayerManager.cpp:663: mapTick(-1) changing state from(Ready) to(Closed)
0.317 Goodbye
0.000 Error Util.cpp:58: Error when opening server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data" for reading: Invalid argument
Here is a copy of my server file. It was a direct copy from the sample, but in attempts to get this working I have cleaned out stuff I wasn't using. The error is exactly the same.
{
"name": "Khameleon21",
"description": "My Game",
"tags": ["tag1", "tag2"],
"max_players": "4",

"visibility": "public",

"username": "Khameleon21",
"password": "Something",


"game_password": "test",

"verify_user_identity": "true",
}
The example I found in the forum had no "" or a , on the true statement on the verify user identity. I have tried it both ways.

Here is my server batch file.
@echo off
::==============================================================================================================
:: Replace the appropriate entries below to suit your installation (Default install example shown) ::==============================================================================================================
set FactorioExeLocation=D:\STEAM\STEAMAPPS\COMMON\Factorio\bin\x64\
set SaveFileName=MP.zip
set SaveLocation=C:\Users\Adam\AppData\Roaming\Factorio\saves\
set ServerSettingsFileName=server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data\
::==============================================================================================================
cd %FactorioExeLocation%
echo.
echo.
echo PREPARING TO LAUNCH FACTORIO SERVER...
echo.
echo Save to be loaded:
echo %SaveLocation%%SaveFileName%
echo.
echo Server Settings to load:
echo %ServerSettingsLocation%%ServerSettingsFileName%
echo.
echo.
echo *** Remember to use Ctrl+C to ensure saving when finished instead of simply closing this window ***
echo.
echo.
pause 3
::==============================================================================================================
:: ***NOTE: The line below launches factorio in headless mode with desired server settings, add any other
:: desired arguments to end of the line. Use "factorio.exe --help" for a list of all supported arguments.
::==============================================================================================================
factorio.exe --start-server "%SaveLocation%%SaveFileName%" --server-settings "%ServerSettingsLocation%%ServerSettingsFileName%"
pause 3
It will work if I comment out the server settings.

I am using 15.9. I have also tried this a stand alone download of the game from this site, and always the same error.

Any help would be greatly appreciated..

Thanks in advanced

Re: Cannot get windows server to work.

Posted: Sun May 07, 2017 2:07 pm
by daniel34
Khameleon21 wrote:

Code: Select all

  "visibility": "public",
Visibility should be defined like this (changed sometime in 0.14.x):

Code: Select all

  "visibility":
  {
    "public": true,
    "lan": true
  },

Re: Cannot get windows server to work.

Posted: Mon May 08, 2017 1:48 am
by Khameleon21
I am not at home for right now, will try it tomorrow. \\

Thank you very much for helping

Re: Cannot get windows server to work.

Posted: Mon May 08, 2017 11:10 pm
by Khameleon21
Did what you said and exact same error.
{
"name": "Khameleon21",
"description": "My Game",
"tags": ["tag1", "tag2"],
"max_players": "4",

"visibility":
{
"public": true,
"lan": true
}
"username": "Khameleon",
"password": "test",


"game_password": "password",

"verify_user_identity": true
}
Any other thoughts?

Re: Cannot get windows server to work.

Posted: Tue May 09, 2017 4:33 pm
by prg
Put a comma after the closing curly brace of the "visibility" block.

Re: Cannot get windows server to work.

Posted: Tue May 09, 2017 8:37 pm
by Khameleon21
Wish I could say it work, but no joy! does anyone have a working one with a current version they could share?

Here is the lastest attempt.
{
"name": "Khameleon21",
"description": "My Game",
"tags": ["tag1", "tag2"],
"max_players": "4",

"visibility":
{
"public": true,
"lan": true
},
"username": "Khameleon",
"password": "test",


"game_password": test",

"verify_user_identity": true
}

Re: Cannot get windows server to work.

Posted: Tue May 09, 2017 8:40 pm
by prg
"game_password": test",
Now there's a double quote missing...

Re: Cannot get windows server to work.

Posted: Wed May 10, 2017 3:37 pm
by Khameleon21
Sorry that was my fault, I erased the password i was using and put test for the post The original did have the password in quotes,

Re: Cannot get windows server to work.

Posted: Wed May 10, 2017 5:14 pm
by prg
Okay, just read your first post again.
0.001 Program arguments: "factorio.exe" "--start-server" "C:\Users\Adam\AppData\Roaming\Factorio\saves\ MP.zip" "--server-settings" "server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data""
The thing after "--server-settings" should probably just be something like "D:\Steam\SteamApps\common\Factorio\data\server-settings.json" or wherever you put that file.

Re: Cannot get windows server to work.

Posted: Wed May 10, 2017 7:21 pm
by Khameleon21
Thanks so much! I just took out the set commands and after server settings I put the actual location and file name instead of the %ServerSettingsLocation%%ServerSettingsFileName%..

Thanks again!

Re: Cannot get windows server to work.

Posted: Thu May 11, 2017 10:41 pm
by noliVe
spaces in mapname or inside wont work too. keep that in mind

Re: Cannot get windows server to work.

Posted: Fri May 12, 2017 5:32 pm
by prg
Spaces in file names work fine if they are properly quoted or escaped. You just need to pass the actual file name instead of some gibberish.

Re: Cannot get windows server to work.

Posted: Sun Mar 04, 2018 4:15 am
by kynelongtail
I'm having a problem getting my server going again. giving me an 'invalid arguement' error with the server settings command line.

This is my serverstart.bat

Code: Select all

 start /wait Factorio.exe --start-server C:\Users\Dyne\AppData\Roaming\Factorio\saves\server.zip --server-settings E:\Steam\steamapps\common\Factorio\data\server.json\ --no-log-rotation
and the error itself

Code: Select all

Error when opening E:\Steam\Steamapps\common\Factorio\data\server.json for reading: invalid arguement
can anyone help?

Re: Cannot get windows server to work.

Posted: Sun Mar 04, 2018 4:47 am
by Loewchen
Make a new topic in technical help please.