From e5fa0ca62fc0d059e11b2d5896b2a7437603d307 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Wed, 29 Jun 2011 01:45:28 -0500 Subject: [PATCH] Added -no-exclude parameter that downloads files in exclude.lst anyways. --- DepotDownloader/ContentDownloader.cs | 6 +++--- DepotDownloader/Program.cs | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 4ac16eb8..aefc9d4a 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -104,7 +104,7 @@ namespace DepotDownloader return false; } - public static void Download( int depotId, int depotVersion, int cellId, string username, string password, bool onlyManifest, bool gameServer, string installDir, string[] fileList ) + public static void Download( int depotId, int depotVersion, int cellId, string username, string password, bool onlyManifest, bool gameServer, bool exclude, string installDir, string[] fileList ) { if ( !CreateDirectories( depotId, depotVersion, ref installDir ) ) { @@ -189,7 +189,7 @@ namespace DepotDownloader byte[] cryptKey = CDRManager.GetDepotEncryptionKey( depotId, depotVersion ); string[] excludeList = null; - if ( gameServer ) + if ( gameServer && exclude ) excludeList = GetExcludeList( session, manifest ); for ( int x = 0 ; x < manifest.Nodes.Count ; ++x ) @@ -207,7 +207,7 @@ namespace DepotDownloader continue; } - if ( gameServer && IsFileExcluded( dirEntry.FullName, excludeList ) ) + if ( gameServer && exclude && IsFileExcluded( dirEntry.FullName, excludeList ) ) continue; if ( fileList != null ) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index 76bab20a..98fd4ff3 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -103,10 +103,11 @@ namespace DepotDownloader string username = GetStringParameter( args, "-username" ); string password = GetStringParameter( args, "-password" ); string installDir = GetStringParameter( args, "-dir" ); + bool noExclude = HasParamater( args, "-no-exclude" ); if ( !bGameserver ) { - ContentDownloader.Download( depotId, depotVersion, cellId, username, password, !bDebot, bGameserver, installDir, files ); + ContentDownloader.Download( depotId, depotVersion, cellId, username, password, !bDebot, false, false, installDir, files ); } else { @@ -124,7 +125,7 @@ namespace DepotDownloader string depotName = CDRManager.GetDepotName( currentDepotId ); Console.WriteLine( "Downloading \"{0}\" version {1} ...", depotName, depotVersion ); - ContentDownloader.Download( currentDepotId, depotVersion, cellId, username, password, false, bGameserver, installDir, files ); + ContentDownloader.Download( currentDepotId, depotVersion, cellId, username, password, false, bGameserver, !noExclude, installDir, files ); } } } @@ -138,6 +139,10 @@ namespace DepotDownloader } return -1; } + static bool HasParamater( string[] args, string param ) + { + return IndexOfParam( args, param ) > -1; + } static int GetIntParameter( string[] args, string param ) { string strParam = GetStringParameter( args, param ); @@ -170,7 +175,7 @@ namespace DepotDownloader Console.WriteLine( "\t OR" ); Console.WriteLine( "\t-manifest #\t\t\t- downloads a human readable manifest for the depot." ); Console.WriteLine( "\t OR" ); - Console.WriteLine( "\t-game #\t\t\t- the HLDSUpdateTool game server to download." ); + Console.WriteLine( "\t-game #\t\t\t\t- the HLDSUpdateTool game server to download." ); Console.WriteLine( "\t-version [# or \"latest\"]\t- the version of the depot to download.\n" ); Console.WriteLine( "Optional Parameters:" ); @@ -178,7 +183,8 @@ namespace DepotDownloader Console.WriteLine( "\t-username user\t\t\t- the username of the account to login to for restricted content." ); Console.WriteLine( "\t-password pass\t\t\t- the password of the account to login to for restricted content." ); Console.WriteLine( "\t-dir installdir\t\t\t- the directory in which to place downloaded files." ); - Console.WriteLine( "\t-filelist filename.txt\t\t- a list of files to download (from the manifest). Can optionally use regex to download only certain files.\n" ); + Console.WriteLine( "\t-filelist filename.txt\t\t- a list of files to download (from the manifest). Can optionally use regex to download only certain files." ); + Console.WriteLine( "\t-no-exclude\t\t\t- don't exclude any files when downloading depots with the -game parameter.\n"); } } }