DepotDownloader: Added beta password support

--HG--
extra : rebase_source : ff1c354116dea838104716e3a998d8ca3a4c0f42
pull/8/head
Ryan Kistner 13 years ago
parent 90f72f1555
commit e98d7ce2a8

@ -244,8 +244,9 @@ namespace DepotDownloader
continue;
var nodes = depotChild["manifests"].Children;
var nodes_encrypted = depotChild["encryptedmanifests"].Children;
if (nodes.Count == 0)
if (nodes.Count == 0 && nodes_encrypted.Count == 0)
return false;
}
@ -363,14 +364,37 @@ namespace DepotDownloader
return 0;
var manifests = depotChild["manifests"];
var manifests_encrypted = depotChild["encryptedmanifests"];
if (manifests.Children.Count == 0)
if (manifests.Children.Count == 0 && manifests_encrypted.Children.Count == 0)
return 0;
var node = manifests[branch];
if (branch != "Public" && node == null)
if (branch != "Public" && node == KeyValue.Invalid)
{
var node_encrypted = manifests_encrypted[branch];
if (node_encrypted != KeyValue.Invalid)
{
string password = Config.BetaPassword;
if (password == null)
{
Console.Write("Please enter the password for branch {0}: ", branch);
Config.BetaPassword = password = Console.ReadLine();
}
byte[] input = Utils.DecodeHexString(node_encrypted["encrypted_gid"].Value);
byte[] manifest_bytes = CryptoHelper.VerifyAndDecryptPassword(input, password);
if (manifest_bytes == null)
{
Console.WriteLine("Password was invalid for branch {0}", branch);
return 0;
}
return BitConverter.ToUInt64(manifest_bytes, 0);
}
Console.WriteLine("Invalid branch {0} for appId {1}", branch, appId);
return 0;
}

@ -16,5 +16,7 @@ namespace DepotDownloader
public List<Regex> FilesToDownloadRegex { get; set; }
public bool UsingExclusionList { get; set; }
public string BetaPassword { get; set; }
}
}

@ -75,6 +75,7 @@ namespace DepotDownloader
int depotVersion = GetIntParameter( args, "-version" );
ContentDownloader.Config.PreferBetaVersions = HasParameter( args, "-beta" );
ContentDownloader.Config.BetaPassword = GetStringParameter( args, "-betpassword" );
// this is a Steam2 option
if ( !bGameserver && !bApp && depotVersion == -1 )

Loading…
Cancel
Save