From feb0f19e0da8b2966e5c830c2c214743bcedb709 Mon Sep 17 00:00:00 2001 From: NicknineTheEagle Date: Wed, 29 Apr 2020 15:56:28 +0300 Subject: [PATCH] Added -osarch parameter --- DepotDownloader/ContentDownloader.cs | 12 ++++++++++-- DepotDownloader/Program.cs | 5 ++++- DepotDownloader/Util.cs | 5 +++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 6534b4a4..f2691517 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -386,7 +386,7 @@ namespace DepotDownloader if ( details.hcontent_file > 0 ) { - await DownloadAppAsync( details.consumer_appid, details.consumer_appid, details.hcontent_file, DEFAULT_BRANCH, null, null, false, true ); + await DownloadAppAsync( details.consumer_appid, details.consumer_appid, details.hcontent_file, DEFAULT_BRANCH, null, null, null, false, true ); } else { @@ -394,7 +394,7 @@ namespace DepotDownloader } } - public static async Task DownloadAppAsync( uint appId, uint depotId, ulong manifestId, string branch, string os, string language, bool lv, bool isUgc ) + public static async Task DownloadAppAsync( uint appId, uint depotId, ulong manifestId, string branch, string os, string arch, string language, bool lv, bool isUgc ) { // Load our configuration data containing the depots currently installed string configPath = ContentDownloader.Config.InstallDirectory; @@ -465,6 +465,14 @@ namespace DepotDownloader continue; } + if ( depotConfig["osarch"] != KeyValue.Invalid && + !string.IsNullOrWhiteSpace( depotConfig["osarch"].Value ) ) + { + var depotArch = depotConfig["osarch"].Value; + if ( depotArch != ( arch ?? Util.GetSteamArch() ) ) + continue; + } + if ( !Config.DownloadAllLanguages && depotConfig["language"] != KeyValue.Invalid && !string.IsNullOrWhiteSpace( depotConfig["language"].Value ) ) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index 854dd14a..a3629a39 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -165,6 +165,9 @@ namespace DepotDownloader Console.WriteLine("Error: Cannot specify -os when -all-platforms is specified."); return 1; } + + string arch = GetParameter( args, "-osarch", null ); + ContentDownloader.Config.DownloadAllLanguages = HasParameter( args, "-all-languages" ); string language = GetParameter( args, "-language", null ); @@ -207,7 +210,7 @@ namespace DepotDownloader { try { - await ContentDownloader.DownloadAppAsync( appId, depotId, manifestId, branch, os, language, lv, isUGC ).ConfigureAwait( false ); + await ContentDownloader.DownloadAppAsync( appId, depotId, manifestId, branch, os, arch, language, lv, isUGC ).ConfigureAwait( false ); } catch ( Exception ex ) when ( ex is ContentDownloaderException diff --git a/DepotDownloader/Util.cs b/DepotDownloader/Util.cs index 52e3fee4..1c08138b 100644 --- a/DepotDownloader/Util.cs +++ b/DepotDownloader/Util.cs @@ -28,6 +28,11 @@ namespace DepotDownloader return "unknown"; } + public static string GetSteamArch() + { + return Environment.Is64BitOperatingSystem ? "64" : "32"; + } + public static string ReadPassword() { ConsoleKeyInfo keyInfo;