From acdd8bdebc9fc117304bec769c7436659519a2af Mon Sep 17 00:00:00 2001 From: psychonic Date: Tue, 5 Jun 2012 16:58:01 -0500 Subject: [PATCH] Add support for specifying single depot (+app) for steam3 content. --- DepotDownloader/ContentDownloader.cs | 13 ++++++++++--- DepotDownloader/Program.cs | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 3c4647b2..b0ad1050 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -340,7 +340,7 @@ namespace DepotDownloader }; } - public static void DownloadApp(int appId, bool bListOnly=false) + public static void DownloadApp(int appId, int depotId, bool bListOnly=false) { if(steam3 != null) steam3.RequestAppInfo((uint)appId); @@ -364,7 +364,9 @@ namespace DepotDownloader depots = depots[appId.ToString()]; foreach (var child in depots.Children) { - if (child.Children.Count > 0) + int id = -1; + int.TryParse(child.Name, out id); + if (child.Children.Count > 0 && (depotId == -1 || id == depotId)) { depotIDs.Add(int.Parse(child.Name)); } @@ -377,11 +379,16 @@ namespace DepotDownloader depotIDs = CDRManager.GetDepotIDsForApp(appId, Config.DownloadAllPlatforms); } - if (depotIDs == null || depotIDs.Count == 0) + if (depotIDs == null || (depotIDs.Count == 0 && depotId == -1)) { Console.WriteLine("Couldn't find any depots to download for app {0}", appId); return; } + else if (depotIDs.Count == 0) + { + Console.WriteLine("Depot {0} not listed for app {1}", depotId, appId); + return; + } if ( bListOnly ) { diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index 17082269..e6d4d97e 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -175,7 +175,7 @@ namespace DepotDownloader if (bApp) { - ContentDownloader.DownloadApp(appId, bListDepots); + ContentDownloader.DownloadApp(appId, depotId, bListDepots); } else if ( !bGameserver ) {