fix #11 again, this time for accept-all
This commit is contained in:
parent
8f9cbda78e
commit
62a5817376
1 changed files with 53 additions and 33 deletions
44
Program.cs
44
Program.cs
|
@ -553,17 +553,8 @@ namespace SteamGuard
|
|||
Ignore = -1
|
||||
}
|
||||
|
||||
static void processConfirmations(SteamGuardAccount account)
|
||||
static bool promptRefreshSession(SteamGuardAccount account)
|
||||
{
|
||||
Utils.Verbose("Refeshing Session...");
|
||||
if (account.RefreshSession())
|
||||
{
|
||||
Utils.Verbose("Session refreshed");
|
||||
Manifest.SaveAccount(account, Manifest.Encrypted);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.Verbose("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}");
|
||||
|
@ -592,11 +583,28 @@ namespace SteamGuard
|
|||
{
|
||||
Utils.Verbose("Session refreshed");
|
||||
Manifest.SaveAccount(account, Manifest.Encrypted);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void processConfirmations(SteamGuardAccount account)
|
||||
{
|
||||
Utils.Verbose("Refeshing Session...");
|
||||
if (account.RefreshSession())
|
||||
{
|
||||
Utils.Verbose("Session refreshed");
|
||||
Manifest.SaveAccount(account, Manifest.Encrypted);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.Verbose("Failed to refresh session, prompting user...");
|
||||
if (!promptRefreshSession(account))
|
||||
{
|
||||
Console.WriteLine("Failed to refresh session, aborting...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("Retrieving trade confirmations...");
|
||||
|
@ -745,7 +753,19 @@ namespace SteamGuard
|
|||
{
|
||||
Console.WriteLine($"Accepting Confirmations on {account.AccountName}");
|
||||
Utils.Verbose("Refeshing Session...");
|
||||
account.RefreshSession();
|
||||
if (account.RefreshSession())
|
||||
{
|
||||
Utils.Verbose("Session refreshed");
|
||||
Manifest.SaveAccount(account, Manifest.Encrypted);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.Verbose("Failed to refresh session, prompting user...");
|
||||
if (!promptRefreshSession(account))
|
||||
{
|
||||
Console.WriteLine("Failed to refresh session, aborting...");
|
||||
}
|
||||
}
|
||||
Utils.Verbose("Fetching Confirmations...");
|
||||
var tradesTask = account.FetchConfirmationsAsync();
|
||||
tradesTask.Wait();
|
||||
|
|
Loading…
Reference in a new issue