Browse Source

Merge branch 'develop' into feature/bfv

pull/2909/head
Daniel Gibbs 5 years ago
parent
commit
be2eea0c0b
  1. 2
      lgsm/functions/fix_av.sh
  2. 2
      lgsm/functions/info_messages.sh
  3. 11
      lgsm/functions/query_gamedig.sh

2
lgsm/functions/fix_av.sh

@ -10,7 +10,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"
if [ "${postinstall}" == "1" ]; then if [ "${postinstall}" == "1" ]; then
fn_parms(){ fn_parms(){
parms="--datapath ${avdatapath} --galaxy-name ${avgalaxy} --init-folders-only" parms="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only"
} }
fn_print_information "starting ${gamename} server to generate configs." fn_print_information "starting ${gamename} server to generate configs."

2
lgsm/functions/info_messages.sh

@ -1472,7 +1472,7 @@ fn_info_message_select_engine(){
fn_info_message_sof2 fn_info_message_sof2
elif [ "${shortname}" == "sol" ]; then elif [ "${shortname}" == "sol" ]; then
fn_info_message_soldat fn_info_message_soldat
elif [ "${shortname}" == "st" ]; then elif [ "${shortname}" == "sb" ]; then
fn_info_message_starbound fn_info_message_starbound
elif [ "${shortname}" == "sbots" ]; then elif [ "${shortname}" == "sbots" ]; then
fn_info_message_sbots fn_info_message_sbots

11
lgsm/functions/query_gamedig.sh

@ -22,7 +22,6 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${ip}\" --port \"${queryport}\"|jq") gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${ip}\" --port \"${queryport}\"|jq")
gamedigraw=$(gamedig --type "${querytype}" --host "${ip}" --port "${queryport}") gamedigraw=$(gamedig --type "${querytype}" --host "${ip}" --port "${queryport}")
querystatus=$(echo "${gamedigraw}" | jq '.error|length') querystatus=$(echo "${gamedigraw}" | jq '.error|length')
fi fi
# server name. # server name.
@ -32,10 +31,14 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
fi fi
# numplayers. # numplayers.
gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.vanilla.raw.players.online') if [ "${querytype}" == "minecraft" ]; then
gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1')
else
gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length')
fi
if [ "${gdplayers}" == "null" ]; then if [ "${gdplayers}" == "null" ]; then
unset gdplayers unset gdplayers
elif [ "${gdplayers}" == "[]" ]; then elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then
gdplayers=0 gdplayers=0
fi fi
@ -60,7 +63,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
fi fi
# numbots. # numbots.
gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots') gdbots=$(echo "${gamedigraw}" | jq -re '.bots | length')
if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then
unset gdbots unset gdbots
fi fi

Loading…
Cancel
Save