mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-14 15:40:39 +00:00
Improve cooldown when ASF detects recent playing
This commit is contained in:
@@ -1460,14 +1460,17 @@ namespace ArchiSteamFarm {
|
||||
StopPlayingWasBlockedTimer();
|
||||
|
||||
if (!IsPlayingPossible) {
|
||||
ArchiLogger.LogGenericInfo(Strings.BotAccountOccupied);
|
||||
PlayingWasBlocked = true;
|
||||
ArchiLogger.LogGenericInfo(Strings.BotAccountOccupied);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (PlayingWasBlocked && (PlayingWasBlockedTimer == null)) {
|
||||
InitPlayingWasBlockedTimer();
|
||||
}
|
||||
|
||||
ArchiLogger.LogGenericInfo(Strings.BotAccountFree);
|
||||
PlayingWasBlocked = false;
|
||||
|
||||
if (!await CardsFarmer.Resume(false).ConfigureAwait(false)) {
|
||||
await ResetGamesPlayed().ConfigureAwait(false);
|
||||
@@ -1797,6 +1800,19 @@ namespace ArchiSteamFarm {
|
||||
await RegisterBot(BotName).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private void InitPlayingWasBlockedTimer() {
|
||||
if (PlayingWasBlockedTimer != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
PlayingWasBlockedTimer = new Timer(
|
||||
e => ResetPlayingWasBlockedWithTimer(),
|
||||
null,
|
||||
TimeSpan.FromSeconds(MinPlayingBlockedTTL), // Delay
|
||||
Timeout.InfiniteTimeSpan // Period
|
||||
);
|
||||
}
|
||||
|
||||
private void InitStart() {
|
||||
if (!BotConfig.Enabled) {
|
||||
ArchiLogger.LogGenericInfo(Strings.BotInstanceNotStartingBecauseDisabled);
|
||||
@@ -2353,12 +2369,7 @@ namespace ArchiSteamFarm {
|
||||
PlayingBlocked = false;
|
||||
|
||||
if (PlayingWasBlocked && (PlayingWasBlockedTimer == null)) {
|
||||
PlayingWasBlockedTimer = new Timer(
|
||||
e => ResetPlayingWasBlockedWithTimer(),
|
||||
null,
|
||||
TimeSpan.FromSeconds(MinPlayingBlockedTTL), // Delay
|
||||
Timeout.InfiniteTimeSpan // Period
|
||||
);
|
||||
InitPlayingWasBlockedTimer();
|
||||
}
|
||||
|
||||
if (IsAccountLimited) {
|
||||
|
||||
Reference in New Issue
Block a user