From 90eb0a52c19c9b0bd17fa07878eb6d058193643b Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sun, 16 Mar 2014 19:22:33 -0400 Subject: [PATCH] Remove gross hack needed for creating ChunkData objects before SteamKit 1.5.1. --- DepotDownloader/ContentDownloader.cs | 24 +++--------------------- DepotDownloader/DepotDownloader.csproj | 4 ++-- DepotDownloader/packages.config | 2 +- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 985a778a..c791ab84 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -729,33 +729,15 @@ namespace DepotDownloader int idx = cdnClientIndex; while (true) { - try - { -#if true - // The only way that SteamKit exposes to get a DepotManifest.ChunkData instance is to download a new manifest. - // We only want to download manifests that we don't already have, so we'll have to improvise... - - // internal ChunkData( byte[] id, byte[] checksum, ulong offset, uint comp_length, uint uncomp_length ) - System.Reflection.ConstructorInfo ctor = typeof(DepotManifest.ChunkData).GetConstructor( - System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.CreateInstance | System.Reflection.BindingFlags.Instance, - null, - new[] { typeof(byte[]), typeof(byte[]), typeof(ulong), typeof(uint), typeof(uint) }, - null); - var data = (DepotManifest.ChunkData)ctor.Invoke( - new object[] { - chunk.ChunkID, chunk.Checksum, chunk.Offset, chunk.CompressedLength, chunk.UncompressedLength - }); - -#else - // Next SteamKit version after 1.5.0 will support this. - // Waiting for it to be in the NuGet repo. DepotManifest.ChunkData data = new DepotManifest.ChunkData(); data.ChunkID = chunk.ChunkID; data.Checksum = chunk.Checksum; data.Offset = chunk.Offset; data.CompressedLength = chunk.CompressedLength; data.UncompressedLength = chunk.UncompressedLength; -#endif + + try + { chunkData = cdnClients[idx].DownloadDepotChunk(data); break; } diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index 4a403126..4e4c6a3f 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -62,9 +62,9 @@ True ..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll - + False - ..\packages\SteamKit2.1.5.0\lib\net40\SteamKit2.dll + ..\packages\SteamKit2.1.5.1\lib\net40\SteamKit2.dll diff --git a/DepotDownloader/packages.config b/DepotDownloader/packages.config index ae5a33ea..c3b0fe4f 100644 --- a/DepotDownloader/packages.config +++ b/DepotDownloader/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file