From c0b4dd03ee0617832990de0befd4bd7b87014dd4 Mon Sep 17 00:00:00 2001 From: Netshroud Date: Sun, 9 Aug 2015 14:41:19 +1000 Subject: [PATCH] Update to SteamKit 1.6.4 --- DepotDownloader/ContentDownloader.cs | 6 ++--- DepotDownloader/DepotDownloader.csproj | 6 ++--- DepotDownloader/Steam3Session.cs | 36 ++++++++++++-------------- DepotDownloader/packages.config | 4 +-- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index a905130d..51e16dd0 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -126,12 +126,10 @@ namespace DepotDownloader SteamApps.PICSProductInfoCallback.PICSProductInfo package; if ( steam3.PackageInfo.TryGetValue( license, out package ) && package != null ) { - KeyValue root = package.KeyValues[license.ToString()]; - - if ( root["appids"].Children.Any( child => child.AsInteger() == depotId ) ) + if ( package.KeyValues["appids"].Children.Any( child => child.AsInteger() == depotId ) ) return true; - if ( root["depotids"].Children.Any( child => child.AsInteger() == depotId ) ) + if ( package.KeyValues["depotids"].Children.Any( child => child.AsInteger() == depotId ) ) return true; } } diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index 52c72bc4..c699f33d 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.6.1\lib\net40\SteamKit2.dll + + ..\packages\SteamKit2.1.6.4\lib\net40\SteamKit2.dll + True diff --git a/DepotDownloader/Steam3Session.cs b/DepotDownloader/Steam3Session.cs index 41a78aa3..8918d930 100644 --- a/DepotDownloader/Steam3Session.cs +++ b/DepotDownloader/Steam3Session.cs @@ -1,15 +1,13 @@ -using System; +using SteamKit2; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; -using SteamKit2; -using System.Diagnostics; -using System.Net; namespace DepotDownloader { - + class Steam3Session { public class Credentials @@ -83,12 +81,12 @@ namespace DepotDownloader this.callbacks = new CallbackManager(this.steamClient); - this.callbacks.Register(new Callback(ConnectedCallback)); - this.callbacks.Register(new Callback(DisconnectedCallback)); - this.callbacks.Register(new Callback(LogOnCallback)); - this.callbacks.Register(new Callback(SessionTokenCallback)); - this.callbacks.Register(new Callback(LicenseListCallback)); - this.callbacks.Register(new Callback(UpdateMachineAuthCallback)); + this.callbacks.Subscribe(ConnectedCallback); + this.callbacks.Subscribe(DisconnectedCallback); + this.callbacks.Subscribe(LogOnCallback); + this.callbacks.Subscribe(SessionTokenCallback); + this.callbacks.Subscribe(LicenseListCallback); + this.callbacks.Subscribe(UpdateMachineAuthCallback); Console.Write( "Connecting to Steam3..." ); @@ -160,7 +158,7 @@ namespace DepotDownloader }; WaitUntilCallback(() => { - new Callback(cbMethodTokens, callbacks, steamApps.PICSGetAccessTokens(new List() { appId }, new List() { })); + callbacks.Subscribe(steamApps.PICSGetAccessTokens(new List() { appId }, new List() { }), cbMethodTokens); }, () => { return completed; }); completed = false; @@ -189,8 +187,8 @@ namespace DepotDownloader request.Public = false; } - WaitUntilCallback(() => { - new Callback(cbMethod, callbacks, steamApps.PICSGetProductInfo(new List() { request }, new List() { })); + WaitUntilCallback(() => { + callbacks.Subscribe(steamApps.PICSGetProductInfo(new List() { request }, new List() { }), cbMethod); }, () => { return completed; }); } @@ -219,8 +217,8 @@ namespace DepotDownloader } }; - WaitUntilCallback(() => { - new Callback(cbMethod, callbacks, steamApps.PICSGetProductInfo(new List(), packages)); + WaitUntilCallback(() => { + callbacks.Subscribe(steamApps.PICSGetProductInfo(new List(), packages), cbMethod); }, () => { return completed; }); } @@ -254,7 +252,7 @@ namespace DepotDownloader }; WaitUntilCallback(() => { - new Callback(cbMethod, callbacks, steamApps.GetAppOwnershipTicket(appId)); + callbacks.Subscribe(steamApps.GetAppOwnershipTicket(appId), cbMethod); }, () => { return completed; }); } @@ -281,7 +279,7 @@ namespace DepotDownloader WaitUntilCallback(() => { - new Callback(cbMethod, callbacks, steamApps.GetDepotDecryptionKey(depotId, appid)); + callbacks.Subscribe(steamApps.GetDepotDecryptionKey(depotId, appid), cbMethod); }, () => { return completed; }); } @@ -307,7 +305,7 @@ namespace DepotDownloader WaitUntilCallback(() => { - new Callback(cbMethod, callbacks, steamApps.GetCDNAuthToken(depotid, host)); + callbacks.Subscribe(steamApps.GetCDNAuthToken(depotid, host), cbMethod); }, () => { return completed; }); } diff --git a/DepotDownloader/packages.config b/DepotDownloader/packages.config index 4f326067..9818fd47 100644 --- a/DepotDownloader/packages.config +++ b/DepotDownloader/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file