mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Add PlayingWasBlocked logic to GamesPlayedWhileIdle
This commit is contained in:
@@ -3273,7 +3273,7 @@ public sealed class Bot : IAsyncDisposable {
|
||||
}
|
||||
|
||||
private async Task ResetGamesPlayed() {
|
||||
if (CardsFarmer.NowFarming) {
|
||||
if (!IsConnectedAndLoggedOn || CardsFarmer.NowFarming) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3285,10 +3285,24 @@ public sealed class Bot : IAsyncDisposable {
|
||||
// This function might be executed before PlayingSessionStateCallback/SharedLibraryLockStatusCallback, ensure proper delay in this case
|
||||
await Task.Delay(2000).ConfigureAwait(false);
|
||||
|
||||
if (CardsFarmer.NowFarming || !IsPlayingPossible) {
|
||||
if (!IsConnectedAndLoggedOn || CardsFarmer.NowFarming || !IsPlayingPossible) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (PlayingWasBlocked) {
|
||||
byte minFarmingDelayAfterBlock = ASF.GlobalConfig?.MinFarmingDelayAfterBlock ?? GlobalConfig.DefaultMinFarmingDelayAfterBlock;
|
||||
|
||||
if (minFarmingDelayAfterBlock > 0) {
|
||||
for (byte i = 0; (i < minFarmingDelayAfterBlock) && IsConnectedAndLoggedOn && !CardsFarmer.NowFarming && IsPlayingPossible && PlayingWasBlocked; i++) {
|
||||
await Task.Delay(1000).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (!IsConnectedAndLoggedOn || CardsFarmer.NowFarming || !IsPlayingPossible) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.BotIdlingSelectedGames, nameof(BotConfig.GamesPlayedWhileIdle), string.Join(", ", BotConfig.GamesPlayedWhileIdle)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user