Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Auto Update to use ManifestID and not BuildID #362

Merged
merged 4 commits into from
Feb 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fi
temp_file=$(mktemp)
http_code=$(curl https://api.steamcmd.net/v1/info/2394010 --output "$temp_file" --silent --location --write-out "%{http_code}")

CURRENTBUILD=$(awk '/buildid/{ print $2 }' < /palworld/steamapps/appmanifest_2394010.acf)
TARGETBUILD=$(grep -P '"public": {"buildid": "\d+"' -o <"$temp_file" | sed -r 's/.*("[0-9]+")$/\1/')
CURRENT_MANIFEST=$(awk '/manifest/{count++} count==2 {print $2; exit}' /palworld/steamapps/appmanifest_2394010.acf)
TARGET_MANIFEST=$(grep -Po '"2394012".*"gid": "\d+"' <"$temp_file" | sed -r 's/.*("[0-9]+")$/\1/')
rm "$temp_file"

if [ "$http_code" -ne 200 ]; then
Expand All @@ -25,23 +25,23 @@ if [ "$http_code" -ne 200 ]; then
exit 1
fi

if [ -z "$TARGETBUILD" ]; then
if [ -z "$TARGET_MANIFEST" ]; then
echo "The server response does not contain the expected BuildID. Unable to check for updates!"
if [ -n "${DISCORD_WEBHOOK_URL}" ]; then
/home/steam/server/discord.sh "Steam servers response does not contain the expected BuildID. Unable to check for updates!" "failure" &
fi
exit 1
fi

if [ "$CURRENTBUILD" != "$TARGETBUILD" ]; then
echo "player count: $(get_player_count)"
if [ "$CURRENT_MANIFEST" != "$TARGET_MANIFEST" ]; then
if [ "${RCON_ENABLED,,}" != true ]; then
echo "An update is available however auto updating without rcon is not supported"
if [ -n "${DISCORD_WEBHOOK_URL}" ]; then
/home/steam/server/discord.sh "An update is available however auto updating without rcon is not supported" "warn"
fi
exit 0
fi
echo "New Build was found. Updating the server from $CURRENTBUILD to $TARGETBUILD."
echo "New Build was found. Updating the server from $CURRENT_MANIFEST to $TARGET_MANIFEST."
rm /palworld/steamapps/appmanifest_2394010.acf

if [ "$(get_player_count)" -gt 0 ]; then
Expand Down