From ba7c795b513bc8b2a99ef18f18a1d8ff24b2681a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 01:18:23 +0100 Subject: [PATCH] fix: repair Starbound details This commit updates the info_game.sh file by changing the servercfgfullpath variable to servercfgparse in line 96. It also modifies the fn_info_game_sb function to check if the server config file exists before parsing it, and changes the JSON keys in lines 1828-1836 from camelCase to dot notation. --- lgsm/modules/info_game.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 4039d9b74d..d2714ec3ef 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -93,7 +93,7 @@ fn_info_game_json() { else servercfgparse="${servercfgfullpath}" fi - eval "${1}=\"$(jq -r "${2}" "${servercfgfullpath}")\"" + eval "${1}=\"$(jq -r "${2}" "${servercfgparse}")\"" configtype="json" } @@ -1826,15 +1826,15 @@ fn_info_game_samp() { # Parameters: false # Comment: // or /* */ fn_info_game_sb() { - if [ ! -f "${servercfgfullpath}" ]; then - fn_info_game_json "maxplayers" "maxPlayers" - fn_info_game_json "port" "gameServerPort" - fn_info_game_json "queryenabled" "runQueryServer" - fn_info_game_json "queryport" "queryServerPort" - fn_info_game_json "rconenabled" "runRconServer" - fn_info_game_json "rconpassword" "rconServerPassword" - fn_info_game_json "rconport" "rconServerPort" - fn_info_game_json "servername" "serverName" + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".maxPlayers" + fn_info_game_json "port" ".gameServerPort" + fn_info_game_json "queryenabled" ".runQueryServer" + fn_info_game_json "queryport" ".queryServerPort" + fn_info_game_json "rconenabled" ".runRconServer" + fn_info_game_json "rconpassword" ".rconServerPassword" + fn_info_game_json "rconport" ".rconServerPort" + fn_info_game_json "servername" ".serverName" fi maxplayers="${maxplayers:-"0"}" port="${port:-"0"}"