From 6087cbd46fc8f10c9920f6899c003dde420322c6 Mon Sep 17 00:00:00 2001 From: Bryce Van Dyk Date: Wed, 14 Oct 2015 20:55:39 +1300 Subject: [PATCH] Update details for teeworlds --- Teeworlds/twserver | 2 +- functions/fn_details | 52 +++++++++++++++++++++++++++++-------- functions/fn_details_config | 12 ++++++++- 3 files changed, 53 insertions(+), 13 deletions(-) diff --git a/Teeworlds/twserver b/Teeworlds/twserver index b78a93f62..b8b0e3dba 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributor: Bryce Van Dyk (SingingTree) # Website: http://gameservermanagers.com -version="071015" +version="141015" #### Variables #### diff --git a/functions/fn_details b/functions/fn_details index 3463272a2..b240af2a5 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -497,7 +497,36 @@ fn_details_statusbottom } -fn_details_terraria(){ +fn_details_teamspeak3(){ +fn_details_config +fn_details_distro +fn_details_os +fn_details_performance +fn_details_disk +fn_details_gameserver +fn_details_backup +fn_details_commandlineparms +echo -e "" +echo -e "\e[92mPorts\e[0m" +printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = +echo -e "Change ports by editing the parameters in" +echo -e "${servercfgfullpath}." +echo -e "" +echo -e "Useful port diagnostic command:" +echo -e "netstat -atunp | grep ts3server" +echo -e "" +{ + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Voice\tINBOUND\t${port}\tudp" + echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" + echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports +fn_details_statusbottom +} + +fn_details_teeworlds(){ fn_check_ip fn_parms fn_details_config @@ -520,16 +549,15 @@ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" } >> .fn_details_ports column -s $'\t' -t .fn_details_ports rm -f .fn_details_ports fn_details_statusbottom - } -fn_details_teamspeak3(){ +fn_details_terraria(){ +fn_check_ip +fn_parms fn_details_config fn_details_distro fn_details_os @@ -541,17 +569,17 @@ fn_details_commandlineparms echo -e "" echo -e "\e[92mPorts\e[0m" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." +echo -e "Change ports by editing the command-line" +echo -e "parameters in ${servercfgfullpath}." echo -e "" echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep ts3server" +echo -e "netstat -atunp | grep terraia" echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" - echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" + echo -e "> Game\tINBOUND\t${port}\ttcp" + echo -e "> Query\tINBOUND\t${queryport}\ttcp" + echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" } >> .fn_details_ports column -s $'\t' -t .fn_details_ports rm -f .fn_details_ports @@ -735,6 +763,8 @@ elif [ "${engine}" == "spark" ]; then fn_details_spark elif [ "${engine}" == "starbound" ]; then fn_details_starbound +elif [ "${engine}" == "teeworlds" ]; then + fn_details_teeworlds elif [ "${engine}" == "terraria" ]; then fn_details_terraria elif [ "${engine}" == "unity3d" ]; then diff --git a/functions/fn_details_config b/functions/fn_details_config index c85ea2316..1948b5196 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -382,6 +382,16 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then fileport="30033" fi +elif [ "${gamename}" == "Teeworlds" ]; then + + # port + if [ -f "${servercfgfullpath}" ]; then + port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd "[:digit:]") + fi + if [ ! -n "${port}" ]; then + port="0" + fi + elif [ "${engine}" == "unity3d" ]; then # server name @@ -502,7 +512,7 @@ elif [ "${engine}" == "unity3d" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd "[:digit:]") + port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0"