Commit fcfb1cd 1 parent beb3b4a commit fcfb1cd Copy full SHA for fcfb1cd
File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,20 @@ use_proxy() {
24
24
fi
25
25
}
26
26
27
+ use_server_list_ping () {
28
+ if versionLessThan 1.7; then
29
+ echo " --use-server-list-ping"
30
+ fi
31
+ }
32
+
27
33
mc_server_listening () {
28
- mc-monitor status $( use_proxy) --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " --timeout 10s >& /dev/null
34
+ mc-monitor status $( use_proxy) --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " $( use_server_list_ping ) --timeout 10s >& /dev/null
29
35
}
30
36
31
37
java_clients_connections () {
32
38
local connections
33
39
if java_running; then
34
- if ! connections=$( mc-monitor status $( use_proxy) --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " --show-player-count) ; then
40
+ if ! connections=$( mc-monitor status $( use_proxy) --host " ${SERVER_HOST:- localhost} " --port " $SERVER_PORT " $( use_server_list_ping ) --show-player-count) ; then
35
41
# consider it a non-zero player count if the ping fails
36
42
# otherwise a laggy server with players connected could get paused
37
43
connections=1
@@ -44,4 +50,4 @@ java_clients_connections() {
44
50
45
51
java_clients_connected () {
46
52
(( $(java_clients_connections) > 0 ))
47
- }
53
+ }
You can’t perform that action at this time.
0 commit comments