Browse Source

fix bug

pull/4200/head
Daniel Gibbs 2 years ago
parent
commit
825dc15d4b
  1. 18
      lgsm/modules/info_game.sh

18
lgsm/modules/info_game.sh

@ -28,7 +28,7 @@ fn_info_game_ini() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')" eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="ini" configtype="ini"
} }
@ -52,7 +52,7 @@ fn_info_game_keyvalue_pairs() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')" eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="keyvalue_pairs" configtype="keyvalue_pairs"
} }
@ -75,7 +75,7 @@ fn_info_game_quakec() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(sed -n '/^[[:space:]]*\<'"${2}"'\>/ { s/.* *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgfullpath}") | tr -d '\r')" eval "${1}=\"$(sed -n '/^[[:space:]]*\<'"${2}"'\>/ { s/.* *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="quakec" configtype="quakec"
} }
@ -85,7 +85,7 @@ fn_info_game_json() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(jq -r '${2}' "${servercfgfullpath}")" eval "${1}=\"$(jq -r "${2}" "${servercfgfullpath}")\""
configtype="json" configtype="json"
} }
@ -109,7 +109,7 @@ fn_info_game_sqf() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgfullpath}") | tr -d '\r')" eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="sqf" configtype="sqf"
} }
@ -143,7 +143,7 @@ fn_info_game_valve_keyvalues() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')" eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="valve_keyvalues" configtype="valve_keyvalues"
} }
@ -166,7 +166,7 @@ fn_info_game_java_properties() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgfullpath}") | tr -d '\r')" eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="java" configtype="java"
} }
@ -187,7 +187,7 @@ fn_info_game_lua() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}=\"$(sed -n '/^[[:space:]]*\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s#,.*##;p;q }' "${servercfgfullpath}" | tr -d '\r')" eval "${1}=\"$(sed -n '/^[[:space:]]*\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s#,.*##;p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="lua" configtype="lua"
} }
@ -209,7 +209,7 @@ fn_info_game_pc_config() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*: *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgfullpath}" | tr -d '\r')" eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*: *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgfullpath}" | tr -d '\r')\""
configtype="pc_config" configtype="pc_config"
} }

Loading…
Cancel
Save