From 7f2cb58d47b0a38c624e102c72270456b0e43d15 Mon Sep 17 00:00:00 2001 From: NicknineTheEagle Date: Mon, 27 Apr 2020 00:34:32 +0300 Subject: [PATCH] Expanded manifest-to-text conversion --- DepotDownloader/ContentDownloader.cs | 7 ++++++- DepotDownloader/ProtoManifest.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 99200b6c..c0c5dc46 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -738,10 +738,13 @@ namespace DepotDownloader newProtoManifest.Files.Sort( ( x, y ) => string.Compare( x.FileName, y.FileName, StringComparison.Ordinal ) ); + Console.WriteLine( "Manifest {0} ({1})", depot.manifestId, newProtoManifest.CreationTime ); + if ( Config.DownloadManifestOnly ) { StringBuilder manifestBuilder = new StringBuilder(); - string txtManifest = Path.Combine( depot.installDir, string.Format( "manifest_{0}.txt", depot.id ) ); + string txtManifest = Path.Combine( depot.installDir, string.Format( "manifest_{0}_{1}.txt", depot.id, depot.manifestId ) ); + manifestBuilder.Append( string.Format( "{0}\n\n", newProtoManifest.CreationTime ) ); foreach ( var file in newProtoManifest.Files ) { @@ -749,6 +752,8 @@ namespace DepotDownloader continue; manifestBuilder.Append( string.Format( "{0}\n", file.FileName ) ); + manifestBuilder.Append( string.Format( "\t{0}\n", file.TotalSize ) ); + manifestBuilder.Append( string.Format( "\t{0}\n", BitConverter.ToString( file.FileHash ).Replace( "-", "" ) ) ); } File.WriteAllText( txtManifest, manifestBuilder.ToString() ); diff --git a/DepotDownloader/ProtoManifest.cs b/DepotDownloader/ProtoManifest.cs index 7c1c086e..f521c5cc 100644 --- a/DepotDownloader/ProtoManifest.cs +++ b/DepotDownloader/ProtoManifest.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.IO.Compression; @@ -20,6 +21,7 @@ namespace DepotDownloader { sourceManifest.Files.ForEach(f => Files.Add(new FileData(f))); ID = id; + CreationTime = sourceManifest.CreationTime; } [ProtoContract()] @@ -117,6 +119,9 @@ namespace DepotDownloader [ProtoMember(2)] public ulong ID { get; private set; } + [ProtoMember(3)] + public DateTime CreationTime { get; private set; } + public static ProtoManifest LoadFromFile(string filename, out byte[] checksum) { if (!File.Exists(filename))