From adf9da417bcac965ccb0e0e70f0ee6747eed40c9 Mon Sep 17 00:00:00 2001 From: Sunner Date: Fri, 11 Aug 2017 21:40:14 +0200 Subject: [PATCH] Added operating system switch --- DepotDownloader/ContentDownloader.cs | 4 ++-- DepotDownloader/Program.cs | 6 ++++-- README.md | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index a08526c1..3fbdc498 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -369,7 +369,7 @@ namespace DepotDownloader steam3.Disconnect(); } - public static void DownloadApp( uint appId, uint depotId, string branch, bool forceDepot = false ) + public static void DownloadApp( uint appId, uint depotId, string branch, string os = null, bool forceDepot = false ) { if ( steam3 != null ) steam3.RequestAppInfo( appId ); @@ -420,7 +420,7 @@ namespace DepotDownloader if ( depotConfig != KeyValue.Invalid && depotConfig[ "oslist" ] != KeyValue.Invalid && !string.IsNullOrWhiteSpace( depotConfig[ "oslist" ].Value ) ) { var oslist = depotConfig[ "oslist" ].Value.Split( ',' ); - if ( Array.IndexOf( oslist, Util.GetSteamOS() ) == -1 ) + if ( Array.IndexOf( oslist, os ?? Util.GetSteamOS() ) == -1 ) continue; } } diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index 7ff421c8..eae9645b 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -94,7 +94,8 @@ namespace DepotDownloader ContentDownloader.Config.MaxServers = GetParameter( args, "-max-servers", 20 ); ContentDownloader.Config.MaxDownloads = GetParameter( args, "-max-downloads", 4 ); string branch = GetParameter( args, "-branch" ) ?? GetParameter( args, "-beta" ) ?? "Public"; - var forceDepot = HasParameter( args, "-force-depot" ); + bool forceDepot = HasParameter( args, "-force-depot" ); + string os = GetParameter( args, "-os", null ); ContentDownloader.Config.MaxServers = Math.Max( ContentDownloader.Config.MaxServers, ContentDownloader.Config.MaxDownloads ); @@ -114,7 +115,7 @@ namespace DepotDownloader if ( ContentDownloader.InitializeSteam3( username, password ) ) { - ContentDownloader.DownloadApp( appId, depotId, branch, forceDepot ); + ContentDownloader.DownloadApp( appId, depotId, branch, os, forceDepot ); ContentDownloader.ShutdownSteam3(); } } @@ -166,6 +167,7 @@ namespace DepotDownloader Console.WriteLine( "\t-password \t\t\t- the password of the account to login to for restricted content." ); Console.WriteLine( "\t-remember-password\t\t\t- if set, remember the password for subsequent logins of this user." ); Console.WriteLine( "\t-dir \t\t\t- the directory in which to place downloaded files." ); + Console.WriteLine( "\t-os \t\t\t- the operating system for which to download the game (windows, macos or linux, default: OS the programm is currently running on)" ); Console.WriteLine( "\t-filelist \t\t- a list of files to download (from the manifest). Can optionally use regex to download only certain files." ); Console.WriteLine( "\t-all-platforms\t\t\t- downloads all platform-specific depots when -app is used." ); Console.WriteLine( "\t-manifest-only\t\t\t- downloads a human readable manifest for any depots that would be downloaded." ); diff --git a/README.md b/README.md index 1eb37a68..d8aa94af 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Optional Parameters: -password - the password of the account to login to for restricted content. -remember-password - if set, remember the password for subsequent logins of this user. -dir - the directory in which to place downloaded files. + -os - the operating system for which to download the game (windows, macos or linux, default: OS the programm is currently running on) -filelist - a list of files to download (from the manifest). Can optionally use regex to download only certain files. -all-platforms - downloads all platform-specific depots when -app is used.