Add workaround for rare Steam fuckup

Under rare Steam maintenance it's possible that we can get one rare logon session replaced for no apparent reason.
This commit is contained in:
JustArchi
2018-02-24 23:40:28 +01:00
parent cb1f11bbff
commit 4a90470ccd

View File

@@ -135,6 +135,7 @@ namespace ArchiSteamFarm {
private byte HeartBeatFailures;
private uint ItemsCount;
private EResult LastLogOnResult;
private DateTime LastLogonSessionReplaced = DateTime.MinValue;
private ulong LibraryLockedBySteamID;
private bool LootingAllowed = true;
private bool LootingScheduled;
@@ -1972,9 +1973,16 @@ namespace ArchiSteamFarm {
switch (callback.Result) {
case EResult.LogonSessionReplaced:
ArchiLogger.LogGenericError(Strings.BotLogonSessionReplaced);
Stop();
return;
DateTime now = DateTime.UtcNow;
if (now.Subtract(LastLogonSessionReplaced).TotalHours < 1) {
ArchiLogger.LogGenericError(Strings.BotLogonSessionReplaced);
Stop();
return;
}
LastLogonSessionReplaced = now;
break;
}
ReconnectOnUserInitiated = true;