From 189a1659fc1820a52774bac2d23c04b33060ccf0 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 14 Jan 2017 18:34:45 +0100 Subject: [PATCH 1/2] Fixes arma3 ports actually working with parms Fixes #1240 --- lgsm/functions/command_details.sh | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 3af2b7ac7f..f606b2f377 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -310,7 +310,7 @@ fn_details_ports(){ parmslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file - local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" ) + local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" ) for port_edit in "${ports_edit_array[@]}" do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then @@ -318,7 +318,7 @@ fn_details_ports(){ fi done # engines/games that require editing in the script file - local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" ) + local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality") for port_edit in "${ports_edit_array[@]}" do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then @@ -347,9 +347,14 @@ fn_details_ark(){ echo -e "netstat -atunp | grep ShooterGame" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + # Don't do arithmetics if ever the port wasn't a numeric value + if [ "${port}" -eq "${port}" ]; then + echo -e "> RAW\tINBOUND\t$((port+1))\tudp" + fi echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" } | column -s $'\t' -t } @@ -521,15 +526,19 @@ fn_details_quakelive(){ fn_details_realvirtuality(){ echo -e "netstat -atunp | grep arma3server" echo -e "" - if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then - echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}." - echo -e "" + # Default port + if [ -z "${port}" ]; then + port="2302" fi { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp" + # Don't do arithmetics if ever the port wasn't a numeric value + if [ "${port}" -eq "${port}" ]; then + echo -e "> Steam: Query\tINBOUND\t$((port+1))\tudp" + echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp" + echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp" + fi } | column -s $'\t' -t } @@ -772,7 +781,7 @@ fn_display_details() { fn_details_ut3 elif [ "${gamename}" == "7 Days To Die" ]; then fn_details_sdtd - elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then + elif [ "${gamename}" == "ARK: Survival Evolved" ]; then fn_details_ark elif [ "${gamename}" == "Call of Duty" ]; then fn_details_cod @@ -816,4 +825,3 @@ then fn_display_details core_exit.sh fi - From c5535543e1106bc5b1680e02f04f357bf3870245 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 14 Jan 2017 18:36:12 +0100 Subject: [PATCH 2/2] Revert change to Ark to fit master, not develop --- lgsm/functions/command_details.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index f606b2f377..5f7f43b1e5 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -781,7 +781,7 @@ fn_display_details() { fn_details_ut3 elif [ "${gamename}" == "7 Days To Die" ]; then fn_details_sdtd - elif [ "${gamename}" == "ARK: Survival Evolved" ]; then + elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then fn_details_ark elif [ "${gamename}" == "Call of Duty" ]; then fn_details_cod