Expose max server and connection counts. Sync usage printout between program & readme.

pull/8/head
Nicholas Hastings 12 years ago
parent de37262e9d
commit a7ebaa3ddb

@ -458,7 +458,7 @@ namespace DepotDownloader
} }
// Grab up to the first eight server in the allegedly best-to-worst order from Steam // Grab up to the first eight server in the allegedly best-to-worst order from Steam
Enumerable.Range(0, Math.Min(cdnServers.Count, 8)).ToList().ForEach(s => Enumerable.Range(0, Math.Min(cdnServers.Count, Config.MaxServers)).ToList().ForEach(s =>
{ {
CDNClient c; CDNClient c;
if( s == 0 ) if( s == 0 )
@ -571,7 +571,7 @@ namespace DepotDownloader
var rand = new Random(); var rand = new Random();
depotManifest.Files.Where(f => !f.Flags.HasFlag(EDepotFileFlag.Directory)) depotManifest.Files.Where(f => !f.Flags.HasFlag(EDepotFileFlag.Directory))
.AsParallel().WithDegreeOfParallelism(4) .AsParallel().WithDegreeOfParallelism(Config.MaxDownloads)
.ForAll(file => .ForAll(file =>
{ {
var clientIndex = rand.Next(0, cdnClients.Count); var clientIndex = rand.Next(0, cdnClients.Count);

@ -21,5 +21,8 @@ namespace DepotDownloader
public ulong ManifestId { get; set; } public ulong ManifestId { get; set; }
public bool VerifyAll { get; set; } public bool VerifyAll { get; set; }
public int MaxServers { get; set; }
public int MaxDownloads { get; set; }
} }
} }

@ -88,6 +88,8 @@ namespace DepotDownloader
ContentDownloader.Config.InstallDirectory = GetParameter<string>(args, "-dir"); ContentDownloader.Config.InstallDirectory = GetParameter<string>(args, "-dir");
ContentDownloader.Config.DownloadAllPlatforms = HasParameter(args, "-all-platforms"); ContentDownloader.Config.DownloadAllPlatforms = HasParameter(args, "-all-platforms");
ContentDownloader.Config.VerifyAll = HasParameter(args, "-verify-all") || HasParameter(args, "-verify_all") || HasParameter(args, "-validate"); ContentDownloader.Config.VerifyAll = HasParameter(args, "-verify-all") || HasParameter(args, "-verify_all") || HasParameter(args, "-validate");
ContentDownloader.Config.MaxServers = GetParameter<int>(args, "-max-servers", 8);
ContentDownloader.Config.MaxDownloads = GetParameter<int>(args, "-max-downloads", 4);
string branch = GetParameter<string>(args, "-branch") ?? GetParameter<string>(args, "-beta") ?? "Public"; string branch = GetParameter<string>(args, "-branch") ?? GetParameter<string>(args, "-beta") ?? "Public";
if (username != null && password == null) if (username != null && password == null)
@ -136,22 +138,26 @@ namespace DepotDownloader
static void PrintUsage() static void PrintUsage()
{ {
Console.WriteLine( "\nUse: depotdownloader <parameters> [optional parameters]\n" ); Console.WriteLine( "\nUsage: depotdownloader <parameters> [optional parameters]\n" );
Console.WriteLine( "Parameters:" ); Console.WriteLine( "Parameters:" );
Console.WriteLine("\t-app #\t\t\t\t- the AppID to download."); Console.WriteLine("\t-app <#>\t\t\t\t- the AppID to download.");
Console.WriteLine(); Console.WriteLine();
Console.WriteLine( "Optional Parameters:" ); Console.WriteLine( "Optional Parameters:" );
Console.WriteLine( "\t-depot #\t\t\t- the DepotID to download." ); Console.WriteLine( "\t-depot <#>\t\t\t- the DepotID to download." );
Console.WriteLine( "\t-cellid #\t\t\t- the CellID of the content server to download from." ); Console.WriteLine( "\t-cellid <#>\t\t\t- the overridden CellID of the content server to download from." );
Console.WriteLine( "\t-username user\t\t\t- the username of the account to login to for restricted content." ); 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-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-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." ); 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-all-platforms\t\t\t- downloads all platform-specific depots when -app is used." ); Console.WriteLine( "\t-all-platforms\t\t\t- downloads all platform-specific depots when -app is used." );
Console.WriteLine( "\t-beta\t\t\t\t- download beta version of depots if available." ); Console.WriteLine( "\t-manifest-only\t\t\t- downloads a human readable manifest for any depots that would be downloaded." );
Console.WriteLine( "\t-manifest\t\t\t- downloads a human readable manifest for any depots that would be downloaded." ); Console.WriteLine( "\t-beta <branchname>\t\t\t\t- download from specified branch if available (default: Public)." );
Console.WriteLine( "\t-betapassword <pass>\t\t\t- branch password if applicable." );
Console.WriteLine( "\t-manifest <id>\t\t\t- manifest id of content to download (requires -depot, default: current for branch)." );
Console.WriteLine( "\t-max-servers <#>\t\t\t- maximum number of content servers to use. (default: 8)." );
Console.WriteLine( "\t-max-downloads <#>\t\t\t- maximum number of chunks to download concurrently. (default: 4)." );
} }
} }
} }

@ -4,22 +4,24 @@ DepotDownloader
Steam depot downloader utilizing the SteamKit2 library. Supports .NET and Mono Steam depot downloader utilizing the SteamKit2 library. Supports .NET and Mono
``` ```
Use: depotdownloader <parameters> [optional parameters] Usage: depotdownloader <parameters> [optional parameters]
Parameters: Parameters:
-app # - the AppID to download. -app <#> - the AppID to download.
Optional Parameters: Optional Parameters:
-depot # - the DepotID to download. -depot <#> - the DepotID to download.
-cellid # - the overridden CellID of the content server to download from. -cellid <#> - the overridden CellID of the content server to download from.
-username user - the username of the account to login to for restricted content. -username <user> - the username of the account to login to for restricted content.
-password pass - the password of the account to login to for restricted content. -password <pass> - the password of the account to login to for restricted content.
-dir installdir - the directory in which to place downloaded files. -dir <installdir> - the directory in which to place downloaded files.
-filelist file.txt - a list of files to download (from the manifest). -filelist <file.txt> - a list of files to download (from the manifest).
Can optionally use regex to download only certain files. Can optionally use regex to download only certain files.
-all-platforms - downloads all platform-specific depots when -app is used. -all-platforms - downloads all platform-specific depots when -app is used.
-manifest-only - downloads a human readable manifest for any depots that would be downloaded. -manifest-only - downloads a human readable manifest for any depots that would be downloaded.
-beta branchname - download from specified branch if available. -beta <branchname> - download from specified branch if available (default: Public).
-betapassword pass - branch password if applicable. -betapassword <pass> - branch password if applicable.
-manifest manifestid - manifest id of content to download (requires -depot). -manifest <id> - manifest id of content to download (requires -depot, default: latest for branch).
-max-servers <#> - maximum number of content servers to use. (default: 8).
-max-downloads <#> - maximum number of chunks to download concurrently. (default: 4).
``` ```

Loading…
Cancel
Save