#!/bin/bash # Downloads SteamCMD, downloads/updates the 7dtd engine sdtdCommandUpdateengine() { local FORCED=no local CHECKONLY=no if [ "$1" = "--force" ]; then FORCED=yes fi if [ ! -e $SDTD_BASE/steamcmd ]; then mkdir $SDTD_BASE/steamcmd cd /tmp wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz tar -xvzf steamcmd_linux.tar.gz -C $SDTD_BASE/steamcmd cd $SDTD_BASE/steamcmd ./steamcmd.sh +quit fi if [ "$1" = "--check" -o "$2" = "--check" ]; then local LOCAL=$(getLocalEngineVersion) local REMOTE=$(getRemoteEngineVersion) if [ $REMOTE -gt $LOCAL ]; then echo "Newer engine version available." else echo "Engine up to date." fi echo "Local buildid: $LOCAL" echo "Available buildid: $REMOTE" return fi for I in $(getInstanceList); do if [ $(isRunning $I) -eq 1 ]; then echo "At least one instance is still running (\"$I\")." echo "Before updating the engine please stop all instances!" return fi done local LOCAL=$(getLocalEngineVersion) local REMOTE=$(getRemoteEngineVersion) if [ "$FORCED" = "yes" -o $REMOTE -gt $LOCAL ]; then echo "A newer version of the engine is available." echo "Local buildid: $LOCAL" echo "Available buildid: $REMOTE" echo while : ; do local CONTINUE read -p "Continue? (yn) " CONTINUE case $CONTINUE in y) echo "Updating..." break ;; n) echo "Canceled" return ;; *) echo "Wrong input" esac done cd $SDTD_BASE/steamcmd ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login $STEAM_USER $STEAM_PASS +force_install_dir $SDTD_BASE/engine "+app_update 294420" validate +quit cp $SDTD_BASE/linux_files/engine/* $SDTD_BASE/engine/ -R cp $SDTD_BASE/engine/Install/32bit/SteamworksManaged.dll $SDTD_BASE/engine/7DaysToDie_Data/Managed/ chown $SDTD_USER.$SDTD_GROUP -R $SDTD_BASE/engine else echo "Engine is already at the newest build (local: $LOCAL, remote: $REMOTE)." fi } sdtdCommandUpdateengineHelp() { echo "Usage: $(basename $0) updateengine [--force | --check]" echo echo "Check for a newer version of engine (aka game) files of 7dtd. If there is a newer" echo "version they can be updated by this command." echo echo "If --force is specified you are asked if you want to redownload the engine" echo "even if there is no new version available." echo echo "If --check is specified it will only output the current local and remote build ids" echo "and if an update is available." } sdtdCommandUpdateengineDescription() { echo "Update the 7dtd engine files" } sdtdCommandUpdateengineExpects() { case $1 in 2) echo "--force --check" ;; esac }