diff --git a/common/_v2-entry-point b/common/_v2-entry-point index a17e334b903ab2e6336a79c5eb3e657dfb449f5b..2e25229b0c34394858e364a32f565036b7f4f467 100755 --- a/common/_v2-entry-point +++ b/common/_v2-entry-point @@ -222,24 +222,11 @@ verbose "STEAM_COMPAT_SESSION_ID=${STEAM_COMPAT_SESSION_ID-}" # Used to create sockets. verbose "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR-}" -relaunch= - if [ -z "${STEAM_COMPAT_SESSION_ID-}" ]; then info "Non-session mode, behaving like the main program" is_main=yes elif [ -n "$is_main" ]; then info "Main program in session mode" - # Use the relaunch mode by default - case "${PRESSURE_VESSEL_RELAUNCH_CONTAINER-1}" in - (1) - relaunch=yes - ;; - (0) - ;; - (*) - echo "\$PRESSURE_VESSEL_RELAUNCH_CONTAINER should be either 0 or 1" >&2 - ;; - esac else verbose "Setup program in session mode" fi @@ -360,21 +347,15 @@ terminate_container () { --terminate } -if [ -n "$relaunch" ]; then +if [ -n "$is_main" ]; then info "Terminating and re-launching container for main game" terminate_container || : exec_container "$@" # not reached fi -if [ -n "$is_main" ]; then - trap terminate_container EXIT -fi - # Launch the pressure-vessel-launcher(1). This is used to run the -# setup commands (--verb=run), if any. If not requested via -# PRESSURE_VESSEL_RELAUNCH_CONTAINER=1, it is also used to run the -# actual game. +# setup commands (--verb=run), if any. # # We have to launch pressure-vessel-launcher(1) *without* setting # SteamAppId, SteamAppUser, etc., otherwise Steam will think the game @@ -405,41 +386,10 @@ env \ --terminate-timeout=2 \ ${NULL+} -launch_args=( \ -) - -if [ -n "$is_main" ]; then - if [ "${SteamAppId-}" != "${STEAM_COMPAT_APP_ID-}" ]; then - log "Mismatch: SteamAppId=${SteamAppId-}, STEAM_COMPAT_APP_ID=${STEAM_COMPAT_APP_ID-}" - exit 125 - fi - - launch_args=( \ - ${launch_args[0]+"${launch_args[@]}"} \ - --pass-env-matching '*' \ - --terminate \ - ) - - # For the main game we wait for all processes to terminate before - # shutting down the container. - set -- \ - "$pressure_vessel/bin/pressure-vessel-adverb" \ - ${PRESSURE_VESSEL_SHELL+--shell="$PRESSURE_VESSEL_SHELL"} \ - ${PRESSURE_VESSEL_TERMINAL+--terminal="$PRESSURE_VESSEL_TERMINAL"} \ - --subreaper \ - -- \ - "$@" -else - launch_args=( \ - ${launch_args[0]+"${launch_args[@]}"} \ - --unset-env LD_PRELOAD \ - ) -fi - exec "$pressure_vessel/bin/pressure-vessel-launch" \ --directory="$(pwd)" \ --socket="$rendezvous/socket" \ - ${launch_args[0]+"${launch_args[@]}"} \ + --unset-env LD_PRELOAD \ -- \ "$@" exit 125