mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Simplified connected players code.
Removed the ability to display a "No players are connected" message, as support is currently not complete.
This commit is contained in:
13
init/msm
13
init/msm
@ -1030,15 +1030,14 @@ server_connected() {
|
|||||||
if server_is_running "$1"; then
|
if server_is_running "$1"; then
|
||||||
local line="$(server_eval_and_get_line "$1" "list" "Connected players:")"
|
local line="$(server_eval_and_get_line "$1" "list" "Connected players:")"
|
||||||
|
|
||||||
# Cuts the start off the line, and the last three (invisible)
|
# Cuts the start off the line
|
||||||
# characters from the end.
|
|
||||||
local players="${line:46}"
|
local players="${line:46}"
|
||||||
|
|
||||||
if [ -z "$players" ]; then
|
# TODO: Use a reliable method of detecting when no players are online,
|
||||||
echo "No players are connected."
|
# and display a different message.
|
||||||
else
|
# This is currently hard as invisible characters make string length
|
||||||
echo "$players"
|
# always non-zero, and also may be ommitted.
|
||||||
fi
|
echo "$players"
|
||||||
else
|
else
|
||||||
echo "Server \"${SERVER_NAME[$1]}\" is not running. No users are connected."
|
echo "Server \"${SERVER_NAME[$1]}\" is not running. No users are connected."
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user