mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-28 01:08:27 +00:00
Fix numPlayersConnected to use getQueryPort
This commit is contained in:
parent
63ded49b30
commit
3eca9d3446
@ -581,7 +581,7 @@ function numPlayersConnected(){
|
|||||||
my ($servername, $mapname, $game, $fullname, $rest) = split(/\x00/, substr($data, 6), 5);
|
my ($servername, $mapname, $game, $fullname, $rest) = split(/\x00/, substr($data, 6), 5);
|
||||||
my $players = ord(substr($rest, 2, 1));
|
my $players = ord(substr($rest, 2, 1));
|
||||||
print "$players\n";
|
print "$players\n";
|
||||||
' "${ark_QueryPort}" "${ark_MultiHome:-127.0.0.1}"
|
' "$(getQueryPort)" "${ark_MultiHome:-127.0.0.1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -949,6 +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)
|
||||||
|
echo "There are ${numplayers} players connected"
|
||||||
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
|
||||||
@ -976,6 +977,7 @@ doWarn(){
|
|||||||
doBroadcastWithEcho "$warnmsg"
|
doBroadcastWithEcho "$warnmsg"
|
||||||
if (( warnseconds >= 20 )); then
|
if (( warnseconds >= 20 )); then
|
||||||
numplayers=$(numPlayersConnected)
|
numplayers=$(numPlayersConnected)
|
||||||
|
echo "There are ${numplayers} players connected"
|
||||||
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user