Slightly improve PlayingWasBlocked logic

This commit is contained in:
JustArchi
2018-03-24 20:37:59 +01:00
parent 2997f857d5
commit a0440a9ec9
2 changed files with 7 additions and 1 deletions

View File

@@ -1989,6 +1989,10 @@ namespace ArchiSteamFarm {
ArchiLogger.LogGenericInfo(string.Format(Strings.BotLoggedOff, callback.Result));
switch (callback.Result) {
case EResult.LoggedInElsewhere:
// This result directly indicates that playing was blocked when we got (forcefully) disconnected
PlayingWasBlocked = true;
break;
case EResult.LogonSessionReplaced:
DateTime now = DateTime.UtcNow;

View File

@@ -247,7 +247,9 @@ namespace ArchiSteamFarm {
}
if (Bot.PlayingWasBlocked) {
await Task.Delay(Bot.MinPlayingBlockedTTL * 1000).ConfigureAwait(false);
for (byte i = 0; (i < Bot.MinPlayingBlockedTTL) && Bot.IsPlayingPossible; i++) {
await Task.Delay(1000).ConfigureAwait(false);
}
if (!Bot.IsPlayingPossible) {
Bot.ArchiLogger.LogGenericInfo(Strings.PlayingNotAvailable);