From dbbfb78d96c3df6784152360a427d6fda47cf9e5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Jul 2015 22:55:02 +0100 Subject: [PATCH] goldsource issue #438 Improvements to reliability of server downloads. --- CounterStrike/csserver | 3 ++- CounterStrikeConditionZero/csczserver | 3 ++- DayOfDefeat/dodserver | 3 ++- DeathmatchClassic/dmcserver | 3 ++- OpposingForce/opforserver | 3 ++- Ricochet/ricochetserver | 3 ++- TeamFortressClassic/tfcserver | 3 ++- functions/fn_install_serverfiles | 18 +++++++++++++----- functions/fn_update_dl | 9 +++++++-- functions/fn_validate | 9 +++++++-- 10 files changed, 41 insertions(+), 16 deletions(-) diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 0d302b0ba..c32fbd252 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -32,7 +32,8 @@ parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clien #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod cstrike" +appid="90" +appidmod="cstrike" # Server Details servicename="cs-server" diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 9478c9aa6..40c5d9bb1 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -32,7 +32,8 @@ parms="-game czero -strictportbind -ip ${ip} -port ${port} +clientport ${clientp #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod czero" +appid="90" +appidmod="czero" # Server Details servicename="cscz-server" diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index 5ec085351..7252ec515 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -32,7 +32,8 @@ parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod dod" +appid="90" +appidmod="dod" # Server Details servicename="dod-server" diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index 7f7073e58..7c0be85e1 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -32,7 +32,8 @@ parms="-game dmc -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod dmc" +appid="90" +appidmod="dmc" # Server Details servicename="dmc-server" diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index b2dcd2eb6..f3d1478b4 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -32,7 +32,8 @@ parms="-game gearbox -strictportbind -ip ${ip} -port ${port} +clientport ${clien #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod gearbox" +appid="90" +appidmod="gearbox" # Server Details servicename="opfor-server" diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index 08cce8bd0..6149a4fed 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -32,7 +32,8 @@ parms="-game ricochet -strictportbind -ip ${ip} -port ${port} +clientport ${clie #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod ricochet" +appid="90" +appidmod="ricochet" # Server Details servicename="ricochet-server" diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 0ef76ca72..f805e07ca 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -32,7 +32,8 @@ parms="-game tfc -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor #### Advanced Variables #### # Steam -appid="90 +app_set_config 90 mod tfc" +appid="90" +appidmos="tfc" # Server Details servicename="tfc-server" diff --git a/functions/fn_install_serverfiles b/functions/fn_install_serverfiles index 413c33acd..ffeeebdd1 100644 --- a/functions/fn_install_serverfiles +++ b/functions/fn_install_serverfiles @@ -2,7 +2,7 @@ # LGSM fn_install_serverfiles function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 030615 +# Version: 040715 fn_steaminstallcommand(){ fn_check_steamuser @@ -36,9 +36,17 @@ while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_install_serverfiles.tmp)" fi if [ "${counter}" -le "4" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_install_serverfiles.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 .fn_install_serverfiles.tmp + else + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_install_serverfiles.tmp + fi elif [ "${counter}" -ge "5" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp + 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 .fn_install_serverfiles.tmp + else + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp + fi fi elif [ "${counter}" -ge "11" ]; then fn_printfailurenl "SteamCMD did not complete the download, too many retrys" @@ -53,7 +61,7 @@ if [ "${engine}" == "goldsource" ]; then counter="0" while [ "${counter}" -le "4" ]; do counter=$((counter+1)) - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp done fi rm -f .fn_install_serverfiles.tmp @@ -77,4 +85,4 @@ if [ -z "${autoinstall}" ]; then * ) echo "Please answer yes or no.";; esac done -fi \ No newline at end of file +fi diff --git a/functions/fn_update_dl b/functions/fn_update_dl index c7c8da8c3..c4500c331 100644 --- a/functions/fn_update_dl +++ b/functions/fn_update_dl @@ -2,7 +2,7 @@ # LGSM fn_update_dl function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 280515 +# Version: 040715 # Description: Runs a server update. @@ -25,7 +25,12 @@ if [ $(command -v unbuffer) ]; then unbuffer=unbuffer fi -${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}" +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 -a "${scriptlog}" +else + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}" +fi + if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then echo -e '\n' diff --git a/functions/fn_validate b/functions/fn_validate index 1850d6f67..8ca411660 100644 --- a/functions/fn_validate +++ b/functions/fn_validate @@ -2,7 +2,7 @@ # LGSM fn_validate function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 280515 +# Version: 040715 # Description: Runs a server validation. @@ -29,7 +29,12 @@ if [ $(command -v unbuffer) ]; then unbuffer=unbuffer fi -${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" +if [ "${engine}" == "goldsource" ]; then + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" +else + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" +fi + if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then echo -e '\n' fn_csgofix