Skip to content

Commit b346e68

Browse files
committed
fix(core_dl): address baseappid download issues in steamcmd
- Move baseappid block before branch/betapassword checks so base app is always installed first when baseappid is set, regardless of whether branch/betapassword are also configured - Capture PIPESTATUS[0] after base app download and continue the retry loop on failure, preventing a failed base app install from being masked by a successful main app install - Add guard: fail with a clear message when baseappid is set but supportdir is empty/unset
1 parent 2d0a037 commit b346e68

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

lgsm/modules/core_dl.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,45 @@ fn_dl_steamcmd() {
8181
fi
8282
# Force Windows Platform type.
8383
elif [ "${steamcmdforcewindows}" == "yes" ]; then
84+
# If a base app is required, install it first.
85+
if [ -n "${baseappid}" ]; then
86+
if [ -z "${supportdir}" ]; then
87+
fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
88+
fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
89+
core_exit.sh
90+
fi
91+
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
92+
exitcode="${PIPESTATUS[0]}"
93+
if [ "${exitcode}" -ne 0 ]; then
94+
continue
95+
fi
96+
fi
8497
if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then
8598
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
8699
elif [ -n "${branch}" ]; then
87100
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
88-
elif [ -n "${baseappid}" ]; then
89-
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
90-
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
91101
else
92102
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
93103
fi
94104
# All other servers.
95105
else
106+
# If a base app is required, install it first.
107+
if [ -n "${baseappid}" ]; then
108+
if [ -z "${supportdir}" ]; then
109+
fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
110+
fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined"
111+
core_exit.sh
112+
fi
113+
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
114+
exitcode="${PIPESTATUS[0]}"
115+
if [ "${exitcode}" -ne 0 ]; then
116+
continue
117+
fi
118+
fi
96119
if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then
97120
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
98121
elif [ -n "${branch}" ]; then
99122
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
100-
elif [ -n "${baseappid}" ]; then
101-
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
102-
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
103123
else
104124
"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
105125
fi

0 commit comments

Comments
 (0)