From 6854ae5fb565159dc50ffc27e86fb4f6067265bd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs <me@danielgibbs.co.uk> Date: Sun, 21 Feb 2021 21:40:32 +0000 Subject: [PATCH] added bt1944 to info_parms update info messages bt1944ports --- lgsm/functions/info_config.sh | 4 ++-- lgsm/functions/info_messages.sh | 12 ++++-------- lgsm/functions/info_parms.sh | 25 +++++++++++++++++-------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index be2429b70..d8bbb081a 100755 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -165,7 +165,7 @@ fn_info_config_barotrauma(){ fi } -fn_info_config_battalion1944(){ +fn_info_config_bt1944(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -1578,7 +1578,7 @@ elif [ "${shortname}" == "bo" ]; then elif [ "${shortname}" == "bt" ]; then fn_info_config_barotrauma elif [ "${shortname}" == "bt1944" ]; then - fn_info_config_battalion1944 + fn_info_config_bt1944 elif [ "${shortname}" == "bf1942" ]; then fn_info_config_bf1942 elif [ "${shortname}" == "bfv" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index cd4f2f820..53130600e 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -696,18 +696,14 @@ fn_info_message_ballisticoverkill(){ } | column -s $'\t' -t } -fn_info_message_battalion1944(){ +fn_info_message_bt1944(){ echo -e "netstat -atunp | grep BattalionServ" echo -e "" { echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Unused\tINBOUND\t$((port+2))\ttcp" - fi + echo -e "> Steam\tINBOUND\t${steamport}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" echo -e "> Query\tINBOUND\t${queryport}\tudp" } | column -s $'\t' -t } @@ -1505,7 +1501,7 @@ fn_info_message_select_engine(){ elif [ "${shortname}" == "bt" ]; then fn_info_message_barotrauma elif [ "${shortname}" == "bt1944" ]; then - fn_info_message_battalion1944 + fn_info_message_bt1944 elif [ "${shortname}" == "cmw" ]; then fn_info_message_chivalry elif [ "${shortname}" == "cod" ]; then diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index f5533717f..0038acb54 100755 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -28,6 +28,13 @@ fn_info_parms_barotrauma(){ queryport=${queryport:-"0"} } +fn_info_parms_bt1944(){ + port=${port:-"0"} + steamport=$((port+1)) + rconport=$((port+2)) + queryport=${queryport:-"0"} +} + fn_info_parms_cod(){ defaultmap=${defaultmap:-"NOT SET"} maxplayers=${maxplayers:-"0"} @@ -95,7 +102,7 @@ fn_info_parms_mom(){ } fn_info_parms_mta(){ - queryport=$((port + 123)) + queryport=$((port+123)) } fn_info_parms_projectzomboid(){ @@ -116,13 +123,13 @@ fn_info_parms_quake2(){ fn_info_parms_realvirtuality(){ port=${port:-"0"} - queryport=$((port + 1)) + queryport=$((port+1)) } fn_info_parms_risingworld(){ servername=${servername:-"NOT SET"} port=${port:-"0"} - httpqueryport=$((port - 1)) + httpqueryport=$((port-1)) } fn_info_parms_rtcw(){ @@ -171,7 +178,7 @@ fn_info_parms_spark(){ defaultmap=${defaultmap:-"NOT SET"} maxplayers=${maxplayers:-"0"} port=${port:-"0"} - queryport=$((port + 1)) + queryport=$((port+1)) servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} webadminuser=${webadminuser:-"NOT SET"} @@ -211,12 +218,12 @@ fn_info_parms_pavlovvr(){ fn_info_parms_unreal(){ defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) + queryport=$((port+1)) } fn_info_parms_unreal2(){ defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) + queryport=$((port+1)) } fn_info_parms_unreal3(){ @@ -228,7 +235,7 @@ fn_info_parms_unreal3(){ fn_info_parms_unturned(){ servername=${selfname:-"NOT SET"} port=${port:-"0"} - queryport=$((port + 1)) + queryport=$((port+1)) } fn_info_parms_ut(){ @@ -237,7 +244,7 @@ fn_info_parms_ut(){ fn_info_parms_vh(){ port=${port:-"0"} - queryport=$((port + 1)) + queryport=$((port+1)) gameworld=${gameworld:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} servername=${servername:-"NOT SET"} @@ -259,6 +266,8 @@ elif [ "${shortname}" == "arma3" ]; then fn_info_parms_realvirtuality elif [ "${shortname}" == "bt" ]; then fn_info_parms_barotrauma +elif [ "${shortname}" == "bt1944" ]; then + fn_info_parms_bt1944 elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then fn_info_parms_cod elif [ "${shortname}" == "fctr" ]; then