mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Closes #2891
We used user initiated before as a neat way to let plugins know that the disconnection was initiated by us. Since we use it in other situations now, namely as a result of failed login, we can't do it like this anymore. Instead, trust last log on result, and set it to OK where the disconnection was clean and expected.
This commit is contained in:
@@ -1848,6 +1848,8 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
|
||||
return;
|
||||
}
|
||||
|
||||
LastLogOnResult = EResult.Invalid;
|
||||
|
||||
ArchiLogger.LogGenericInfo(Strings.BotConnecting);
|
||||
InitConnectionFailureTimer();
|
||||
SteamClient.Connect();
|
||||
@@ -1873,6 +1875,8 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
|
||||
|
||||
private void Disconnect() {
|
||||
StopConnectionFailureTimer();
|
||||
|
||||
LastLogOnResult = EResult.OK;
|
||||
SteamClient.Disconnect();
|
||||
}
|
||||
|
||||
@@ -2578,7 +2582,7 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
|
||||
FirstTradeSent = false;
|
||||
OwnedPackageIDs = ImmutableDictionary<uint, (EPaymentMethod PaymentMethod, DateTime TimeCreated)>.Empty;
|
||||
|
||||
await PluginsCore.OnBotDisconnected(this, callback.UserInitiated ? EResult.OK : lastLogOnResult).ConfigureAwait(false);
|
||||
await PluginsCore.OnBotDisconnected(this, lastLogOnResult).ConfigureAwait(false);
|
||||
|
||||
// If we initiated disconnect, do not attempt to reconnect
|
||||
if (callback.UserInitiated && !ReconnectOnUserInitiated) {
|
||||
|
||||
Reference in New Issue
Block a user