diff --git a/ArchiSteamFarm/Steam/Bot.cs b/ArchiSteamFarm/Steam/Bot.cs index fe91b1b94..053b0b45f 100644 --- a/ArchiSteamFarm/Steam/Bot.cs +++ b/ArchiSteamFarm/Steam/Bot.cs @@ -2561,16 +2561,6 @@ public sealed class Bot : IAsyncDisposable, IDisposable { throw new InvalidOperationException(nameof(ASF.LoginRateLimitingSemaphore)); } - EResult lastLogOnResult = LastLogOnResult; - - if (lastLogOnResult == EResult.Invalid) { - // Allow for a very short delay to initialize LastLogOnResult - await Task.Delay(1000).ConfigureAwait(false); - - lastLogOnResult = LastLogOnResult; - } - - LastLogOnResult = EResult.Invalid; HeartBeatFailures = 0; StopConnectionFailureTimer(); StopPlayingWasBlockedTimer(); @@ -2587,6 +2577,17 @@ public sealed class Bot : IAsyncDisposable, IDisposable { FirstTradeSent = false; OwnedPackageIDs = ImmutableDictionary.Empty; + EResult lastLogOnResult = LastLogOnResult; + + if (lastLogOnResult == EResult.Invalid) { + // Allow for a very short delay to initialize LastLogOnResult + await Task.Delay(1000).ConfigureAwait(false); + + lastLogOnResult = LastLogOnResult; + } + + LastLogOnResult = EResult.Invalid; + await PluginsCore.OnBotDisconnected(this, lastLogOnResult).ConfigureAwait(false); // If we initiated disconnect, do not attempt to reconnect