Skip to content

Commit

Permalink
Added for local testing, fixed #224 expansion-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jammsen committed Feb 23, 2024
1 parent 5f45271 commit b44719c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## 2024-02-23

- Added new SERVER_SETTINGS_MODE called "rcononly" this will only setup up RCON, everything else is still manually to set (#221)
- Added RESTART_DEBUG_OVERRIDE for local testing

## 2024-02-22

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
BACKUP_RETENTION_AMOUNT_TO_KEEP=72 \
# Restart-settings
RESTART_ENABLED=false \
RESTART_DEBUG_OVERRIDE=false \
RESTART_CRON_EXPRESSION="0 18 * * *" \
# RCON-Playerdection - NEEDS RCON ENABLED!
RCON_PLAYER_DETECTION=true \
Expand Down
1 change: 1 addition & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BACKUP_RETENTION_POLICY=true
BACKUP_RETENTION_AMOUNT_TO_KEEP=72
# Restart-settings
RESTART_ENABLED=false
RESTART_DEBUG_OVERRIDE=false
RESTART_CRON_EXPRESSION="0 18 * * *"
# RCON-Playerdection - NEEDS RCON ENABLED!
RCON_PLAYER_DETECTION=true
Expand Down
3 changes: 2 additions & 1 deletion docs/ENV_VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ These settings control the behavior of the Docker container:
| BACKUP_RETENTION_POLICY | Set to enabled, will cleanup old backups | true | Boolean |
| BACKUP_RETENTION_AMOUNT_TO_KEEP | Defines how many backups in numbers to keep | 72 | Integer |
| RESTART_ENABLED | Automatic restarts the server | false | Boolean |
| RESTART_DEBUG_OVERRIDE | Automatic restarts down to 15 seconds instead of 15 minutes | false | Boolean |
| RESTART_CRON_EXPRESSION | Needs a Cron-Expression - See [Cron expression](#cron-expression) | 0 3,15 * * * | Cron-Expression |
| RCON_PLAYER_DETECTION | Set to enabled will send player join and leaves to console, rcon and webhooks, NEEDS `RCON_ENABLED` | true | Boolean |
| RCON_PLAYER_DETECTION_STARTUP_DELAY | Initial delay for start checking for players, consider steam-updates and server start up in seconds | 60 | Integer |
| RCON_PLAYER_DETECTION_CHECK_INTERVAL | Interval in seconds to wait for next check in the infinite loop | 15 | Integer |
| RCON_PLAYER_DETECTION_CHECK_INTERVAL | Interval in seconds to wait for next check in the infinite loop | 15 | Integer |
| WEBHOOK_ENABLED | Set to enabled will send webhook notifications, NEEDS `WEBHOOK_URL` | false | Boolean |
| WEBHOOK_DEBUG_ENABLED | Set to enabled will enable feedback of curl and not use --silent | false | Boolean |
| WEBHOOK_URL | Defines the url the webhook to send data to | | Url |
Expand Down
4 changes: 2 additions & 2 deletions includes/playerdetection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ announce_join() {
send_player_join_notification "$message"
fi
if [[ -n $RCON_ENABLED ]] && [[ $RCON_ENABLED == "true" ]]; then
broadcast_player_join "$1"
broadcast_player_join "${1// /\-}"
fi
}

Expand All @@ -65,6 +65,6 @@ announce_leave() {
send_player_leave_notification "$message"
fi
if [[ -n $RCON_ENABLED ]] && [[ $RCON_ENABLED == "true" ]]; then
broadcast_player_leave "$1"
broadcast_player_leave "${1// /\-}"
fi
}
6 changes: 5 additions & 1 deletion scripts/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ function schedule_restart() {
time=$(date '+%H:%M:%S')
rconcli "broadcast ${time}-AUTOMATIC-RESTART-IN-$counter-MINUTES"
fi
sleep 60
if [[ -n $RESTART_DEBUG_OVERRIDE ]] && [[ $RESTART_DEBUG_OVERRIDE == "true" ]]; then
sleep 1
else
sleep 60
fi
done

if [[ -n $RCON_ENABLED ]] && [[ $RCON_ENABLED == "true" ]]; then
Expand Down

0 comments on commit b44719c

Please sign in to comment.