mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-10-20 01:46:17 +00:00
Add -force-depot command line parameter to force attempted download of a particular depot in an app.
This allows UGC depots to be downloaded, as they are not listed in the PICS configuration.
This commit is contained in:
1 parent
6ae2c37c2a
commit
0b722996b5
2 files changed
+44
-36
No files matched your search
@@ -320,7 +320,7 @@ namespace DepotDownloader
|
||||
steam3.Disconnect();
|
||||
}
|
||||
|
||||
public static void DownloadApp(uint appId, uint depotId, string branch)
|
||||
public static void DownloadApp(uint appId, uint depotId, string branch, bool forceDepot = false)
|
||||
{
|
||||
if(steam3 != null)
|
||||
steam3.RequestAppInfo(appId);
|
||||
@@ -335,51 +335,58 @@ namespace DepotDownloader
|
||||
var depotIDs = new List<uint>();
|
||||
KeyValue depots = GetSteam3AppSection(appId, EAppInfoSection.Depots);
|
||||
|
||||
if (depots != null)
|
||||
|
||||
if (forceDepot)
|
||||
{
|
||||
foreach (var depotSection in depots.Children)
|
||||
depotIDs.Add(depotId);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (depots != null)
|
||||
{
|
||||
uint id = INVALID_DEPOT_ID;
|
||||
if (depotSection.Children.Count == 0)
|
||||
continue;
|
||||
foreach (var depotSection in depots.Children)
|
||||
{
|
||||
uint id = INVALID_DEPOT_ID;
|
||||
if (depotSection.Children.Count == 0)
|
||||
continue;
|
||||
|
||||
if (!uint.TryParse(depotSection.Name, out id))
|
||||
continue;
|
||||
if (!uint.TryParse(depotSection.Name, out id))
|
||||
continue;
|
||||
|
||||
if (depotId != INVALID_DEPOT_ID && id != depotId)
|
||||
continue;
|
||||
if (depotId != INVALID_DEPOT_ID && id != depotId)
|
||||
continue;
|
||||
|
||||
if (!Config.DownloadAllPlatforms)
|
||||
{
|
||||
var depotConfig = depotSection["config"];
|
||||
if (depotConfig != KeyValue.Invalid && depotConfig["oslist"] != KeyValue.Invalid && !string.IsNullOrWhiteSpace(depotConfig["oslist"].Value))
|
||||
{
|
||||
var oslist = depotConfig["oslist"].Value.Split(',');
|
||||
if (Array.IndexOf(oslist, Util.GetSteamOS()) == -1)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
depotIDs.Add(id);
|
||||
}
|
||||
}
|
||||
if (depotIDs == null || (depotIDs.Count == 0 && depotId == INVALID_DEPOT_ID))
|
||||
{
|
||||
Console.WriteLine("Couldn't find any depots to download for app {0}", appId);
|
||||
return;
|
||||
}
|
||||
else if (depotIDs.Count == 0)
|
||||
{
|
||||
Console.Write("Depot {0} not listed for app {1}", depotId, appId);
|
||||
if (!Config.DownloadAllPlatforms)
|
||||
{
|
||||
var depotConfig = depotSection["config"];
|
||||
if (depotConfig != KeyValue.Invalid && depotConfig["oslist"] != KeyValue.Invalid && !string.IsNullOrWhiteSpace(depotConfig["oslist"].Value))
|
||||
{
|
||||
var oslist = depotConfig["oslist"].Value.Split(',');
|
||||
if (Array.IndexOf(oslist, Util.GetSteamOS()) == -1)
|
||||
continue;
|
||||
}
|
||||
Console.Write(" or not available on this platform");
|
||||
}
|
||||
|
||||
depotIDs.Add(id);
|
||||
Console.WriteLine();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (depotIDs == null || (depotIDs.Count == 0 && depotId == INVALID_DEPOT_ID))
|
||||
{
|
||||
Console.WriteLine("Couldn't find any depots to download for app {0}", appId);
|
||||
return;
|
||||
}
|
||||
else if (depotIDs.Count == 0)
|
||||
{
|
||||
Console.Write("Depot {0} not listed for app {1}", depotId, appId);
|
||||
if (!Config.DownloadAllPlatforms)
|
||||
{
|
||||
Console.Write(" or not available on this platform");
|
||||
}
|
||||
Console.WriteLine();
|
||||
return;
|
||||
}
|
||||
|
||||
var infos = new List<DepotDownloadInfo>();
|
||||
|
||||
foreach (var depot in depotIDs)
|
||||
|
||||
@@ -93,6 +93,7 @@ namespace DepotDownloader
|
||||
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";
|
||||
var forceDepot = HasParameter(args, "-force-depot");
|
||||
|
||||
ContentDownloader.Config.MaxServers = Math.Max(ContentDownloader.Config.MaxServers, ContentDownloader.Config.MaxDownloads);
|
||||
|
||||
@@ -108,7 +109,7 @@ namespace DepotDownloader
|
||||
}
|
||||
|
||||
ContentDownloader.InitializeSteam3(username, password);
|
||||
ContentDownloader.DownloadApp(appId, depotId, branch);
|
||||
ContentDownloader.DownloadApp(appId, depotId, branch, forceDepot);
|
||||
ContentDownloader.ShutdownSteam3();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user