avoid repeating code
This commit is contained in:
parent
a0ae3ac369
commit
712a8a1138
1 changed files with 5 additions and 17 deletions
18
Program.cs
18
Program.cs
|
@ -737,9 +737,7 @@ namespace SteamGuard
|
||||||
for (int i = 0; i < SteamGuardAccounts.Length; i++)
|
for (int i = 0; i < SteamGuardAccounts.Length; i++)
|
||||||
{
|
{
|
||||||
SteamGuardAccount account = SteamGuardAccounts[i];
|
SteamGuardAccount account = SteamGuardAccounts[i];
|
||||||
if (user != "")
|
if ((user != "" && account.AccountName.ToLower() == user.ToLower()) || user == "")
|
||||||
{
|
|
||||||
if (account.AccountName.ToLower() == user.ToLower())
|
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Accepting Confirmations on {account.AccountName}");
|
Console.WriteLine($"Accepting Confirmations on {account.AccountName}");
|
||||||
if (Verbose) Console.WriteLine("Refeshing Session...");
|
if (Verbose) Console.WriteLine("Refeshing Session...");
|
||||||
|
@ -750,21 +748,11 @@ namespace SteamGuard
|
||||||
Confirmation[] confirmations = tradesTask.Result;
|
Confirmation[] confirmations = tradesTask.Result;
|
||||||
if (Verbose) Console.WriteLine("Accepting Confirmations...");
|
if (Verbose) Console.WriteLine("Accepting Confirmations...");
|
||||||
account.AcceptMultipleConfirmations(confirmations);
|
account.AcceptMultipleConfirmations(confirmations);
|
||||||
|
if (user != "")
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Accepting Confirmations on {account.AccountName}");
|
|
||||||
if (Verbose) Console.WriteLine("Refeshing Session...");
|
|
||||||
account.RefreshSession();
|
|
||||||
if (Verbose) Console.WriteLine("Fetching Confirmations...");
|
|
||||||
var tradesTask = account.FetchConfirmationsAsync();
|
|
||||||
tradesTask.Wait();
|
|
||||||
Confirmation[] confirmations = tradesTask.Result;
|
|
||||||
if (Verbose) Console.WriteLine("Accepting Confirmations...");
|
|
||||||
account.AcceptMultipleConfirmations(confirmations);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue