Browse Source

Adding beta and workshop support for Source engine games

pull/553/head
Jared Ballou 10 years ago
parent
commit
5b09a144fc
  1. 4
      functions/command_validate.sh
  2. 33
      functions/fix.sh
  3. 26
      functions/game_settings.sh
  4. 10
      functions/install_serverfiles.sh
  5. 4
      functions/update_dl.sh
  6. 2
      gamedata/_halflife_shared
  7. 10
      gamedata/_parms_plusminus
  8. 12
      gamedata/insserver

4
functions/command_validate.sh

@ -29,9 +29,9 @@ if [ $(command -v unbuffer) ]; then
fi
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}"
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid} -beta ${beta}" +app_update "${appid} -beta ${beta}" validate +quit|tee -a "${scriptlog}"
else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}"
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid} -beta ${beta}" validate +quit|tee -a "${scriptlog}"
fi
fix.sh

33
functions/fix.sh

@ -2,17 +2,22 @@
# LGSM fix.sh function
# Author: Daniel Gibbs
# Website: http://gameservermanagers.com
lgsm_version="020116"
lgsm_version="260116"
# Description: Overall function for managing fixes.
# Runs functions that will fix an issue.
# Fixes that are run on start
if [ "${function_selfname}" != "command_install.sh" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fn_fix_game_dependencies
fix_glibc.sh
if [ ! -z "${appid}" ]; then
fix_steamcmd.sh
fi
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
startfix=1
fix_csgo.sh
@ -22,35 +27,13 @@ if [ "${function_selfname}" != "command_install.sh" ]; then
fix_ins.sh
elif [ "${gamename}" == "ARMA 3" ]; then
fix_arma3.sh
fi
fi
# Fixes that are run on install only.
if [ "${function_selfname}" == "command_install.sh" ]; then
fix_glibc.sh
if [ "${gamename}" == "Killing Floor" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
elif [ "${gamename}" == "Killing Floor" ]; then
fix_kf.sh
elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fix_ro.sh
elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fix_ut2k4.sh
elif [ "${gamename}" == "Unreal Tournament 99" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fix_ut99.sh
fi
fi

26
functions/game_settings.sh

@ -124,6 +124,32 @@ fn_get_game_params(){
param_default=$3
}
# Fix dependency files for game
fn_fix_game_dependencies() {
depfile="${settingsdir}/dependencies"
# If no dependency list, skip out
if [ ! -e "${depfile}" ]; then
return
fi
# If the directory doesn't yet exist, exit the function.
# This is so that we wait until the game is installed before putting these files in place
if [ ! -e "${dependency_path}" ]; then
return
fi
while read -r line; do
filename=$(echo $line | cut -d'=' -f1)
md5sum=$(echo $line | cut -d'"' -f2)
remote_path="dependencies/${filename}.${md5sum}"
local_path="${dependency_path}/${filename}"
local_md5="$(md5sum "${local_path}" | awk '{print $1}')"
echo "Checking ${filename} for ${md5sum}"
if [ "${local_md5}" != "${md5sum}" ]; then
fn_getgithubfile "${local_path}" 0 "${remote_path}" 1
fi
done < $depfile
}
# Flush old setings buffer
fn_flush_game_settings

10
functions/install_serverfiles.sh

@ -37,15 +37,15 @@ while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .finstall_serverfiles.sh.tmp)
if [ "${counter}" -le "4" ]; then
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
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid} -beta ${beta}" +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} -beta ${beta}" +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
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid} -beta ${beta}" -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} -beta ${beta}" -validate +quit |tee .finstall_serverfiles.sh.tmp
fi
fi
elif [ "${counter}" -ge "11" ]; then
@ -61,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_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid} -beta ${beta}" -validate +quit |tee .finstall_serverfiles.sh.tmp
done
fi
rm -f .finstall_serverfiles.sh.tmp

4
functions/update_dl.sh

@ -19,9 +19,9 @@ if [ $(command -v unbuffer) ]; then
fi
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}"
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid} -beta ${beta}" +quit|tee -a "${scriptlog}"
else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}"
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid} -beta ${beta}" +quit|tee -a "${scriptlog}"
fi
fix.sh

2
gamedata/_halflife_shared

@ -13,7 +13,7 @@ fn_set_game_params settings "dependency_path" "${filesdir}/bin"
# The parms that start with - go first
fn_set_game_params parms_minus "game" "\${game}"
fn_set_game_params parms_minus "strictportbind" "--EMPTY--"
fn_set_game_params parms_minus "strictportbind" " "
fn_set_game_params parms_minus "ip" "\${ip}"
fn_set_game_params parms_minus "port" "\${port}"
fn_set_game_params parms_minus "maxplayers" "\${maxplayers}"

10
gamedata/_parms_plusminus

@ -2,9 +2,15 @@
# _parms_plusminus
# Parameter parsing with "+" and "-" sorting
# Process parameter list
fn_process_parmlist(){
prefix=$1
file=$2
echo $(grep -v '=""$' "${file}" | sed -e "s/^\([^#=]\+\)=\"/${prefix}\1 /g" -e 's/\"$//g')
}
# This is the way we create a script that collates and parses the parameters
fn_parms(){
parms_minus="$(echo $(sed -e 's/^\([^#=]\+\)=\"/\-\1 /g' -e 's/\"$//g' ${settingsdir}/parms_minus))"
parms_plus="$(echo $(sed -e 's/^\([^#=]\+\)=\"/\+\1 /g' -e 's/\"$//g' ${settingsdir}/parms_plus))"
parms_minus="$(fn_process_parmlist "\-" ${settingsdir}/parms_minus)"
parms_plus="$(fn_process_parmlist "\+" ${settingsdir}/parms_plus)"
parms="$(eval "echo \"${parms_minus} ${server_parms} ${parms_plus}\"")"
}

12
gamedata/insserver

@ -18,9 +18,17 @@ fn_set_game_params settings "game" "insurgency"
fn_set_game_params settings "gamename" "Insurgency"
# Add playlist parameter
fn_set_game_params parms_plus "sv_playlist" "\${playlist}"
fn_set_game_params settings "playlist" "custom" "Server Playlist"
fn_set_game_params parms_plus "sv_playlist" "\${sv_playlist}"
fn_set_game_params settings "sv_playlist" "custom" "Server Playlist"
# Mapcycle
fn_set_game_params params_plus "mapcyclefile" "\${mapcyclefile}"
fn_set_game_params settings "mapcyclefile" "mapcycle_cooperative.txt" "Mapcycle File"
# Workshop
fn_set_game_params parms_plus "sv_workshop_enabled" "--EMPTY--" "Comma-delimited list of workshop items to subscribe to"
# Beta
fn_set_game_params parms_minus "beta" "\${beta}"
fn_set_game_params settings "beta" "--EMPTY--" "Beta branch to use. Leave empty for stable branch"

Loading…
Cancel
Save