Read current beta / branch from app manifest

This commit is contained in:
Ben Peddell 2017-11-03 22:01:17 +10:00
parent a6089466d2
commit cbec220639

View File

@ -632,11 +632,32 @@ function getStagingVersion(){
fi
}
#
# Return the installed beta / branch
#
function getCurrentBranch(){
if [ -f "${arkserverroot}/steamapps/appmanifest_${appid}.acf" ]; then
while read name val; do if [ "${name}" == "{" ]; then parseSteamACF "UserConfig" "betakey"; break; fi; done <"${arkserverroot}/steamapps/appmanifest_${appid}.acf"
fi
}
#
# Return the installed beta / branch in staging directory
#
function getCurrentBranch(){
if [ -f "${arkStagingDir}/steamapps/appmanifest_${appid}.acf" ]; then
while read name val; do if [ "${name}" == "{" ]; then parseSteamACF "UserConfig" "betakey"; break; fi; done <"${arkStagingDir}/steamapps/appmanifest_${appid}.acf"
fi
}
#
# Get the current available server version on steamdb
#
function getAvailableVersion(){
rm -f "$steamcmd_appinfocache"
if [ -z "$appbranch" ]; then
appbranch="$(getCurrentBranch)"
fi
runSteamCMD +app_info_update 1 +app_info_print "$appid" +quit | while read name val; do if [ "${name}" == "{" ]; then parseSteamACF ".depots.branches.${appbranch:-public}" "buildid"; break; fi; done
}
@ -736,6 +757,9 @@ function getSavedArksDirectory(){
#
function checkUpdateManifests(){
appinfo="$(runSteamCMD +app_info_print "$appid" +quit)"
if [ -z "$appbranch" ]; then
appbranch="$(getCurrentBranch)"
fi
while read depot manifest <&3; do
newmanifest="$(echo "${appinfo}" | while read name val; do if [ "${name}" == "{" ]; then parseSteamACF ".depots.${depot}.manifests" "${appbranch:-public}"; break; fi; done)"
if [[ -z "${newmanifest}" && "${appbranch:-public}" != "public" ]]; then
@ -2891,7 +2915,11 @@ printStatus(){
instver="$(getCurrentVersion)"
echo -e "$NORMAL" "Server build ID: " "$GREEN" $instver "$NORMAL"
if false && [ -f "$arkserverroot/version.txt" ]; then
instbeta="$(getCurrentBranch)"
if [ -n "$instbeta" ]; then
echo -e "$NORMAL" "Server branch: " "$GREEN" "$instbeta" "$NORMAL"
fi
if [ -f "$arkserverroot/version.txt" ]; then
echo -e "$NORMAL" "Server version: " "$GREEN" "$(<"$arkserverroot/version.txt")" "$NORMAL"
fi
}