mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +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() {
|
internal bool DeleteRedeemedKeysFiles() {
|
||||||
string unusedKeysFilePath = GetFilePath(EFileType.KeysToRedeemUnused);
|
string unusedKeysFilePath = GetFilePath(EFileType.KeysToRedeemUnused);
|
||||||
|
|
||||||
@@ -1677,27 +1698,6 @@ namespace ArchiSteamFarm.Steam {
|
|||||||
return gamesToRedeemInBackground;
|
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) {
|
private async Task Connect(bool force = false) {
|
||||||
if (!force && (!KeepRunning || SteamClient.IsConnected)) {
|
if (!force && (!KeepRunning || SteamClient.IsConnected)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2888,9 +2888,9 @@ namespace ArchiSteamFarm.Steam.Interaction {
|
|||||||
return FormatBotResponse(Strings.BotNotConnected);
|
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) {
|
private static async Task<string?> ResponseReset(ulong steamID, string botNames) {
|
||||||
|
|||||||
Reference in New Issue
Block a user