mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Make reset command return back to GamesPlayedWhileIdle
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -2888,9 +2888,9 @@ namespace ArchiSteamFarm.Steam.Interaction {
|
||||
return FormatBotResponse(Strings.BotNotConnected);
|
||||
}
|
||||
|
||||
(bool success, string message) = await Bot.Actions.Play(Array.Empty<uint>(), 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<string?> ResponseReset(ulong steamID, string botNames) {
|
||||
|
||||
Reference in New Issue
Block a user