mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-19 05:28:29 +00:00
Merge pull request #1074 from MrSlimbrowser/preciseWarn
obey warn time even if no players are connected
This commit is contained in:
commit
9ee4e70e1d
@ -1776,17 +1776,19 @@ 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
|
||||||
numplayers=$(numPlayersConnected)
|
if [ "$arkprecisewarn" != "true" ]; then
|
||||||
echo "There are ${numplayers} players connected"
|
numplayers=$(numPlayersConnected)
|
||||||
if [[ "numplayers" == "-1" ]]; then
|
echo "There are ${numplayers} players connected"
|
||||||
echo "Server is not running. Shutting down immediately"
|
if [[ "numplayers" == "-1" ]]; then
|
||||||
notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}"
|
echo "Server is not running. Shutting down immediately"
|
||||||
return 0
|
notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}"
|
||||||
elif (( (numplayers + 0) == 0 )); then
|
return 0
|
||||||
doBroadcastWithEcho "Nobody is connected. Shutting down immediately"
|
elif (( (numplayers + 0) == 0 )); then
|
||||||
notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}"
|
doBroadcastWithEcho "Nobody is connected. Shutting down immediately"
|
||||||
rm -f "${arkserverroot}/${arkwarnlockfile}"
|
notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}"
|
||||||
return 0
|
rm -f "${arkserverroot}/${arkwarnlockfile}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if isUpdateCancelRequested; then
|
if isUpdateCancelRequested; then
|
||||||
doBroadcastWithEcho "Restart cancelled by player request"
|
doBroadcastWithEcho "Restart cancelled by player request"
|
||||||
@ -1821,17 +1823,19 @@ doWarn(){
|
|||||||
printWarnMessage "$1" "$2" "seconds" "$warnseconds" "$usenotify"
|
printWarnMessage "$1" "$2" "seconds" "$warnseconds" "$usenotify"
|
||||||
usenotify=
|
usenotify=
|
||||||
if (( warnseconds >= 20 )); then
|
if (( warnseconds >= 20 )); then
|
||||||
numplayers=$(numPlayersConnected)
|
if [ "$arkprecisewarn" != "true" ]; then
|
||||||
echo "There are ${numplayers} players connected"
|
numplayers=$(numPlayersConnected)
|
||||||
if [[ "numplayers" == "-1" ]]; then
|
echo "There are ${numplayers} players connected"
|
||||||
echo "Server is not running. Shutting down immediately"
|
if [[ "numplayers" == "-1" ]]; then
|
||||||
notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}"
|
echo "Server is not running. Shutting down immediately"
|
||||||
return 0
|
notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}"
|
||||||
elif (( (numplayers + 0) == 0 )); then
|
return 0
|
||||||
doBroadcastWithEcho "Nobody is connected. Shutting down immediately"
|
elif (( (numplayers + 0) == 0 )); then
|
||||||
notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}"
|
doBroadcastWithEcho "Nobody is connected. Shutting down immediately"
|
||||||
rm -f "${arkserverroot}/${arkwarnlockfile}"
|
notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}"
|
||||||
return 0
|
rm -f "${arkserverroot}/${arkwarnlockfile}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if isUpdateCancelRequested; then
|
if isUpdateCancelRequested; then
|
||||||
doBroadcastWithEcho "Restart cancelled by player request"
|
doBroadcastWithEcho "Restart cancelled by player request"
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user