1
0
mirror of https://github.com/games-on-k8s/docker-factorio.git synced 2024-11-16 17:42:04 +02:00

Correctly update the visibility directives and README.

This commit is contained in:
Greg Taylor 2016-10-26 00:24:17 -07:00
parent f96be2cf21
commit 17d45bb1c2
2 changed files with 21 additions and 6 deletions

View File

@ -27,8 +27,9 @@ This Docker image uses environment variables to configure the Factorio server. T
| **FACTORIO_SERVER_NAME** | The name to show in-game and in the server browser (if public).
| **FACTORIO_DESCRIPTION** | Server description for the server browser (if public).
| **FACTORIO_MAX_PLAYERS** | Maximum number of players allowed, admins can join even a full server. 0 means unlimited.
| FACTORIO_VISIBILITY | One of `public` (published on Factorio match-making server, `lan` broadcast on LAN, `hidden` not shown anywhere. Default is `hidden`.
| FACTORIO_USER_USERNAME | If visibility is public, a Factorio username to auth the server with.
| FACTORIO_PUBLISH_ON_LAN | If `true`, make this game available on the server's LAN. Defaults to `true`.
| FACTORIO_IS_PUBLIC | If `true`, advertise this server on the Factorio game browser. You'll also need to set FACTORIO_USER_USERNAME and FACTORIO_USER_PASSWORD. Defaults to `false`.
| FACTORIO_USER_USERNAME | If this server is public, a Factorio username to auth the server with.
| FACTORIO_USER_PASSWORD | The Factorio user's matching password.
| FACTORIO_GAME_PASSWORD | If set, this password will be required to join.
| FACTORIO_REQUIRE_USER_VERIFICATION | When set to true, the server will only allow clients that have a valid Factorio.com account

View File

@ -14,9 +14,17 @@ CONFIGS = {
'evar': 'FACTORIO_MAX_PLAYERS',
'default': 0,
},
'visibility': {
'evar': 'FACTORIO_VISIBILITY',
'default': 'lan',
# Hack workaround for visibility being a JSON dict in the config.
'public': {
'nest_under': 'visibility',
'evar': 'FACTORIO_IS_PUBLIC',
'default': 'false',
},
# Ditto.
'lan': {
'nest_under': 'visibility',
'evar': 'FACTORIO_PUBLISH_ON_LAN',
'default': 'true',
},
'username': {
'evar': 'FACTORIO_USER_USERNAME',
@ -96,7 +104,13 @@ def get_and_validate_vals():
elif conf_type == 'list':
conf_value = conf_value.split()
conf[conf_name] = conf_value
if 'nest_under' in conf_details:
nest_under = conf_details['nest_under']
if nest_under not in conf:
conf[nest_under] = {}
conf[nest_under][conf_name] = conf_value
else:
conf[conf_name] = conf_value
return conf