Reset games played also OnFarmingStopped()

This commit is contained in:
JustArchi
2016-06-06 17:38:21 +02:00
parent 53d59ce2a9
commit ffa6548594
2 changed files with 6 additions and 4 deletions

View File

@@ -315,7 +315,11 @@ namespace ArchiSteamFarm {
return false;
}
internal void OnFarmingStopped() => ResetGamesPlayed();
internal async Task OnFarmingFinished(bool farmedSomething) {
OnFarmingStopped();
if ((farmedSomething || !FirstTradeSent) && BotConfig.SendOnFarmingFinished) {
FirstTradeSent = true;
await ResponseSendTrade(BotConfig.SteamMasterID).ConfigureAwait(false);
@@ -326,11 +330,8 @@ namespace ArchiSteamFarm {
SkipFirstShutdown = false;
} else {
Stop();
return;
}
}
ResetGamesPlayed();
}
internal async Task<string> Response(ulong steamID, string message) {

View File

@@ -173,7 +173,7 @@ namespace ArchiSteamFarm {
FarmResetEvent.Set();
Logging.LogGenericInfo("Waiting for reaction...", Bot.BotName);
for (byte i = 0; (i < Program.GlobalConfig.HttpTimeout) && NowFarming; i++) {
for (byte i = 0; (i < 5) && NowFarming; i++) {
await Utilities.SleepAsync(1000).ConfigureAwait(false);
}
@@ -183,6 +183,7 @@ namespace ArchiSteamFarm {
FarmResetEvent.Reset();
Logging.LogGenericInfo("Farming stopped!", Bot.BotName);
Bot.OnFarmingStopped();
FarmingSemaphore.Release();
}