From 3fa535f88ea00512ce35a064f93fc3bcabe42efd Mon Sep 17 00:00:00 2001 From: DrCox1911 Date: Sat, 23 Apr 2016 22:59:56 +0200 Subject: [PATCH 1/3] Support for branch added Added the support to opt in to different branches like iwillbackupmysave. Change in install_serverfiles.sh is also needed to reflect this! --- ProjectZomboid/pzserver | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 701827e96..d719944cd 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -42,6 +42,9 @@ githubbranch="master" # Steam appid="380870" +# Allows for opting into the various Steam branches that PZ has to offer +# Example: -beta iwillbackupmysave -betapassword iaccepttheconsequences +branch="" # Server Details servicename="pz-server" From 5e4728c8c83ee04d4c747eeb3de8bf58ae048326 Mon Sep 17 00:00:00 2001 From: DrCox1911 Date: Sun, 24 Apr 2016 00:23:27 +0200 Subject: [PATCH 2/3] Added branch variable Ability to opt in to different branches of a steamgame, e.g. iwillbackupmysave branch from Project Zomboid. To us this you have to add a variable named "branch" to your gameserverscript. --- functions/install_serverfiles.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/install_serverfiles.sh b/functions/install_serverfiles.sh index 24677da9c..3e4bb9dc8 100644 --- a/functions/install_serverfiles.sh +++ b/functions/install_serverfiles.sh @@ -39,13 +39,13 @@ while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .finstall_serverfiles.sh.tmp) if [ "${engine}" == "goldsource" ]; then ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit |tee .finstall_serverfiles.sh.tmp else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .finstall_serverfiles.sh.tmp + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit |tee .finstall_serverfiles.sh.tmp fi elif [ "${counter}" -ge "5" ]; then if [ "${engine}" == "goldsource" ]; then ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} -validate +quit |tee .finstall_serverfiles.sh.tmp fi fi elif [ "${counter}" -ge "11" ]; then From 090d247dcb87fea2a4b97ba52424494ba4b427a1 Mon Sep 17 00:00:00 2001 From: DrCox1911 Date: Sun, 24 Apr 2016 00:54:14 +0200 Subject: [PATCH 3/3] Steam branch handling added Added ability to handle steam branches, needs my other changes to install_serverfiles and gameserverscript as well. --- functions/update_check.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/functions/update_check.sh b/functions/update_check.sh index 4c631657e..0e2a3a40d 100644 --- a/functions/update_check.sh +++ b/functions/update_check.sh @@ -120,7 +120,16 @@ cd "${rootdir}/steamcmd" if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then rm -f "${HOME}/Steam/appcache/appinfo.vdf" fi -availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"public\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + +# set branch for updateinfo +IFS=' ' read -a branchsplits <<< "${branch}" +if [ "${#branchsplits[@]}" -gt 1 ]; then + branchname="${branchsplits[1]}" +else + branchname="public" +fi + +availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) if [ -z "${availablebuild}" ]; then fn_printfail "Checking for update: SteamCMD" fn_scriptlog "Failure! Checking for update: SteamCMD"