diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index a04dd1ac7..fd7ea988e 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -377,15 +377,24 @@ fn_info_config_factorio(){ servername="Factorio Server" serverpassword="${unavailable}" maxplayers="${zero}" + authtoken=${authtoken:-"NOT SET"} + savegameinterval="${unavailable}" + versioncount="${unavailable}" else - servername="Factorio Server" - serverpassword=$(grep "game_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "\"max_players\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + servername=$(jq -r '.name' "${servercfgfullpath}") + serverpassword=$(jq -r '.game_password' "${servercfgfullpath}") + maxplayers=$(jq -r '.max_players' "${servercfgfullpath}") + authtoken=$(jq -r '.token' "${servercfgfullpath}") + savegameinterval=$(jq -r '.autosave_interval' "${servercfgfullpath}") + versioncount=$(jq -r '.autosave_slots' "${servercfgfullpath}") # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} + maxplayers=${maxplayers:-"0"} + authtoken=${authtoken:-"NOT SET"} + savegameinterval=${savegameinterval:-"0"} + versioncount=${versioncount:-"0"} fi } diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 862673be4..a7d6a1261 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -382,6 +382,21 @@ fn_info_message_gameserver(){ echo -e "${lightblue}Server Version:\t${default}${serverversion}" fi + # authentication token (Factorio) + if [ -n "${authtoken}" ]; then + echo -e "${lightblue}Auth Token:\t${default}${authtoken}" + fi + + # savegameinterval (Factorio) + if [ -n "${savegameinterval}" ]; then + echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}" + fi + + # versioncount (Factorio) + if [ -n "${versioncount}" ]; then + echo -e "${lightblue}Version Count:\t${default}${versioncount}" + fi + # Listed on Master server if [ -n "${displaymasterserver}" ]; then if [ "${displaymasterserver}" == "true" ]; then