Skip to content

Commit

Permalink
Add SERVER_PUBLIC status info to README and bring back old connected …
Browse files Browse the repository at this point in the history
…player detection
  • Loading branch information
lloesche committed Mar 9, 2021
1 parent 4e85220 commit 94178f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ RUN dpkg --add-architecture i386 \
libsdl2-2.0-0 \
libsdl2-2.0-0:i386 \
curl \
tcpdump \
libcurl4 \
libcurl4:i386 \
ca-certificates \
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp (1276)
| `SUPERVISOR_HTTP` | `false` | Turn on supervisor's http server on port `:9001` |
| `SUPERVISOR_HTTP_USER` | `admin` | Supervisor http server username |
| `SUPERVISOR_HTTP_PASS` | | Supervisor http server password. http server will not be started if password is not set! |
| `STATUS_HTTP` | `false` | Turn on the status http server on port |
| `STATUS_HTTP` | `false` | Turn on the status http server. Only useful on public servers (`SERVER_PUBLIC=true`). |
| `STATUS_HTTP_PORT` | `80` | Status http server tcp port |
| `STATUS_HTTP_CONF` | `/config/httpd.conf` | Path to the [busybox httpd config](https://git.busybox.net/busybox/tree/networking/httpd.c) |
| `STATUS_HTTP_HTDOCS` | `/opt/valheim/htdocs` | Path to the status httpd htdocs where `status.json` is written |
Expand Down Expand Up @@ -352,6 +352,8 @@ If Supervisor's http server is enabled it also provides an XML-RPC API at `/RPC2
If `STATUS_HTTP` is set to `true` the status web server will be started.
By default it runs on container port `80` but can be customized using `STATUS_HTTP_PORT`.

This only works for public Valheim servers (`SERVER_PUBLIC=true`) because private ones do not answer to [Steam server queries](https://developer.valvesoftware.com/wiki/Server_queries).

A `/status.json` will be updated every 10 seconds.

Whenever Valheim server is not yet running the status will contain an error like
Expand Down Expand Up @@ -405,7 +407,7 @@ A few modifications, like for example changing the `dataRate` can be done server
## Updates
ValheimPlus is automatically being updated using the same `UPDATE_CRON` schedule the Valheim server uses to check for updates. If an update of either
Valheim server or ValheimPlus is found it is being downloaded, configured and the server automatically restarted.
This also means your clients always need to run the latest ValheimPlus version or won't be able to connect. If this is undesired the schedule could be changed to only check for updates once per day. Example `UPDATE_CRON='0 6 * * *'` would only check at 6 AM.
This also means your clients always need to run the latest ValheimPlus version or will not be able to connect. If this is undesired the schedule could be changed to only check for updates once per day. Example `UPDATE_CRON='0 6 * * *'` would only check at 6 AM.

## Configuration
See [ValheimPlus config from Environment Variables](#valheimplus-config-from-environment-variables)
Expand Down
10 changes: 9 additions & 1 deletion common
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ ensure_permissions() {


server_is_idle() {
"$cmd_valheim_status" > /dev/null 2>&1
if [ "$SERVER_PUBLIC" = 1 ]; then
"$cmd_valheim_status" > /dev/null 2>&1
else
if timeout 3 tcpdump udp port "$SERVER_PORT" -n -s 84 -c 1 > /dev/null 2>&1; then
return 1
else
return 0
fi
fi
}


Expand Down

0 comments on commit 94178f7

Please sign in to comment.