diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 0eace1a2..f0c32ebe 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -25,7 +25,6 @@ namespace DepotDownloader public static DownloadConfig Config = new(); private static Steam3Session steam3; - private static Steam3Session.Credentials steam3Credentials; private static CDNClientPool cdnPool; private const string DEFAULT_DOWNLOAD_DIR = "depots"; @@ -298,9 +297,7 @@ namespace DepotDownloader } ); - steam3Credentials = steam3.WaitForCredentials(); - - if (!steam3Credentials.IsValid) + if (!steam3.WaitForCredentials()) { Console.WriteLine("Unable to get steam3 credentials."); return false; diff --git a/DepotDownloader/Steam3Session.cs b/DepotDownloader/Steam3Session.cs index 9d4d8981..1c29a087 100644 --- a/DepotDownloader/Steam3Session.cs +++ b/DepotDownloader/Steam3Session.cs @@ -13,16 +13,7 @@ namespace DepotDownloader { class Steam3Session { - public class Credentials - { - public bool LoggedOn { get; set; } - public ulong SessionToken { get; set; } - - public bool IsValid - { - get { return LoggedOn; } - } - } + public bool IsLoggedOn { get; private set; } public ReadOnlyCollection Licenses { @@ -61,9 +52,6 @@ namespace DepotDownloader // input readonly SteamUser.LogOnDetails logonDetails; - // output - readonly Credentials credentials = new(); - static readonly TimeSpan STEAM3_TIMEOUT = TimeSpan.FromSeconds(30); @@ -91,7 +79,6 @@ namespace DepotDownloader this.callbacks.Subscribe(ConnectedCallback); this.callbacks.Subscribe(DisconnectedCallback); this.callbacks.Subscribe(LogOnCallback); - this.callbacks.Subscribe(SessionTokenCallback); this.callbacks.Subscribe(LicenseListCallback); Console.Write("Connecting to Steam3..."); @@ -124,14 +111,14 @@ namespace DepotDownloader return bAborted; } - public Credentials WaitForCredentials() + public bool WaitForCredentials() { - if (credentials.IsValid || bAborted) - return credentials; + if (IsLoggedOn || bAborted) + return IsLoggedOn; - WaitUntilCallback(() => { }, () => { return credentials.IsValid; }); + WaitUntilCallback(() => { }, () => IsLoggedOn); - return credentials; + return IsLoggedOn; } public void RequestAppInfo(uint appId, bool bForce = false) @@ -685,7 +672,7 @@ namespace DepotDownloader Console.WriteLine(" Done!"); this.seq++; - credentials.LoggedOn = true; + IsLoggedOn = true; if (ContentDownloader.Config.CellID == 0) { @@ -694,12 +681,6 @@ namespace DepotDownloader } } - private void SessionTokenCallback(SteamUser.SessionTokenCallback sessionToken) - { - Console.WriteLine("Got session token!"); - credentials.SessionToken = sessionToken.SessionToken; - } - private void LicenseListCallback(SteamApps.LicenseListCallback licenseList) { if (licenseList.Result != EResult.OK)