mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-15 16:10:41 +00:00
Switch to new async methods
This commit is contained in:
@@ -160,15 +160,15 @@ namespace ArchiSteamFarm {
|
|||||||
var fireAndForget = Task.Run(async () => await Start().ConfigureAwait(false));
|
var fireAndForget = Task.Run(async () => await Start().ConfigureAwait(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void AcceptAllConfirmations() {
|
internal async Task AcceptAllConfirmations() {
|
||||||
if (SteamGuardAccount == null) {
|
if (SteamGuardAccount == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SteamGuardAccount.RefreshSession();
|
await SteamGuardAccount.RefreshSessionAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
foreach (Confirmation confirmation in SteamGuardAccount.FetchConfirmations()) {
|
foreach (Confirmation confirmation in await SteamGuardAccount.FetchConfirmationsAsync().ConfigureAwait(false)) {
|
||||||
if (SteamGuardAccount.AcceptConfirmation(confirmation)) {
|
if (SteamGuardAccount.AcceptConfirmation(confirmation)) {
|
||||||
Logging.LogGenericInfo(BotName, "Accepting confirmation: Success!");
|
Logging.LogGenericInfo(BotName, "Accepting confirmation: Success!");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await Task.WhenAll(tasks).ConfigureAwait(false);
|
await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||||
Bot.AcceptAllConfirmations();
|
await Bot.AcceptAllConfirmations().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ParseTrade(SteamTradeOffer tradeOffer) {
|
private async Task ParseTrade(SteamTradeOffer tradeOffer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user