From fcc59a32e930aaadb29bfcdb8b12f89b6e3bc925 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sun, 25 Dec 2016 19:19:51 -0500 Subject: [PATCH] added re-login on refresh session fail --- Program.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index d527b74..4d01ca8 100644 --- a/Program.cs +++ b/Program.cs @@ -481,7 +481,27 @@ namespace SteamGuard } else { - Console.WriteLine("Failed to refresh session"); + if (Verbose) Console.WriteLine("Failed to refresh session"); + Console.WriteLine("Your Steam credentials have expired. For trade and market confirmations to work properly, please login again."); + string username = account.AccountName; + Console.WriteLine($"Username: {username}"); + Console.Write("Password: "); + var password = Console.ReadLine(); + + UserLogin login = new UserLogin(username, password); + Console.Write($"Logging in {username}... "); + LoginResult loginResult = login.DoLogin(); + Console.WriteLine(loginResult); + + if (account.RefreshSession()) + { + if (Verbose) Console.WriteLine("Session refreshed"); + } + else + { + Console.WriteLine("Failed to refresh session"); + return; + } } Console.WriteLine("Retrieving trade confirmations..."); var trades = account.FetchConfirmations();