Page 1 of 1

Problem with server-settings.json

Posted: Tue Jul 26, 2016 7:39 pm
by xxh9
I don't have a problem when not specifying a server-settings.json file.

Code: Select all

factorio@localhost:/opt/factorio/bin/x64$ ./factorio --start-server my-save.zip
Runs and starts up no problem.

But when I specify a server-settings.json file, I get an issue with formatting. And yes I realize i put the server password in the plaintext here.

Code: Select all

factorio@localhost:/opt/factorio/bin/x64$ ./factorio --start-server my-save.zip --config /opt/factorio/data/server-settings.json
   0.000  Error GlobalContext.cpp:639: /opt/factorio/data/server-settings.json: Bad file format; ignoring
   0.000  Error Util.cpp:58: There is no package core in /usr/share/factorio
factorio@localhost:/opt/factorio/bin/x64$ cat /opt/factorio/data/server-settings.json
{
  "name": "supercool game",
  "description": "for coolkids",
  "max_players": "4",
  "visibility": "hidden",
  "username": "",
  "password": "",
  "token": "",
  "game_password": "cracktorio123",
  "verify_user_identity": false
}
factorio@localhost:/opt/factorio/bin/x64$
Anyone have any idea?

Re: Problem with server-settings.json

Posted: Tue Jul 26, 2016 7:47 pm
by kinnom
I'm no expert at all, but have you tried replacing : with =

Re: Problem with server-settings.json

Posted: Tue Jul 26, 2016 8:02 pm
by xxh9
Changing the : to = didn't seem to help. Thanks for the suggestion though!

Re: Problem with server-settings.json

Posted: Wed Jul 27, 2016 4:29 pm
by Megapants
The JSON format appears to be correct, but you're missing a few definitions.

Here's the default file:

Code: Select all

  "name": "Name of the game as it will appear in the game listing",
  "description": "Description of the game that will appear in the listing",
  "tags": ["game", "tags"],
  "max_players": "0",

  "_comment_visibility": ["public: Game will be published on the official Factorio matching server",
                          "lan: Game will be broadcast on LAN",
                          "hidden: Game will not be published anywhere"],
  "visibility": "public",

  "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
  "username": "",
  "password": "",

  "_comment_token": "Authentication token. May be used instead of 'password' above.",
  "token": "",

  "game_password": "",

  "_comment_verify_user_identity": "When set to true, the server will only allow clients that have a valid Factorio.com account",
  "verify_user_identity": true
}
Keep the same format and don't remove anything. Just fill in or change the values that you need to.