Allow reconnection logic to run for initial connection. Also bail out of AccountHasAccess without a steamid

pull/8/head
Ryan Kistner 12 years ago
parent fdba42da77
commit a0a1db448a

@ -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<uint> licenseQuery;

@ -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<uint, byte[]>();
@ -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");

Loading…
Cancel
Save