mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Fix GamesPlayedWhileIdle
This commit is contained in:
@@ -2022,6 +2022,8 @@ namespace ArchiSteamFarm {
|
||||
|
||||
ArchiLogger.LogGenericInfo(Strings.BotDisconnected);
|
||||
|
||||
OwnedPackageIDs.Clear();
|
||||
|
||||
Actions.OnDisconnected();
|
||||
ArchiWebHandler.OnDisconnected();
|
||||
CardsFarmer.OnDisconnected();
|
||||
@@ -2245,6 +2247,8 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
bool initialLogin = OwnedPackageIDs.Count == 0;
|
||||
|
||||
Commands.OnNewLicenseList();
|
||||
OwnedPackageIDs.Clear();
|
||||
|
||||
@@ -2264,6 +2268,11 @@ namespace ArchiSteamFarm {
|
||||
ArchiLogger.LogGenericInfo(Strings.Done);
|
||||
}
|
||||
|
||||
if (initialLogin && CardsFarmer.Paused) {
|
||||
// Emit initial game playing status in this case
|
||||
await ResetGamesPlayed().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
await CardsFarmer.OnNewGameAdded().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -2837,15 +2846,19 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
private async Task ResetGamesPlayed() {
|
||||
if (!IsPlayingPossible || CardsFarmer.NowFarming) {
|
||||
if (CardsFarmer.NowFarming) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (BotConfig.GamesPlayedWhileIdle.Count > 0) {
|
||||
if (!IsPlayingPossible) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This function might be executed before PlayingSessionStateCallback/SharedLibraryLockStatusCallback, ensure proper delay in this case
|
||||
await Task.Delay(2000).ConfigureAwait(false);
|
||||
|
||||
if (!IsPlayingPossible || CardsFarmer.NowFarming) {
|
||||
if (CardsFarmer.NowFarming || !IsPlayingPossible) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user