Merge pull request #1074 from MrSlimbrowser/preciseWarn

obey warn time even if no players are connected
This commit is contained in:
Ben Peddell 2020-03-09 21:42:07 +10:00 committed by GitHub
commit 9ee4e70e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 22 deletions

View File

@ -1776,6 +1776,7 @@ doWarn(){
printWarnMessage "$1" "$2" "minutes" "$warnminutes" "$usenotify" printWarnMessage "$1" "$2" "minutes" "$warnminutes" "$usenotify"
usenotify= usenotify=
for (( min = warnminutes - 1; min >= warninterval; min-- )); do for (( min = warnminutes - 1; min >= warninterval; min-- )); do
if [ "$arkprecisewarn" != "true" ]; then
numplayers=$(numPlayersConnected) numplayers=$(numPlayersConnected)
echo "There are ${numplayers} players connected" echo "There are ${numplayers} players connected"
if [[ "numplayers" == "-1" ]]; then if [[ "numplayers" == "-1" ]]; then
@ -1788,6 +1789,7 @@ doWarn(){
rm -f "${arkserverroot}/${arkwarnlockfile}" rm -f "${arkserverroot}/${arkwarnlockfile}"
return 0 return 0
fi fi
fi
if isUpdateCancelRequested; then if isUpdateCancelRequested; then
doBroadcastWithEcho "Restart cancelled by player request" doBroadcastWithEcho "Restart cancelled by player request"
notify "${notifyMsgRestartCancelled:-Restart cancelled by player request}" notify "${notifyMsgRestartCancelled:-Restart cancelled by player request}"
@ -1821,6 +1823,7 @@ doWarn(){
printWarnMessage "$1" "$2" "seconds" "$warnseconds" "$usenotify" printWarnMessage "$1" "$2" "seconds" "$warnseconds" "$usenotify"
usenotify= usenotify=
if (( warnseconds >= 20 )); then if (( warnseconds >= 20 )); then
if [ "$arkprecisewarn" != "true" ]; then
numplayers=$(numPlayersConnected) numplayers=$(numPlayersConnected)
echo "There are ${numplayers} players connected" echo "There are ${numplayers} players connected"
if [[ "numplayers" == "-1" ]]; then if [[ "numplayers" == "-1" ]]; then
@ -1833,6 +1836,7 @@ doWarn(){
rm -f "${arkserverroot}/${arkwarnlockfile}" rm -f "${arkserverroot}/${arkwarnlockfile}"
return 0 return 0
fi fi
fi
if isUpdateCancelRequested; then if isUpdateCancelRequested; then
doBroadcastWithEcho "Restart cancelled by player request" doBroadcastWithEcho "Restart cancelled by player request"
notify "${notifyMsgRestartCancelled:-Restart cancelled by player request}" notify "${notifyMsgRestartCancelled:-Restart cancelled by player request}"

View File

@ -16,6 +16,7 @@ steamcmd_workshoplog="/home/steam/Steam/logs/workshop_log.txt" # Steam work
arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of ARK server executable arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of ARK server executable
arkbackupdir="/home/steam/ARK-Backups" # path to backup directory arkbackupdir="/home/steam/ARK-Backups" # path to backup directory
arkwarnminutes="60" # number of minutes to warn players when using update --warn arkwarnminutes="60" # number of minutes to warn players when using update --warn
arkprecisewarn="false" # set this to true to obey warnminutes even if no players are connected (recommended for clusters)
arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file
arkAutoUpdateOnStart="false" # set this to true if you want to always update before startup arkAutoUpdateOnStart="false" # set this to true if you want to always update before startup
arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating