Added -beta parameter to download beta versions of depots if available.

This commit is contained in:
Scott Ehlert committed 2011-07-07 22:27:57 -05:00
1 parent af190db942
commit 9d586b5e95
2 files changed
+12 -4

No files matched your search

+7 -1
View File
@@ -36,6 +36,9 @@ namespace DepotDownloader
[BlobField( FieldKey = CDRAppRecordFields.eFieldUserDefinedRecord, Depth = 1 )]
public Dictionary<string, string> UserDefined { get; private set; }
[BlobField( FieldKey = CDRAppRecordFields.eFieldBetaVersionId, Depth = 1 )]
public int BetaVersion { get; set; }
}
class Sub
@@ -158,7 +161,7 @@ namespace DepotDownloader
return app.Name;
}
public static int GetLatestDepotVersion( int depotId )
public static int GetLatestDepotVersion( int depotId, bool beta )
{
App app = GetAppBlob( depotId );
@@ -167,6 +170,9 @@ namespace DepotDownloader
return -1;
}
if ( beta && app.BetaVersion > app.CurrentVersion )
return app.BetaVersion;
return app.CurrentVersion;
}
+5 -3
View File
@@ -59,10 +59,11 @@ namespace DepotDownloader
}
int depotVersion = GetIntParameter( args, "-version" );
bool bBeta = HasParameter( args, "-beta" );
if ( !bGameserver && !bApp && depotVersion == -1 )
{
int latestVer = CDRManager.GetLatestDepotVersion( depotId );
int latestVer = CDRManager.GetLatestDepotVersion( depotId, bBeta );
if ( latestVer == -1 )
{
@@ -134,7 +135,7 @@ namespace DepotDownloader
foreach ( int currentDepotId in depotIDs )
{
depotVersion = CDRManager.GetLatestDepotVersion( currentDepotId );
depotVersion = CDRManager.GetLatestDepotVersion( currentDepotId, bBeta );
if ( depotVersion == -1 )
{
Console.WriteLine( "Error: Unable to find DepotID {0} in the CDR!", currentDepotId );
@@ -208,7 +209,8 @@ namespace DepotDownloader
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-no-exclude\t\t\t- don't exclude any files when downloading depots with the -game parameter." );
Console.WriteLine( "\t-all-platforms\t\t\t- downloads all platform-specific depots when -game or -app is used.\n" );
Console.WriteLine( "\t-all-platforms\t\t\t- downloads all platform-specific depots when -game or -app is used." );
Console.WriteLine( "\t-beta\t\t\t\t- download beta version of depots if available." );
}
}
}