mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Slightly improve logic of games played while idle
This commit is contained in:
@@ -277,14 +277,6 @@ namespace ArchiSteamFarm {
|
||||
return false;
|
||||
}
|
||||
|
||||
internal void ResetGamesPlayed() {
|
||||
if (!string.IsNullOrEmpty(BotConfig.CustomGamePlayedWhileIdle)) {
|
||||
ArchiHandler.PlayGame(BotConfig.CustomGamePlayedWhileIdle);
|
||||
} else {
|
||||
ArchiHandler.PlayGames(BotConfig.GamesPlayedWhileIdle);
|
||||
}
|
||||
}
|
||||
|
||||
internal async Task<bool> RefreshSession() {
|
||||
if (!SteamClient.IsConnected) {
|
||||
return false;
|
||||
@@ -324,8 +316,11 @@ namespace ArchiSteamFarm {
|
||||
SkipFirstShutdown = false;
|
||||
} else {
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ResetGamesPlayed();
|
||||
}
|
||||
|
||||
internal async Task<string> Response(ulong steamID, string message) {
|
||||
@@ -1379,6 +1374,14 @@ namespace ArchiSteamFarm {
|
||||
return !string.IsNullOrEmpty(BotConfig.SteamPassword);
|
||||
}
|
||||
|
||||
private void ResetGamesPlayed() {
|
||||
if (!string.IsNullOrEmpty(BotConfig.CustomGamePlayedWhileIdle)) {
|
||||
ArchiHandler.PlayGame(BotConfig.CustomGamePlayedWhileIdle);
|
||||
} else {
|
||||
ArchiHandler.PlayGames(BotConfig.GamesPlayedWhileIdle);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnConnected(SteamClient.ConnectedCallback callback) {
|
||||
if (callback == null) {
|
||||
return;
|
||||
@@ -1675,8 +1678,6 @@ namespace ArchiSteamFarm {
|
||||
// Reset one-time-only access tokens
|
||||
AuthCode = TwoFactorCode = null;
|
||||
|
||||
ResetGamesPlayed();
|
||||
|
||||
if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) {
|
||||
BotConfig.SteamParentalPIN = Program.GetUserInput(Program.EUserInputType.SteamParentalPIN, BotName);
|
||||
if (string.IsNullOrEmpty(BotConfig.SteamParentalPIN)) {
|
||||
|
||||
@@ -427,7 +427,6 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericInfo("Still farming: " + appID, Bot.BotName);
|
||||
}
|
||||
|
||||
Bot.ResetGamesPlayed();
|
||||
Logging.LogGenericInfo("Stopped farming: " + appID, Bot.BotName);
|
||||
return success;
|
||||
}
|
||||
@@ -460,7 +459,6 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericInfo("Still farming: " + string.Join(", ", appIDs), Bot.BotName);
|
||||
}
|
||||
|
||||
Bot.ResetGamesPlayed();
|
||||
Logging.LogGenericInfo("Stopped farming: " + string.Join(", ", appIDs), Bot.BotName);
|
||||
return success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user