Skip to content

Commit

Permalink
fix: repair Starbound details
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dgibbs64 committed May 29, 2023
1 parent 19dc1fb commit ba7c795
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lgsm/modules/info_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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"}"
Expand Down

0 comments on commit ba7c795

Please sign in to comment.