Slightly improve logic of games played while idle

This commit is contained in:
JustArchi
2016-05-28 13:08:53 +02:00
parent 254cd3843e
commit 8e91031510
2 changed files with 11 additions and 12 deletions

View File

@@ -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)) {

View File

@@ -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;
}