diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index c791ab84..88597948 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -104,7 +104,7 @@ namespace DepotDownloader static bool AccountHasAccess( uint depotId ) { - if ( steam3 == null || (steam3.Licenses == null && steam3.steamUser.SteamID.AccountType != EAccountType.AnonUser) ) + if (steam3 == null || steam3.steamUser.SteamID == null || (steam3.Licenses == null && steam3.steamUser.SteamID.AccountType != EAccountType.AnonUser)) return false; IEnumerable licenseQuery; diff --git a/DepotDownloader/Steam3Session.cs b/DepotDownloader/Steam3Session.cs index 8af2bbc6..a828aeb0 100644 --- a/DepotDownloader/Steam3Session.cs +++ b/DepotDownloader/Steam3Session.cs @@ -43,6 +43,7 @@ namespace DepotDownloader bool authenticatedUser; bool bConnected; + bool bConnecting; bool bAborted; DateTime connectTime; @@ -62,6 +63,7 @@ namespace DepotDownloader this.authenticatedUser = details.Username != null; this.credentials = new Credentials(); this.bConnected = false; + this.bConnecting = false; this.bAborted = false; this.AppTickets = new Dictionary(); @@ -283,6 +285,7 @@ namespace DepotDownloader { bAborted = false; bConnected = false; + bConnecting = true; this.connectTime = DateTime.Now; this.steamClient.Connect(); } @@ -300,6 +303,7 @@ namespace DepotDownloader steamClient.Disconnect(); bConnected = false; + bConnecting = false; bAborted = true; } @@ -322,6 +326,7 @@ namespace DepotDownloader private void ConnectedCallback(SteamClient.ConnectedCallback connected) { Console.WriteLine(" Done!"); + bConnecting = false; bConnected = true; if ( !authenticatedUser ) { @@ -339,7 +344,7 @@ namespace DepotDownloader private void DisconnectedCallback(SteamClient.DisconnectedCallback disconnected) { - if (!bConnected || bAborted) + if ((!bConnected && !bConnecting) || bAborted) return; Console.WriteLine("Reconnecting");