From 9ba341f125196fb1174a8b9b7ff41d5c9defdf31 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 19 Dec 2015 23:48:50 +0100 Subject: [PATCH 01/36] Testing, not working yet --- Hurtworld/hurtworldserver | 138 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Hurtworld/hurtworldserver diff --git a/Hurtworld/hurtworldserver b/Hurtworld/hurtworldserver new file mode 100644 index 000000000..e669bff65 --- /dev/null +++ b/Hurtworld/hurtworldserver @@ -0,0 +1,138 @@ +#!/bin/bash +# Hurtworld +# Server Management Script +# Author: Daniel Gibbs, UltimateByte Fork +# Website: http://gameservermanagers.com +version="191215" + +#### Variables #### + +# Notification Email +# (on|off) +emailnotification="off" +email="email@example.com" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables +servername="Hurtworld LGSM Server" +logfile="gamelog.txt" +ip="0.0.0.0" +hostport="12871" +queryport="12881" +maxplayers="20" +map="" +creativemode="0" #Free Build (0 is off) +updateonstart="off" +loadsave="" #For maintenance only +logfile="gamelog.txt" + +# http://7daystodie.gamepedia.com/Server +fn_parms(){ +parms="-batchmode -nographics -exec \"host ${hostport} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode}\" -logfile \"${logfile}\" " +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + +# Steam +appid="405100" + +# Server Details +servicename="hurtworld-server" +gamename="hurtworld" +engine="unity3d" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) +lockselfname=".${servicename}.lock" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}" +executabledir="${filesdir}" +executable="./Hurtworld.x86" +servercfg="${servicename}.xml" +servercfgdir="${filesdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/serverconfig.xml" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${rootdir}/log/server" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" + +gamelog="${gamelogdir}/${servicename}-game.log" +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" + fi + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + : + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " ${curl}"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" +fi +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 +} + +fn_functions(){ +# Functions are defined in fn_functions. +functionfile="${FUNCNAME}" +fn_runfunction +} + +fn_functions + +getopt=$1 +fn_getopt + From b69ea037a8402931d4f3d9fd374d8394993709be Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 20 Dec 2015 00:13:44 +0100 Subject: [PATCH 02/36] Update hurtworldserver --- Hurtworld/hurtworldserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hurtworld/hurtworldserver b/Hurtworld/hurtworldserver index e669bff65..25f3d3175 100644 --- a/Hurtworld/hurtworldserver +++ b/Hurtworld/hurtworldserver @@ -29,7 +29,7 @@ updateonstart="off" loadsave="" #For maintenance only logfile="gamelog.txt" -# http://7daystodie.gamepedia.com/Server +# http://hurtworld.wikia.com/wiki/Hosting_A_Server fn_parms(){ parms="-batchmode -nographics -exec \"host ${hostport} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode}\" -logfile \"${logfile}\" " } From 150110fbe8ea569c08a3428367e6f9e4f5b5348e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 20 Dec 2015 23:35:59 +0000 Subject: [PATCH 03/36] Renamed to hwserver --- Hurtworld/{hurtworldserver => hwserver} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Hurtworld/{hurtworldserver => hwserver} (100%) diff --git a/Hurtworld/hurtworldserver b/Hurtworld/hwserver similarity index 100% rename from Hurtworld/hurtworldserver rename to Hurtworld/hwserver From aae4610b0c409d6581500f537d294444731f8202 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 20 Dec 2015 23:37:19 +0000 Subject: [PATCH 04/36] updated githubbranch= while in development --- Hurtworld/hwserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 25f3d3175..15e077920 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -41,7 +41,7 @@ parms="-batchmode -nographics -exec \"host ${hostport} ${map} ${save};queryport # from a different repo and/or branch. githubuser="dgibbs64" githubrepo="linuxgsm" -githubbranch="master" +githubbranch="hurt-world" # Steam appid="405100" From 9e3789f7adec966f12d752a477b6253c923b8af0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 20 Dec 2015 23:40:26 +0000 Subject: [PATCH 05/36] updated header now includes dev-debug option. --- Hurtworld/hwserver | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 15e077920..388c0b5b5 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -1,8 +1,15 @@ #!/bin/bash # Hurtworld # Server Management Script -# Author: Daniel Gibbs, UltimateByte Fork +# Author: Daniel Gibbs, +# Contributor: UltimateByte # Website: http://gameservermanagers.com +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + version="191215" #### Variables #### From 024545265885647230d5047ecbbdd09a7c8fe945 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 00:47:07 +0100 Subject: [PATCH 06/36] Removed useless IP variable Need to see serverconfig.xml, could be useless. --- Hurtworld/hwserver | 1 - 1 file changed, 1 deletion(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 388c0b5b5..1ec1ecd96 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -26,7 +26,6 @@ steampass="" # Start Variables servername="Hurtworld LGSM Server" logfile="gamelog.txt" -ip="0.0.0.0" hostport="12871" queryport="12881" maxplayers="20" From b94e1adbe4e35c32bb338287ef2572afeac24fe4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 01:11:51 +0100 Subject: [PATCH 07/36] added hwunity3d matching the name in fn_monitor_query and hwserver as the serverport number isn't found into "${servercfgfullpath}" like for sdtd --- GameServerQuery/gsquery.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GameServerQuery/gsquery.py b/GameServerQuery/gsquery.py index a1380a5a7..70eb08951 100644 --- a/GameServerQuery/gsquery.py +++ b/GameServerQuery/gsquery.py @@ -27,6 +27,8 @@ class GameServer: self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' if self.option.engine == 'unity3d': self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + if self.option.engine == 'hwunity3d': + self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'unreal': self.query_prompt_string = '\x5C\x69\x6E\x66\x6F\x5C' elif self.option.engine == 'unreal2': @@ -101,7 +103,7 @@ if __name__ == '__main__': action = 'store', dest = 'engine', default = False, - help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, unreal, unreal2.' + help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, hwunity3d, unreal, unreal2.' ) parser.add_option( '-v', '--verbose', From d69576e34a51acaa641bd49474d5b5999a989a63 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 01:22:10 +0100 Subject: [PATCH 08/36] Renamed variables, readded IP for gsquery --- Hurtworld/hwserver | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 1ec1ecd96..e89901cdd 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -25,9 +25,9 @@ steampass="" # Start Variables servername="Hurtworld LGSM Server" -logfile="gamelog.txt" -hostport="12871" +port="12871" queryport="12881" +ip="0.0.0.0" #For server monitoring maxplayers="20" map="" creativemode="0" #Free Build (0 is off) @@ -37,7 +37,7 @@ logfile="gamelog.txt" # http://hurtworld.wikia.com/wiki/Hosting_A_Server fn_parms(){ -parms="-batchmode -nographics -exec \"host ${hostport} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode}\" -logfile \"${logfile}\" " +parms="-batchmode -nographics -exec \"host ${port} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode}\" -logfile \"${logfile}\" " } #### Advanced Variables #### @@ -55,7 +55,7 @@ appid="405100" # Server Details servicename="hurtworld-server" gamename="hurtworld" -engine="unity3d" +engine="hwunity3d" # Directories rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" From ab920be2e961f8a7fdd7ce2eac9cec51839d00ab Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 01:32:02 +0100 Subject: [PATCH 09/36] added hurtworld --- functions/fn_install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/fn_install b/functions/fn_install index 0cc9129c4..4c781b388 100644 --- a/functions/fn_install +++ b/functions/fn_install @@ -42,5 +42,7 @@ elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_install_ut2k4fix elif [ "${gamename}" == "Unreal Tournament 99" ]; then fn_install_ut99fix +elif [ "${gamename}" == "Hurtworld" ]; then + fn_install_hwfix fi -fn_install_complete \ No newline at end of file +fn_install_complete From 38f391bb3258feb8bc3cfbfd123d6fecf0765c7a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 01:50:13 +0100 Subject: [PATCH 10/36] Added hurtworld fix Updated description --- functions/fn_install_steamfix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions/fn_install_steamfix b/functions/fn_install_steamfix index e977b0f11..c7c205210 100644 --- a/functions/fn_install_steamfix +++ b/functions/fn_install_steamfix @@ -14,10 +14,10 @@ cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamcl sleep 1 } -# Gary's Mod Specific +# Server specific fn_libsteamfix(){ echo "" -echo "Applying libsteam.so fix" +echo "Applying libsteam.so and steamclient.so fixes" echo "=================================" sleep 1 if [ "${gamename}" == "Garry's Mod" ]; then @@ -26,6 +26,9 @@ if [ "${gamename}" == "Garry's Mod" ]; then elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then mkdir -pv "${HOME}/.steam/bin32" cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" +elif [ "${gamename}" == "Hurtworld" ]; then + cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" + cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" fi sleep 1 } From de8f3e76573e6a8487d3dfffc6d67fe5ec5bca69 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 02:06:28 +0100 Subject: [PATCH 11/36] Should now actually run the fix for hurtworld --- functions/fn_install_steamfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_install_steamfix b/functions/fn_install_steamfix index c7c205210..d94ce3e28 100644 --- a/functions/fn_install_steamfix +++ b/functions/fn_install_steamfix @@ -34,6 +34,6 @@ sleep 1 } fn_steamclientfix -if [ "${gamename}" == "Garry's Mod" ]||[ "${gamename}" == "Serious Sam 3: BFE" ]; then +if [ "${gamename}" == "Garry's Mod" ]||[ "${gamename}" == "Serious Sam 3: BFE" ]||[ "${gamename}" == "Hurtworld" ]; then fn_libsteamfix fi From 4ecb781e8b36a8e78fd5bb2be1458134e3789203 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 02:12:54 +0100 Subject: [PATCH 12/36] Capital to Hurtworld makes my life better --- Hurtworld/hwserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index e89901cdd..fb72533ec 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -54,7 +54,7 @@ appid="405100" # Server Details servicename="hurtworld-server" -gamename="hurtworld" +gamename="Hurtworld" engine="hwunity3d" # Directories From f66abbafad4a471f3503c0d0baae1efe31ca406b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 02:18:37 +0100 Subject: [PATCH 13/36] Actually removed useless hurtworld filefix Fix is done with fn_install_steamfix --- functions/fn_install | 2 -- 1 file changed, 2 deletions(-) diff --git a/functions/fn_install b/functions/fn_install index 4c781b388..39fca9c8e 100644 --- a/functions/fn_install +++ b/functions/fn_install @@ -42,7 +42,5 @@ elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_install_ut2k4fix elif [ "${gamename}" == "Unreal Tournament 99" ]; then fn_install_ut99fix -elif [ "${gamename}" == "Hurtworld" ]; then - fn_install_hwfix fi fn_install_complete From 4f934bd7a1aaf259dabecf35b373c7c326798f68 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 02:38:27 +0100 Subject: [PATCH 14/36] trying on hurtworld unity3d --- functions/fn_install_gsquery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_install_gsquery b/functions/fn_install_gsquery index 3f5bfcebf..5b7db65ea 100644 --- a/functions/fn_install_gsquery +++ b/functions/fn_install_gsquery @@ -11,7 +11,7 @@ wget -N /dev/null "http://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F " chmod +x gsquery.py } -if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then +if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "hwunity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then echo "" echo "GameServerQuery" echo "============================" From 949775a4dd37dd39af19f6780fcf34feaa7a06fb Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 02:58:06 +0100 Subject: [PATCH 15/36] Cleaned useless servercfgs --- Hurtworld/hwserver | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index fb72533ec..46ddc27ad 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -25,14 +25,16 @@ steampass="" # Start Variables servername="Hurtworld LGSM Server" +ip="0.0.0.0" port="12871" queryport="12881" -ip="0.0.0.0" #For server monitoring maxplayers="20" map="" creativemode="0" #Free Build (0 is off) updateonstart="off" -loadsave="" #For maintenance only + +# Maintenance Variables +loadsave="" logfile="gamelog.txt" # http://hurtworld.wikia.com/wiki/Hosting_A_Server @@ -65,10 +67,6 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" executable="./Hurtworld.x86" -servercfg="${servicename}.xml" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/serverconfig.xml" backupdir="${rootdir}/backups" # Logging From 01890320ab00ecf34aa060da431693dc4764c66a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 22:46:14 +0100 Subject: [PATCH 16/36] added hurtworld --- functions/fn_details | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/fn_details b/functions/fn_details index 84ac3c0d9..b0f2d7496 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -729,6 +729,8 @@ elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then fn_details_unreal elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then fn_details_ark +elif [ "${gamename}" == "Hurtworld" ]; then + fn_details_hurtworld elif [ "${gamename}" == "Teamspeak 3" ]; then fn_details_teamspeak3 else From 29fe60146bbc3312f66a3bf35571f4074b1feb9a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 21 Dec 2015 23:37:00 +0100 Subject: [PATCH 17/36] added hurtworld and comments --- functions/fn_details_config | 52 ++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/functions/fn_details_config b/functions/fn_details_config index d24751f81..6fccda497 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -235,6 +235,7 @@ elif [ "${engine}" == "realvirtuality" ]; then fn_servercfgfullpath +# Serious Sam elif [ "${engine}" == "seriousengine35" ]; then # server name @@ -295,6 +296,7 @@ elif [ "${engine}" == "seriousengine35" ]; then fn_servercfgfullpath +# Source Engine Games elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then # server name @@ -329,6 +331,7 @@ elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then fn_servercfgfullpath +# Spark (NS2: Combat) elif [ "${engine}" == "spark" ]; then # query port @@ -341,6 +344,7 @@ elif [ "${engine}" == "spark" ]; then fn_servercfgfullpath +# Teamspeak 3 elif [ "${gamename}" == "Teamspeak 3" ]; then # ip @@ -388,6 +392,7 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then fn_servercfgfullpath +# Teeworlds elif [ "${engine}" == "teeworlds" ]; then # server name @@ -440,6 +445,7 @@ elif [ "${engine}" == "teeworlds" ]; then fn_servercfgfullpath +# Terraria elif [ "${engine}" == "terraria" ]; then # port @@ -450,7 +456,8 @@ elif [ "${engine}" == "terraria" ]; then port="0" fi -elif [ "${engine}" == "unity3d" ]; then +# 7 Day To Die (unity3d) +elif [ "${gamename}" == "7 Days To Die" ]; then # server name if [ -f "${servercfgfullpath}" ]; then @@ -586,6 +593,48 @@ elif [ "${engine}" == "unity3d" ]; then fn_servercfgfullpath +# Hurtworld (unity3d) +elif [ "${gamename}" == "Hurtworld" ]; then + + # server name + if [ -n "${servername}" ]; then + servername="${servername}" + else + servername="\e[0;31mUNAVAILABLE\e[0m" + fi + + # server password + # not available yet + + # slots + if [ -n "${maxplayers}" ]; then + slots="{maxplayers}" + else + slots="NOT SET" + fi + + # game world + if [ -n "${map}" ]; then + gameworld="${map}" + else + gameworld="\e[0;31mUNAVAILABLE\e[0m" + fi + + # port + if [ -n "${port}" ]; then + port="${port}" + else + port="0" + fi + + # query port + if [ -n "${queryport}" ]; then + queryport="${queryport}" + else + queryport="0" + fi + +# Unreal Tournament elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then # server name @@ -716,6 +765,7 @@ elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then fn_servercfgfullpath +# ARK: Survivaial Evolved elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then # server name From 2b95ac671c5b3b406036ade32e0a681c6e0496e6 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 00:00:01 +0100 Subject: [PATCH 18/36] testing implementing hurtworld --- functions/fn_details | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/functions/fn_details b/functions/fn_details index 4b9b63a4f..b270ba5f4 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -601,6 +601,37 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = fn_details_statusbottom } +fn_details_hurtworld(){ +fn_check_ip +fn_parms +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 "hwserver script" +echo -e "" +echo -e "Useful port diagnostic command:" +echo -e "netstat -atunp | grep Hurtworld.x86" +echo -e "" +{ + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/RCON\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + +} | column -s $'\t' -t +echo -e "" + +fn_details_statusbottom +} + fn_details_unreal(){ fn_check_ip fn_parms From 5512d400ebf959fd515e9811192abf5a4330f6a4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 00:58:14 +0100 Subject: [PATCH 19/36] remove config check for hurtworld --- functions/fn_details | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/fn_details b/functions/fn_details index b270ba5f4..b25edca43 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -719,6 +719,9 @@ fn_details_statusbottom } if [ ! -e "${servercfgfullpath}" ]; then + if [ "${gamename}" == "Hurtworld"]; then + echo "No config file" + else echo "" fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m" echo "${servercfgfullpath}" From 8bebb32766b0ba877faf17f993627f8d3b990ad4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 01:00:51 +0100 Subject: [PATCH 20/36] Update fn_details --- functions/fn_details | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/functions/fn_details b/functions/fn_details index b25edca43..d07d701cc 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -720,19 +720,20 @@ fn_details_statusbottom if [ ! -e "${servercfgfullpath}" ]; then if [ "${gamename}" == "Hurtworld"]; then - echo "No config file" + echo "No config file set or required" else - echo "" - fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m" - echo "${servercfgfullpath}" - echo "Some details cannot be displayed" - echo -en ".\r" - sleep 1 - echo -en "..\r" - sleep 1 - echo -en "...\r" - sleep 1 - echo -en " \r" + echo "" + fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m" + echo "${servercfgfullpath}" + echo "Some details cannot be displayed" + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + fi fi fn_details_glibc From d3cb2761af232b42fe811ea3f8cdbcbefcc90537 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 01:05:26 +0100 Subject: [PATCH 21/36] Update fn_details --- functions/fn_details | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_details b/functions/fn_details index d07d701cc..66d2cfbdd 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -719,7 +719,7 @@ fn_details_statusbottom } if [ ! -e "${servercfgfullpath}" ]; then - if [ "${gamename}" == "Hurtworld"]; then + if [ "${gamename}" == "Hurtworld" ]; then echo "No config file set or required" else echo "" From 12ebddc1cc3cb265b73012fd405582c414f42542 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 01:10:10 +0100 Subject: [PATCH 22/36] missing $ on maxplayers --- functions/fn_details_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_details_config b/functions/fn_details_config index 6fccda497..f0be53cf8 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -608,7 +608,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then # slots if [ -n "${maxplayers}" ]; then - slots="{maxplayers}" + slots="${maxplayers}" else slots="NOT SET" fi From e976f9b0e574babcddd8a0e19d17322239f7e3fe Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 01:16:28 +0100 Subject: [PATCH 23/36] simplifying hurtworld checking --- functions/fn_details | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/functions/fn_details b/functions/fn_details index 66d2cfbdd..c85c96559 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -719,9 +719,7 @@ fn_details_statusbottom } if [ ! -e "${servercfgfullpath}" ]; then - if [ "${gamename}" == "Hurtworld" ]; then - echo "No config file set or required" - else + if [ "${gamename}" != "Hurtworld" ]; then echo "" fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m" echo "${servercfgfullpath}" From 65c3158d7d1586f1ba434f40399602f2756bf17d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:19:55 +0100 Subject: [PATCH 24/36] Update fn_install_gsquery --- functions/fn_install_gsquery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_install_gsquery b/functions/fn_install_gsquery index 5b7db65ea..fe6ee2cef 100644 --- a/functions/fn_install_gsquery +++ b/functions/fn_install_gsquery @@ -11,7 +11,7 @@ wget -N /dev/null "http://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F " chmod +x gsquery.py } -if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "hwunity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then +if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Hurtworld" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then echo "" echo "GameServerQuery" echo "============================" From 7cb95400c3003d042a4605610065801145c61a42 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:21:01 +0100 Subject: [PATCH 25/36] changed engine hwunity3d to gamename Hurtworld changed engine hwunity3d to gamename Hurtworld --- functions/fn_install_gsquery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_install_gsquery b/functions/fn_install_gsquery index fe6ee2cef..16b1534ee 100644 --- a/functions/fn_install_gsquery +++ b/functions/fn_install_gsquery @@ -2,7 +2,7 @@ # LGSM fn_install_gsquery function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="061115" +lgsm_version="221215" fn_dlgsquery(){ cd "${rootdir}" From f8d94fa91507b9306afacdfb60d50b50862c4a4b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:27:22 +0100 Subject: [PATCH 26/36] Don't create config for hurtworld --- functions/fn_install_config | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions/fn_install_config b/functions/fn_install_config index 2a0311634..dcd0811de 100644 --- a/functions/fn_install_config +++ b/functions/fn_install_config @@ -5,9 +5,11 @@ lgsm_version="201215" fn_defaultconfig(){ -echo "creating ${servercfg} config file." -cp -v "${servercfgdefault}" "${servercfgfullpath}" -sleep 1 +if [ "${gamename}" != "Hurtworld" ]; then + echo "creating ${servercfg} config file." + cp -v "${servercfgdefault}" "${servercfgfullpath}" + sleep 1 +fi } fn_userinputconfig(){ From 152aee400f25c4623a7ce001d74604dab882cb22 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:28:15 +0100 Subject: [PATCH 27/36] engine set to unity3d --- Hurtworld/hwserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 46ddc27ad..8b92753c3 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -57,7 +57,7 @@ appid="405100" # Server Details servicename="hurtworld-server" gamename="Hurtworld" -engine="hwunity3d" +engine="unity3d" # Directories rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" From 1cdef4ad59144a6ebc418f0ed02dc76aee3242bc Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:40:44 +0100 Subject: [PATCH 28/36] Actually don't create config for hurtworld --- functions/fn_install_config | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/functions/fn_install_config b/functions/fn_install_config index dcd0811de..9ad27b52a 100644 --- a/functions/fn_install_config +++ b/functions/fn_install_config @@ -5,11 +5,9 @@ lgsm_version="201215" fn_defaultconfig(){ -if [ "${gamename}" != "Hurtworld" ]; then echo "creating ${servercfg} config file." cp -v "${servercfgdefault}" "${servercfgfullpath}" sleep 1 -fi } fn_userinputconfig(){ @@ -156,9 +154,12 @@ echo "" echo "Creating Configs" echo "=================================" sleep 1 -mkdir -pv "${servercfgdir}" -cd "${servercfgdir}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}" +if [ "${gamename}" != "Hurtworld" ]; then + mkdir -pv "${servercfgdir}" + cd "${servercfgdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}" +fi + if [ "${gamename}" == "7 Days To Die" ]; then fn_defaultconfig elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then From 5ac2e4309980e0df36d5b55b620c487ff572f522 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:43:45 +0100 Subject: [PATCH 29/36] better placement for not creating HW config --- functions/fn_install_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_install_config b/functions/fn_install_config index 9ad27b52a..d91557360 100644 --- a/functions/fn_install_config +++ b/functions/fn_install_config @@ -151,10 +151,10 @@ echo "" } echo "" +if [ "${gamename}" != "Hurtworld" ]; then echo "Creating Configs" echo "=================================" sleep 1 -if [ "${gamename}" != "Hurtworld" ]; then mkdir -pv "${servercfgdir}" cd "${servercfgdir}" githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}" From 112bab51b74b2255f8f7e811559e5bfa64985103 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:49:37 +0100 Subject: [PATCH 30/36] reverting, removing hwunity3d --- GameServerQuery/gsquery.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GameServerQuery/gsquery.py b/GameServerQuery/gsquery.py index 70eb08951..a1380a5a7 100644 --- a/GameServerQuery/gsquery.py +++ b/GameServerQuery/gsquery.py @@ -27,8 +27,6 @@ class GameServer: self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' if self.option.engine == 'unity3d': self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' - if self.option.engine == 'hwunity3d': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' elif self.option.engine == 'unreal': self.query_prompt_string = '\x5C\x69\x6E\x66\x6F\x5C' elif self.option.engine == 'unreal2': @@ -103,7 +101,7 @@ if __name__ == '__main__': action = 'store', dest = 'engine', default = False, - help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, hwunity3d, unreal, unreal2.' + help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, unreal, unreal2.' ) parser.add_option( '-v', '--verbose', From 22c8d2357d8defa687060d46af8dbc3f43b30c1b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:53:06 +0100 Subject: [PATCH 31/36] updated message for gameworld to non critical form --- functions/fn_details_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fn_details_config b/functions/fn_details_config index f0be53cf8..dfab6de64 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -617,7 +617,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then if [ -n "${map}" ]; then gameworld="${map}" else - gameworld="\e[0;31mUNAVAILABLE\e[0m" + gameworld="NO MAP SET" fi # port From b4a40ecef4a3ef8bd73bc7d4e0bbe5bab1eb1ba0 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 02:59:15 +0100 Subject: [PATCH 32/36] support for hurtworld 7 Days To Die now monitors through gamename, as well as the new Hurtworld --- functions/fn_monitor_query | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/fn_monitor_query b/functions/fn_monitor_query index b75c6dba6..3bfb5077f 100644 --- a/functions/fn_monitor_query +++ b/functions/fn_monitor_query @@ -17,9 +17,12 @@ if [ -f "${rootdir}/gsquery.py" ]; then elif [ "${engine}" == "realvirtuality" ]; then queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd '[:digit:]') port=${queryport} - elif [ "${engine}" == "unity3d" ]; then + elif [ "${gamename}" == "7 Days To Die" ]; then gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd '[:digit:]') port=$((${gameport} + 1)) + elif [ "${gamename}" == "Hurtworld" ]; then + gameport="${port}" + port="${queryport}" fi fn_printinfo "Detected gsquery.py" fn_scriptlog "Detected gsquery.py" From de99b7ee8fc8c69964ea62764171104d96af3c8d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 03:12:18 +0100 Subject: [PATCH 33/36] Renamed unity3d to sdtd and check gamename instead --- functions/fn_details | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/fn_details b/functions/fn_details index c85c96559..30313d4e4 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -554,7 +554,7 @@ echo -e "" fn_details_statusbottom } -fn_details_unity3d(){ +fn_details_sdtd(){ fn_check_ip fn_parms fn_details_config @@ -756,14 +756,14 @@ elif [ "${engine}" == "teeworlds" ]; then fn_details_teeworlds elif [ "${engine}" == "terraria" ]; then fn_details_terraria -elif [ "${engine}" == "unity3d" ]; then - fn_details_unity3d elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then fn_details_unreal elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then fn_details_ark elif [ "${gamename}" == "Hurtworld" ]; then fn_details_hurtworld +elif [ "${gamename}" == "7 Days To Die" ]; then + fn_details_sdtd elif [ "${gamename}" == "Teamspeak 3" ]; then fn_details_teamspeak3 else From 310aba93f2628516c19b2493f790e852c92cd412 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 03:48:35 +0100 Subject: [PATCH 34/36] x64 mode, addadmins, more settings categories --- Hurtworld/hwserver | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 8b92753c3..6a01aabfb 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -23,23 +23,31 @@ email="email@example.com" steamuser="anonymous" steampass="" -# Start Variables +# Server settings servername="Hurtworld LGSM Server" ip="0.0.0.0" port="12871" queryport="12881" maxplayers="20" -map="" -creativemode="0" #Free Build (0 is off) -updateonstart="off" +map="" #Optional +creativemode="0" #Free Build -# Maintenance Variables -loadsave="" +# Adding first admins +# Syntax : addadmin STEAMID64; addadmin STEAMID64-bis +# Example : addadmin="addadmin 012345678901234567; addadmin 987654321098765432" +addadmin="" + +# Maintenance settings logfile="gamelog.txt" +loadsave="" + +# EXPERIMENTAL ! Use at your own risk +# Setting this to 1 runs the server with the x64 bits exectutable +x64mode="0" # http://hurtworld.wikia.com/wiki/Hosting_A_Server fn_parms(){ -parms="-batchmode -nographics -exec \"host ${port} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode}\" -logfile \"${logfile}\" " +parms="-batchmode -nographics -exec \"host ${port} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${addadmin}\" -logfile \"${logfile}\" " } #### Advanced Variables #### @@ -66,7 +74,11 @@ lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" -executable="./Hurtworld.x86" +if [ "${x64mode}" == "1" ]; then + executable="./Hurtworld.x86_64" +else + executable="./Hurtworld.x86" +fi backupdir="${rootdir}/backups" # Logging From df7fe2944211cbbe080663675ae0c5f778c5305d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 04:13:07 +0100 Subject: [PATCH 35/36] renamed addadmins to admins, save to loadsave, changed comments --- Hurtworld/hwserver | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 6a01aabfb..433e05619 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -31,23 +31,21 @@ queryport="12881" maxplayers="20" map="" #Optional creativemode="0" #Free Build +logfile="gamelog.txt" -# Adding first admins -# Syntax : addadmin STEAMID64; addadmin STEAMID64-bis -# Example : addadmin="addadmin 012345678901234567; addadmin 987654321098765432" -addadmin="" +# Adding admins using STEAMID64 +# Example : admins="addadmin 012345678901234567; addadmin 987654321098765432" +admins="" -# Maintenance settings -logfile="gamelog.txt" +# Advanced +# Rollback server state (remove after start command) loadsave="" - -# EXPERIMENTAL ! Use at your own risk -# Setting this to 1 runs the server with the x64 bits exectutable +# Use unstable 64 bit server executable (O/1) x64mode="0" # http://hurtworld.wikia.com/wiki/Hosting_A_Server fn_parms(){ -parms="-batchmode -nographics -exec \"host ${port} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${addadmin}\" -logfile \"${logfile}\" " +parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" " } #### Advanced Variables #### From a45936d8ff8b5317218808431f0c97eb157e0415 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 22 Dec 2015 04:16:59 +0100 Subject: [PATCH 36/36] removing quotes from a comment --- Hurtworld/hwserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 433e05619..e74f5648a 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -34,7 +34,7 @@ creativemode="0" #Free Build logfile="gamelog.txt" # Adding admins using STEAMID64 -# Example : admins="addadmin 012345678901234567; addadmin 987654321098765432" +# Example : addadmin 012345678901234567; addadmin 987654321098765432 admins="" # Advanced