From 1bd787e04862ab2989f69c20072356030b201a16 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 12 Jun 2018 19:34:02 +0100 Subject: [PATCH] Updated eco info --- .../config-lgsm/ecoserver/_default.cfg | 4 +-- lgsm/functions/info_config.sh | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index 6d5f3fb27..df24e6ca3 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -91,8 +91,8 @@ engine="unity3d" ## Server Specific Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="mono ${serverfiles}/EcoServer.exe" -# TODO: Add config stuff +executable="mono ./EcoServer.exe" +servercfgdir="${systemdir}/Configs/" ## Backup Directory backupdir="${rootdir}/backups" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index bacd0fbb3..e3af1dd00 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -252,6 +252,34 @@ fn_info_config_dontstarve(){ fi } +fn_info_config_eco(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + gamemode="${unavailable}" + tickrate="${zero}" + port="${zero}" + webadminport="${zero}" + public="" + else + servername=$(grep "Description" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "\"MaxConnections\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') + port=$(grep "\"GameServerPort\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') + webadminport=$(grep "\"WebServerPort\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') + public=$(grep "PublicServer" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + webadminport=${webadminport=:-"0"} + public=${public=:-"NOT SET"} + fi +} + fn_info_config_factorio(){ if [ ! -f "${servercfgfullpath}" ]; then servername="Factorio Server" @@ -1020,6 +1048,9 @@ elif [ "${gamename}" == "Call of Duty: World at War" ]; then # Dont Starve Together elif [ "${engine}" == "dontstarve" ]; then fn_info_config_dontstarve +# Eco +elif [ "${shortname}" == "eco" ]; then + fn_info_config_eco # Factorio elif [ "${gamename}" == "Factorio" ]; then fn_info_config_factorio