فهرست منبع

fix(steamcmd): work around Invalid platform errors (L4D2) (#4979)

* fix(steamcmd): work around Invalid platform errors (L4D2)

SteamCMD fails some app installs on Linux with "Failed to install app
'222860' (Invalid platform)", a long-standing SteamCMD bug
(ValveSoftware/steam-for-linux#11522) that breaks every new Left 4 Dead
2 install. The known workaround is to download the Windows depot once,
then update and validate as Linux.

When SteamCMD reports Invalid platform, run app_update once with
+@sSteamCmdForcePlatformType windows, then retry the normal Linux
update with validate. The workaround runs at most once per download.

Fixes #4754

* fix(steamcmd): run the Invalid platform workaround before the fatal check

The existing Invalid platform branch exits, and it came first in the
chain, so the workaround was never reached. Move the workaround above
it; the fatal branch still catches a repeat or forced-Windows case.

* fix(steamcmd): keep the Invalid platform workaround to one attempt per download

Make invalidplatformworkaround local to fn_dl_steamcmd. Manifest repair
calls the downloader several times, and a global flag stopped later
downloads from trying the workaround.
Daniel Gibbs 1 هفته پیش
والد
کامیت
b8007e8aa2
1فایلهای تغییر یافته به همراه11 افزوده شده و 1 حذف شده
  1. 11 1
      lgsm/modules/core_dl.sh

+ 11 - 1
lgsm/modules/core_dl.sh

@@ -65,6 +65,7 @@ fn_dl_steamcmd() {
 	if [ -f "${steamcmdlog}" ]; then
 		rm -f "${steamcmdlog:?}"
 	fi
+	local invalidplatformworkaround=""
 	counter=0
 	while [ "${counter}" -eq 0 ] || [ "${exitcode}" -ne 0 ]; do
 		counter=$((counter + 1))
@@ -139,7 +140,16 @@ fn_dl_steamcmd() {
 				fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files"
 				fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files"
 				core_exit.sh
-			# Invalid platform for app/update request.
+			# Invalid platform (SteamCMD bug, e.g. Left 4 Dead 2): retry once after a Windows platform download.
+			elif [ -n "$(grep -i "Invalid platform" "${steamcmdlog}" | tail -1)" ] && [ "${steamcmdforcewindows}" != "yes" ] && [ -z "${invalidplatformworkaround}" ]; then
+				invalidplatformworkaround="1"
+				fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Invalid platform - applying SteamCMD Windows platform workaround"
+				fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Invalid platform - applying SteamCMD Windows platform workaround"
+				"${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
+				validateparam=("validate")
+				rm -f "${steamcmdlog:?}"
+				counter=0
+			# Invalid platform for app/update request (after the workaround, or when forcing Windows).
 			elif [ -n "$(grep -i "Invalid platform" "${steamcmdlog}" | tail -1)" ]; then
 				fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Invalid platform for AppID ${appid}"
 				fn_print_nl "Check steamcmdforcewindows setting and system architecture (x86_64 required for most servers)"