From 1b9e0bcd1b13cbb12aca510a0ddd50062b76c637 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 03:12:01 +0100 Subject: [PATCH 01/15] Fixes #1235 and more No config alteration for Ark, and requires to create the cfgdir. + Rearranging presentation to make more visual sense --- lgsm/functions/install_config.sh | 73 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 10a7040d27..426bec9c83 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -8,35 +8,7 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -fn_fetch_default_config(){ - mkdir -pv "${lgsmdir}/default-configs" - githuburl="https://github.com/GameServerManagers/Game-Server-Configs/master" - - for config in "${array_configs[@]}" - do - fileurl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/${gamedirname}/${config}"; filedir="${lgsmdir}/default-configs"; filename="${config}"; executecmd="noexecute" run="norun"; force="noforce" - fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" - done -} - -# Changes some variables within the default configs -# SERVERNAME to LinuxGSM -# PASSWORD to random password -fn_set_config_vars(){ - random=$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 8 | tr -d '\n'; echo) - servername="LinuxGSM" - rconpass="admin$random" - echo "changing hostname." - fn_script_log_info "changing hostname." - sleep 1 - sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" - echo "changing rcon/admin password." - fn_script_log_info "changing rcon/admin password." - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" - sleep 1 -} - -# Checks if cfg dir exists, creates it if it doesn't +# Checks if server cfg dir exists, creates it if it doesn't fn_check_cfgdir(){ if [ ! -d "${servercfgdir}" ]; then echo "creating ${servercfgdir} config directory." @@ -45,11 +17,19 @@ fn_check_cfgdir(){ fi } -# Copys the default configs from Game-Server-Configs repo to the -# correct location +# Downloads default configs from Game-Server-Configs repo to lgsm/default-configs +fn_fetch_default_config(){ + mkdir -pv "${lgsmdir}/default-configs" + githuburl="https://github.com/GameServerManagers/Game-Server-Configs/master" + for config in "${array_configs[@]}"; do + fileurl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/${gamedirname}/${config}"; filedir="${lgsmdir}/default-configs"; filename="${config}"; executecmd="noexecute" run="norun"; force="noforce" + fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" + done +} + +# Copys default configs from Game-Server-Configs repo to server config location fn_default_config_remote(){ - for config in "${array_configs[@]}" - do + for config in "${array_configs[@]}"; do # every config is copied echo "copying ${config} config file." fn_script_log_info "copying ${servercfg} config file." @@ -66,6 +46,29 @@ fn_default_config_remote(){ sleep 1 } +# Changes some variables within the default configs +# SERVERNAME to LinuxGSM +# PASSWORD to random password +fn_set_config_vars(){ + if [ -f "${servercfgfullpath}" ]; then + random=$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 8 | tr -d '\n'; echo) + servername="LinuxGSM" + rconpass="admin$random" + echo "changing hostname." + fn_script_log_info "changing hostname." + sleep 1 + sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" + echo "changing rcon/admin password." + fn_script_log_info "changing rcon/admin password." + sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" + sleep 1 + else + fn_script_log_warn "Config file not found, cannot alter it." + echo "Config file not found, cannot alter it." + sleep 1 + fi +} + # Changes some variables within the default Don't Starve Together configs fn_set_dst_config_vars(){ ## cluster.ini @@ -129,10 +132,10 @@ if [ "${gamename}" == "7 Days To Die" ]; then fn_set_config_vars elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then gamedirname="ARKSurvivalEvolved" + fn_check_cfgdir array_configs+=( GameUserSettings.ini ) fn_fetch_default_config fn_default_config_remote - fn_set_config_vars elif [ "${gamename}" == "ARMA 3" ]; then gamedirname="Arma3" fn_check_cfgdir @@ -494,4 +497,4 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars -fi \ No newline at end of file +fi From 6da044b55e80e501a915e564a5efa56848c291e6 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 04:22:22 +0100 Subject: [PATCH 02/15] Real default values --- ARKSurvivalEvolved/arkserver | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 569be1483d..95fce2b44e 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -24,11 +24,11 @@ version="170110" ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters servername="ark-server" -port="7778" +port="7777" queryport="27015" -rconport="32330" +rconport="27020" rconpassword="" # Set to enable rcon -maxplayers="50" +maxplayers="60" ip="0.0.0.0" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters From 8f143f0d3baec3049b1ace4cfdf70e915b43bc28 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 04:36:40 +0100 Subject: [PATCH 03/15] More explicit servername Otherwise you can think it's a servicename --- ARKSurvivalEvolved/arkserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 95fce2b44e..47ba8919e0 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -23,7 +23,7 @@ version="170110" #### Server Settings #### ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -servername="ark-server" +servername="LGSM ARK Server" port="7777" queryport="27015" rconport="27020" From eb2788ed9e25bdf6ad602c542d66e7deb72640ae Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 04:54:55 +0100 Subject: [PATCH 04/15] Better ARK ports info Will test if ok --- lgsm/functions/command_details.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 3af2b7ac7f..20ad292227 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -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\t\INBOUND\t$((port+1))\tudp + fi echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\INBOUND\t${rconport}\ttcp" } | column -s $'\t' -t } From 07fc2472992c0d2972ff59c30dd2487798ab2d67 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 04:56:23 +0100 Subject: [PATCH 05/15] missing space --- 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 20ad292227..fae41b1a17 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -350,7 +350,7 @@ fn_details_ark(){ 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 + if [ "${port}" -eq "${port}" ]; then echo -e "> RAW\t\INBOUND\t$((port+1))\tudp fi echo -e "> Query\tINBOUND\t${queryport}\tudp" From 6d15a580e72b9f9438e0c2cea2b706a5fac85f94 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 05:01:15 +0100 Subject: [PATCH 06/15] better close an echo --- 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 fae41b1a17..bc634a4ceb 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -351,7 +351,7 @@ fn_details_ark(){ 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\t\INBOUND\t$((port+1))\tudp + echo -e "> RAW\t\INBOUND\t$((port+1))\tudp" fi echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> RCON\INBOUND\t${rconport}\ttcp" From a12d6cc2276f1e2c105858978a440b9a47839ceb Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 05:03:04 +0100 Subject: [PATCH 07/15] I need to get better with tables. --- lgsm/functions/command_details.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index bc634a4ceb..eee2af76e4 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -351,10 +351,10 @@ fn_details_ark(){ 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\t\INBOUND\t$((port+1))\tudp" + echo -e "> RAW\tINBOUND\t$((port+1))\tudp" fi echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\INBOUND\t${rconport}\ttcp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" } | column -s $'\t' -t } From 8543ec774414d1116d3954eecb93a5e2cc5a213b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 05:37:55 +0100 Subject: [PATCH 08/15] added back config vars for ark --- lgsm/functions/install_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 426bec9c83..51d8c40653 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -136,6 +136,7 @@ elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then array_configs+=( GameUserSettings.ini ) fn_fetch_default_config fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "ARMA 3" ]; then gamedirname="Arma3" fn_check_cfgdir From a557486a526af84e61de7ea727805a127f9d3321 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 05:57:25 +0100 Subject: [PATCH 09/15] Cleaning parameters set within .ini file and default maxplayers is actually 70 --- ARKSurvivalEvolved/arkserver | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 47ba8919e0..d2d45f9048 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -23,18 +23,16 @@ version="170110" #### Server Settings #### ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -servername="LGSM ARK Server" port="7777" queryport="27015" rconport="27020" -rconpassword="" # Set to enable rcon -maxplayers="60" +maxplayers="70" ip="0.0.0.0" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters # Edit with care fn_parms(){ -parms="\"TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}\"" +parms="\"TheIsland?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?\"" } #### LinuxGSM Settings #### From 5144d86be55f7c63e0e581b9fc2821f69ddfcc4f Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 06:07:35 +0100 Subject: [PATCH 10/15] Ark info config, to test --- lgsm/functions/info_config.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 2da3c4d84e..c487d3917f 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -39,6 +39,16 @@ fn_info_config_avalanche(){ fi } +fn_info_config_ark(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + else + servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + # Not Set + servername=${servername:-"NOT SET"} + fi +} + fn_info_config_bf1942(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -596,6 +606,9 @@ fn_info_config_sdtd(){ # Just Cause 2 if [ "${engine}" == "avalanche" ]; then fn_info_config_avalanche +# ARK: Survival Evolved +elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then + fn_info_config_ark # Battlefield: 1942 elif [ "${gamename}" == "Battlefield: 1942" ]; then fn_info_config_bf1942 @@ -663,4 +676,4 @@ elif [ "${gamename}" == "7 Days To Die" ]; then fn_info_config_sdtd elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then fn_info_config_wolfensteinenemyterritory -fi \ No newline at end of file +fi From e4b0054f637452dbd3584aa8be9d89f4f29b4571 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 06:11:33 +0100 Subject: [PATCH 11/15] Grep Ark SessionName --- lgsm/functions/info_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index c487d3917f..ea05055cdb 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -43,7 +43,7 @@ fn_info_config_ark(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" else - servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set servername=${servername:-"NOT SET"} fi From 43a924a12483b2947f1366677c249c1051cd1136 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 14:54:44 +0100 Subject: [PATCH 12/15] Typo: Survivial > Survival --- lgsm/functions/install_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 51d8c40653..840347ab45 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -130,7 +130,7 @@ if [ "${gamename}" == "7 Days To Die" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then +elif [ "${gamename}" == "ARK: Survival Evolved" ]; then gamedirname="ARKSurvivalEvolved" fn_check_cfgdir array_configs+=( GameUserSettings.ini ) From 4d4de5c822e0ad2a8afa0fb92d2083ececcf2b05 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 14:55:19 +0100 Subject: [PATCH 13/15] Typo: Survivial > Survival --- lgsm/functions/command_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 2013f85bf6..a23f4ad5cf 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -296,7 +296,7 @@ fn_stop_tmux(){ rm -f "${rootdir}/${lockselfname}" # ARK doesn't clean up immediately after tmux is killed. # Make certain the ports are cleared before continuing. - if [ "${gamename}" == "ARK: Survivial Evolved" ]; then + if [ "${gamename}" == "ARK: Survival Evolved" ]; then fn_stop_ark echo -en "\n" fi From d6944b6f94f279278aaec570855e76025891a692 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 14:56:09 +0100 Subject: [PATCH 14/15] Typo: Survivial > Survival --- 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 eee2af76e4..73e54c3ff9 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -777,7 +777,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 From c909a85b569dd561fde67f1efb62cc8757b90b0d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Fri, 13 Jan 2017 14:56:47 +0100 Subject: [PATCH 15/15] Typo: Survivial > Survival --- ARKSurvivalEvolved/arkserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index d2d45f9048..6bc5079c0e 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -80,7 +80,7 @@ githubbranch="master" ## LinuxGSM Server Details # Do not edit -gamename="ARK: Survivial Evolved" +gamename="ARK: Survival Evolved" engine="unreal4" ## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers