From 23301a31d369d2b51798f0fb7580e3684fdbbd19 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 May 2016 17:43:38 +0100 Subject: [PATCH] improved Terraria support --- lgsm/functions/info_config.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 049161e13..3144a9aa9 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -210,12 +210,21 @@ fn_info_config_teeworlds(){ fn_info_config_terraria(){ if [ ! -f "${servercfgfullpath}" ]; then - port="0" - else + servername="${unavailable}" + port="${zero}" + gameworld="${unavailable}" + slots="${zero}" + else + servername=$(grep "worldname=" "${servercfgfullpath}" | sed 's/worldname=//g') port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + gameworld=$(grep "world=" "${servercfgfullpath}" | sed 's/world=//g') + slots=$(grep "maxplayers=" "${servercfgfullpath}" | sed 's/maxplayers=//g') - # Not Set + # Not Set + servername=${servername:-"NOT SET"} port=${port:-"0"} + gameworld=${gameworld:-"NOT SET"} + slots=${slots:-"0"} fi } @@ -285,6 +294,7 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then # Teeworlds elif [ "${engine}" == "teeworlds" ]; then fn_info_config_teeworlds +# Terraria elif [ "${engine}" == "terraria" ]; then fn_info_config_terraria # Unreal/Unreal 2 engine