mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-27 16:58:27 +00:00
Fix a couple of potential issues with player count checking
This commit is contained in:
parent
fd26375770
commit
63ded49b30
@ -949,7 +949,7 @@ doWarn(){
|
|||||||
doBroadcastWithEcho "$warnmsg"
|
doBroadcastWithEcho "$warnmsg"
|
||||||
for (( min = warnminutes - 1; min >= warninterval; min-- )); do
|
for (( min = warnminutes - 1; min >= warninterval; min-- )); do
|
||||||
numplayers=$(numPlayersConnected)
|
numplayers=$(numPlayersConnected)
|
||||||
if (( numplayers + 0 == 0 )); then
|
if (( (numplayers + 0) == 0 )); then
|
||||||
echo "Nobody is connected. Shutting down immediately"
|
echo "Nobody is connected. Shutting down immediately"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@ -976,7 +976,7 @@ doWarn(){
|
|||||||
doBroadcastWithEcho "$warnmsg"
|
doBroadcastWithEcho "$warnmsg"
|
||||||
if (( warnseconds >= 20 )); then
|
if (( warnseconds >= 20 )); then
|
||||||
numplayers=$(numPlayersConnected)
|
numplayers=$(numPlayersConnected)
|
||||||
if (( numplayers + 0 == 0 )); then
|
if (( (numplayers + 0) == 0 )); then
|
||||||
echo "Nobody is connected. Shutting down immediately"
|
echo "Nobody is connected. Shutting down immediately"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@ -1114,7 +1114,7 @@ doUpdate() {
|
|||||||
fi
|
fi
|
||||||
elif [ "$updatetype" == "ifempty" ]; then
|
elif [ "$updatetype" == "ifempty" ]; then
|
||||||
numplayers=$(( $(numPlayersConnected) + 0 ))
|
numplayers=$(( $(numPlayersConnected) + 0 ))
|
||||||
if (( numplayers == 0 )); then
|
if (( numplayers != 0 )); then
|
||||||
echo "${numplayers} players are still connected"
|
echo "${numplayers} players are still connected"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user