Skip to content
Open
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
62 changes: 41 additions & 21 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,54 @@ source "${SCRIPTSDIR}/mod-manager.sh"

mkdir -p "${STEAMAPPDIR}" || true

# Initialize arguments array
args=(
"+@sSteamCmdForcePlatformType" "linux"
"+@sSteamCmdForcePlatformBitness" "64"
"+force_install_dir" "$STEAMAPPDIR"
"+login" "anonymous"
"+app_update" "$STEAMAPPID" "validate"
"+app_update" "$STEAMAPPID_TOOL" "validate"
)

# Override SteamCMD launch arguments if necessary
# Used for subscribing to betas or for testing
if [ -n "$STEAMCMD_UPDATE_ARGS" ]; then
args+=("${STEAMCMD_UPDATE_ARGS[@]}")
fi
NEEDS_VALIDATION=false

# Add the quit command
args+=("+quit")
if [ ! -f "${STEAMAPPDIR}/CoreKeeperServer" ]; then
NEEDS_VALIDATION=true
fi

# Run SteamCMD with the arguments
if [ "${USE_DEPOT_DOWNLOADER}" == true ]; then
DepotDownloader -app $STEAMAPPID -osarch 64 -dir $STEAMAPPDIR -validate
DepotDownloader -app $STEAMAPPID_TOOL -osarch 64 -dir $STEAMAPPDIR -validate
chmod +x $STEAMAPPDIR/CoreKeeperServer
app_args=("-app" "$STEAMAPPID" "-osarch" "64" "-dir" "$STEAMAPPDIR")
tool_args=("-app" "$STEAMAPPID_TOOL" "-osarch" "64" "-dir" "$STEAMAPPDIR")

if [ "$NEEDS_VALIDATION" == true ]; then
app_args+=("-validate")
tool_args+=("-validate")
fi

DepotDownloader "${app_args[@]}"
DepotDownloader "${tool_args[@]}"

else
args=(
"+@sSteamCmdForcePlatformType" "linux"
"+@sSteamCmdForcePlatformBitness" "64"
"+force_install_dir" "$STEAMAPPDIR"
"+login" "anonymous"
)

app_args=("+app_update" "$STEAMAPPID")
tool_args=("+app_update" "$STEAMAPPID_TOOL")

if [ "$NEEDS_VALIDATION" == true ]; then
app_args+=("validate")
tool_args+=("validate")
fi

args+=("${app_args[@]}")
args+=("${tool_args[@]}")

if [ -n "$STEAMCMD_UPDATE_ARGS" ]; then
args+=("${STEAMCMD_UPDATE_ARGS[@]}")
fi

args+=("+quit")

"$STEAMCMDDIR/steamcmd.sh" "${args[@]}"
fi

chmod +x "$STEAMAPPDIR/CoreKeeperServer"

manage_mods

exec bash "${SCRIPTSDIR}/launch.sh"