From 3c953ed5703c83e4ea34cb9b291a3aa3c47569d9 Mon Sep 17 00:00:00 2001 From: scott Date: Sat, 30 May 2020 03:44:22 +0900 Subject: [PATCH] feature/memoriesofmars install config and info_config for command details added --- lgsm/functions/info_config.sh | 20 ++++++++++++++++++++ lgsm/functions/install_config.sh | 7 +++++++ 2 files changed, 27 insertions(+) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 743c657e0..79179f4ea 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -457,6 +457,23 @@ fn_info_config_minecraft_bedrock(){ fi } +fn_info_config_mofm(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "Server Name:" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Server Password:" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers:" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + fn_info_config_onset(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1511,6 +1528,9 @@ elif [ "${shortname}" == "kf2" ]; then # Medal of Honor: Allied Assault elif [ "${shortname}" == "mohaa" ]; then fn_info_config_mohaa +# Memories of Mars +elif [ "${shortname}" == "mofm" ]; then + fn_info_config_mofm # QuakeWorld elif [ "${shortname}" == "qw" ]; then fn_info_config_quakeworld diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index ced111afb..d8f669e29 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -563,6 +563,13 @@ elif [ "${shortname}" == "mta" ]; then fn_fetch_default_config fn_default_config_remote fn_list_config_locations +elif [ "${shotname}" == "mofm"];then + gamedirname="MemoriesofMars" + array_configs+=( DedicatedServerConfig.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "mumble" ]; then gamedirname="Mumble" array_configs+=( murmur.ini )