From a162f8cb466201472c5e69eb066db7d362c651c8 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 30 Nov 2012 12:07:15 -0500 Subject: [PATCH] DepotDownloader: Cleaned up and fixed some console output for Steam2 downloads. --- DepotDownloader/ContentDownloader.cs | 22 ++++++++++------------ DepotDownloader/Program.cs | 12 +----------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 28e45f64..866b7751 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -582,8 +582,6 @@ namespace DepotDownloader return null; } - Console.WriteLine("Downloading \"{0}\" version {1} ...", contentName, uVersion); - if(steam3 != null) steam3.RequestAppTicket((uint)depotId); @@ -842,7 +840,7 @@ namespace DepotDownloader return null; } - Console.Write("\nSearching for content servers... (socket error: {0}, steam2 error: {1})", counterSocket, counterSteam2); + Console.WriteLine("\nSearching for content servers... (socket error: {0}, steam2 error: {1})", counterSocket, counterSteam2); counterSocket = 0; counterSteam2 = 0; Thread.Sleep(1000); @@ -855,7 +853,7 @@ namespace DepotDownloader Console.WriteLine("Found depots:"); foreach (var depot in depots) { - Console.WriteLine(" - {0}\t{1}", depot.id, depot.contentName); + Console.WriteLine("- {0}\t{1} (version {2})", depot.id, depot.contentName, depot.version); } Console.Write("Finding content servers..."); @@ -871,9 +869,6 @@ namespace DepotDownloader Console.WriteLine(" Done!"); - if (!Config.DownloadManifestOnly) - Console.WriteLine("Building list of files to download and checking existing files..."); - ContentServerClient csClient = new ContentServerClient(); csClient.ConnectionTimeout = TimeSpan.FromSeconds(STEAM2_CONNECT_TIMEOUT_SECONDS); @@ -948,13 +943,14 @@ namespace DepotDownloader FileInfo fi = new FileInfo(downloadPath); if (fi.Exists) { - float perc = ((float)x / (float)depot.manifest.Nodes.Count) * 100.0f; - Console.WriteLine("{0,6:#00.00}%\t{1}", perc, downloadPath); // Similar file, let's check checksums if (fi.Length == dirEntry.SizeOrCount && Util.ValidateSteam2FileChecksums(fi, checksums.GetFileChecksums(dirEntry.FileID))) { // checksums OK + float perc = ((float)x / (float)depot.manifest.Nodes.Count) * 100.0f; + Console.WriteLine("{0,6:#00.00}%\t{1}", perc, downloadPath); + continue; } // Unlink the current file before we download a new one. @@ -971,11 +967,13 @@ namespace DepotDownloader } } - Console.WriteLine("Downloading selected files."); foreach( var depot in depots ) { - if (depot.NodesToDownload.Count == 0) - continue; + Console.Write("Downloading requested files from depot {0}... ", depot.id); + if ( depot.NodesToDownload.Count == 0 ) + Console.WriteLine("none needed."); + else + Console.WriteLine(); session = GetSteam2StorageSession(depot.contentServers, csClient, depot.id, depot.version); if(session == null) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index e027981c..05d991af 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -197,17 +197,7 @@ namespace DepotDownloader } else { - foreach ( int currentDepotId in depotIDs ) - { - depotVersion = CDRManager.GetLatestDepotVersion(currentDepotId, ContentDownloader.Config.PreferBetaVersions); - if ( depotVersion == -1 ) - { - Console.WriteLine( "Error: Unable to find DepotID {0} in the CDR!", currentDepotId ); - break; - } - - ContentDownloader.DownloadDepot(currentDepotId, depotVersion); - } + ContentDownloader.DownloadDepotsForGame( gameName ); } }