mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-10-20 01:46:17 +00:00
Allow downloading of specified manifest.
This commit is contained in:
1 parent
987b51e82d
commit
cfc95d3f57
3 files changed
+17
-7
No files matched your search
@@ -16,6 +16,7 @@ namespace DepotDownloader
|
||||
private const string DEFAULT_DIR = "depots";
|
||||
public const uint INVALID_APP_ID = uint.MaxValue;
|
||||
public const uint INVALID_DEPOT_ID = uint.MaxValue;
|
||||
public const ulong INVALID_MANIFEST_ID = ulong.MaxValue;
|
||||
|
||||
public static DownloadConfig Config = new DownloadConfig();
|
||||
|
||||
@@ -205,20 +206,20 @@ namespace DepotDownloader
|
||||
|
||||
static ulong GetSteam3DepotManifest(uint depotId, uint appId, string branch)
|
||||
{
|
||||
if (appId == INVALID_APP_ID)
|
||||
return 0;
|
||||
if (Config.ManifestId != INVALID_MANIFEST_ID)
|
||||
return Config.ManifestId;
|
||||
|
||||
KeyValue depots = GetSteam3AppSection(appId, EAppInfoSection.Depots);
|
||||
KeyValue depotChild = depots[depotId.ToString()];
|
||||
|
||||
if (depotChild == null)
|
||||
return 0;
|
||||
return INVALID_MANIFEST_ID;
|
||||
|
||||
var manifests = depotChild["manifests"];
|
||||
var manifests_encrypted = depotChild["encryptedmanifests"];
|
||||
|
||||
if (manifests.Children.Count == 0 && manifests_encrypted.Children.Count == 0)
|
||||
return 0;
|
||||
return INVALID_MANIFEST_ID;
|
||||
|
||||
var node = manifests[branch];
|
||||
|
||||
@@ -240,18 +241,18 @@ namespace DepotDownloader
|
||||
if (manifest_bytes == null)
|
||||
{
|
||||
Console.WriteLine("Password was invalid for branch {0}", branch);
|
||||
return 0;
|
||||
return INVALID_MANIFEST_ID;
|
||||
}
|
||||
|
||||
return BitConverter.ToUInt64(manifest_bytes, 0);
|
||||
}
|
||||
|
||||
Console.WriteLine("Invalid branch {0} for appId {1}", branch, appId);
|
||||
return 0;
|
||||
return INVALID_MANIFEST_ID;
|
||||
}
|
||||
|
||||
if (node.Value == null)
|
||||
return 0;
|
||||
return INVALID_MANIFEST_ID;
|
||||
|
||||
return UInt64.Parse(node.Value);
|
||||
}
|
||||
|
||||
@@ -17,5 +17,7 @@ namespace DepotDownloader
|
||||
public bool UsingExclusionList { get; set; }
|
||||
|
||||
public string BetaPassword { get; set; }
|
||||
|
||||
public ulong ManifestId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ namespace DepotDownloader
|
||||
bool bDumpManifest = HasParameter( args, "-manifest-only" );
|
||||
uint appId = GetParameter<uint>( args, "-app", ContentDownloader.INVALID_APP_ID );
|
||||
uint depotId = GetParameter<uint>( args, "-depot", ContentDownloader.INVALID_DEPOT_ID );
|
||||
ContentDownloader.Config.ManifestId = GetParameter<ulong>( args, "-manifest", ContentDownloader.INVALID_MANIFEST_ID );
|
||||
|
||||
if ( appId == ContentDownloader.INVALID_APP_ID )
|
||||
{
|
||||
@@ -29,6 +30,12 @@ namespace DepotDownloader
|
||||
return;
|
||||
}
|
||||
|
||||
if (depotId == ContentDownloader.INVALID_DEPOT_ID && ContentDownloader.Config.ManifestId != ContentDownloader.INVALID_MANIFEST_ID)
|
||||
{
|
||||
Console.WriteLine("Error: -manifest requires -depot to be specified");
|
||||
return;
|
||||
}
|
||||
|
||||
ContentDownloader.Config.DownloadManifestOnly = bDumpManifest;
|
||||
|
||||
int cellId = GetParameter<int>(args, "-cellid", -1);
|
||||
|
||||
Reference in new issue
Block a user