From 064fbaea32ba33f167cbf8f24cfb47346f1409ac Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 2 Aug 2013 16:50:12 -0400 Subject: [PATCH] Display total size of downloaded data. --- DepotDownloader/ContentDownloader.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 76c6a175..4e064701 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -411,8 +411,13 @@ namespace DepotDownloader private static void DownloadSteam3( List depots ) { + ulong TotalBytesCompressed = 0; + ulong TotalBytesUncompressed = 0; + foreach (var depot in depots) { + ulong DepotBytesCompressed = 0; + ulong DepotBytesUncompressed = 0; int depotId = depot.id; ulong depot_manifest = depot.manifestId; byte[] depotKey = depot.depotKey; @@ -585,6 +590,10 @@ namespace DepotDownloader string chunkID = EncodeHexString(chunk.ChunkID); byte[] encrypted_chunk = cdnClients[0].DownloadDepotChunk(depotId, chunkID); + TotalBytesCompressed += chunk.CompressedLength; + DepotBytesCompressed += chunk.CompressedLength; + TotalBytesUncompressed += chunk.UncompressedLength; + DepotBytesUncompressed += chunk.UncompressedLength; if (encrypted_chunk == null) { @@ -616,7 +625,11 @@ namespace DepotDownloader Console.WriteLine(); } + + Console.WriteLine("Depot {0} - Downloaded {1} bytes ({2} bytes uncompressed)", depotId, DepotBytesCompressed, DepotBytesUncompressed); } + + Console.WriteLine("Total downloaded: {0} bytes ({1} bytes uncompressed) from {2} depots", TotalBytesCompressed, TotalBytesUncompressed, depots.Count); } static string EncodeHexString( byte[] input )