mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-15 03:58:27 +00:00
Get current version from appmanifest_${appid}.acf
forceUpdate had a window of time between initiating the update and getting the current version where it could miss an update. Close that window by getting the installed version from the appmanifest file.
This commit is contained in:
parent
ad9a1a4587
commit
95510e0fa0
@ -85,22 +85,12 @@ function isUpdateNeeded(){
|
||||
}
|
||||
|
||||
#
|
||||
# Return the current version number
|
||||
# Parse an ACF structure
|
||||
# $1 is the desired path
|
||||
# $2 is the desired property
|
||||
# $3 is the current path
|
||||
#
|
||||
function getCurrentVersion(){
|
||||
cd "$arkserverroot"
|
||||
if ! [ -f arkversion ];then
|
||||
touch arkversion
|
||||
fi
|
||||
instver=`cat "arkversion"`
|
||||
return $instver
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
# Parse the buildid from steamcmd
|
||||
#
|
||||
function parseSteamAppVer(){
|
||||
function parseSteamACF(){
|
||||
local sname
|
||||
while read name val; do
|
||||
name="${name#\"}"
|
||||
@ -110,9 +100,9 @@ function parseSteamAppVer(){
|
||||
if [ "$name" = "}" ]; then
|
||||
break
|
||||
elif [ "$name" == "{" ]; then
|
||||
parseSteamAppVer "${1}.${sname}"
|
||||
parseSteamACF "$1" "$2" "${3}.${sname}"
|
||||
else
|
||||
if [ "$1" == ".depots.branches.public" -a "$name" == "buildid" ]; then
|
||||
if [ "$3" == "$1" -a "$name" == "$2" ]; then
|
||||
echo "$val"
|
||||
break
|
||||
fi
|
||||
@ -121,11 +111,23 @@ function parseSteamAppVer(){
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# Return the current version number
|
||||
#
|
||||
function getCurrentVersion(){
|
||||
if [ -f "${arkserverroot}/steamapps/appmanifest_${appid}.acf" ]; then
|
||||
instver=`while read name val; do if [ "${name}" == "{" ]; then parseSteamACF "" "buildid"; break; fi; done <"${arkserverroot}/steamapps/appmanifest_${appid}.acf"`
|
||||
else
|
||||
instver=""
|
||||
fi
|
||||
return $instver
|
||||
}
|
||||
|
||||
#
|
||||
# Get the current available server version on steamdb
|
||||
#
|
||||
function getAvailableVersion(){
|
||||
bnumber=`$steamcmdroot/$steamcmdexec +login anonymous +app_info_print "$appid" +quit | while read name val; do if [ "${name}" == "{" ]; then parseSteamAppVer; break; fi; done`
|
||||
bnumber=`$steamcmdroot/$steamcmdexec +login anonymous +app_info_print "$appid" +quit | while read name val; do if [ "${name}" == "{" ]; then parseSteamACF ".depots.branches.public" "buildid"; break; fi; done`
|
||||
return $bnumber
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user