Skip to content

Commit

Permalink
fixed issue #11
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Dec 28, 2016
1 parent 6c190f0 commit 2058cb7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ static void processConfirmations(SteamGuardAccount account)
if (account.RefreshSession())
{
if (Verbose) Console.WriteLine("Session refreshed");
Manifest.SaveAccount(account, Manifest.Encrypted);
}
else
{
Expand All @@ -493,21 +494,27 @@ static void processConfirmations(SteamGuardAccount account)
LoginResult loginResult = login.DoLogin();
if (loginResult == LoginResult.Need2FA && !string.IsNullOrEmpty(account.SharedSecret))
{
// if we need a 2fa code, and we can generate it, generate a 2fa code and log in.
if (Verbose) Console.WriteLine(loginResult);
TimeAligner.AlignTime();
login.TwoFactorCode = account.GenerateSteamGuardCode();
if (Verbose) Console.Write($"Logging in {username}... ");
loginResult = login.DoLogin();
}
Console.WriteLine(loginResult);
if (loginResult == LoginResult.LoginOkay)
{
account.Session = login.Session;
}

if (account.RefreshSession())
{
if (Verbose) Console.WriteLine("Session refreshed");
Manifest.SaveAccount(account, Manifest.Encrypted);
}
else
{
Console.WriteLine("Failed to refresh session");
Console.WriteLine("Failed to refresh session, aborting...");
return;
}
}
Expand Down

0 comments on commit 2058cb7

Please sign in to comment.