diff --git a/ArchiSteamFarm/Steam/Bot.cs b/ArchiSteamFarm/Steam/Bot.cs index 39e0f89a9..ea1d7edf4 100644 --- a/ArchiSteamFarm/Steam/Bot.cs +++ b/ArchiSteamFarm/Steam/Bot.cs @@ -895,6 +895,27 @@ namespace ArchiSteamFarm.Steam { } } + internal async Task CheckOccupationStatus() { + StopPlayingWasBlockedTimer(); + + if (!IsPlayingPossible) { + PlayingWasBlocked = true; + ArchiLogger.LogGenericInfo(Strings.BotAccountOccupied); + + return; + } + + if (PlayingWasBlocked && (PlayingWasBlockedTimer == null)) { + InitPlayingWasBlockedTimer(); + } + + ArchiLogger.LogGenericInfo(Strings.BotAccountFree); + + if (!await CardsFarmer.Resume(false).ConfigureAwait(false)) { + await ResetGamesPlayed().ConfigureAwait(false); + } + } + internal bool DeleteRedeemedKeysFiles() { string unusedKeysFilePath = GetFilePath(EFileType.KeysToRedeemUnused); @@ -1677,27 +1698,6 @@ namespace ArchiSteamFarm.Steam { return gamesToRedeemInBackground; } - private async Task CheckOccupationStatus() { - StopPlayingWasBlockedTimer(); - - if (!IsPlayingPossible) { - PlayingWasBlocked = true; - ArchiLogger.LogGenericInfo(Strings.BotAccountOccupied); - - return; - } - - if (PlayingWasBlocked && (PlayingWasBlockedTimer == null)) { - InitPlayingWasBlockedTimer(); - } - - ArchiLogger.LogGenericInfo(Strings.BotAccountFree); - - if (!await CardsFarmer.Resume(false).ConfigureAwait(false)) { - await ResetGamesPlayed().ConfigureAwait(false); - } - } - private async Task Connect(bool force = false) { if (!force && (!KeepRunning || SteamClient.IsConnected)) { return; diff --git a/ArchiSteamFarm/Steam/Interaction/Commands.cs b/ArchiSteamFarm/Steam/Interaction/Commands.cs index 18fb762a5..695ba519b 100644 --- a/ArchiSteamFarm/Steam/Interaction/Commands.cs +++ b/ArchiSteamFarm/Steam/Interaction/Commands.cs @@ -2888,9 +2888,9 @@ namespace ArchiSteamFarm.Steam.Interaction { return FormatBotResponse(Strings.BotNotConnected); } - (bool success, string message) = await Bot.Actions.Play(Array.Empty(), Bot.BotConfig.CustomGamePlayedWhileIdle).ConfigureAwait(false); + await Bot.CheckOccupationStatus().ConfigureAwait(false); - return FormatBotResponse(success ? message : string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, message)); + return FormatBotResponse(Strings.Done); } private static async Task ResponseReset(ulong steamID, string botNames) {