Skip to content

Commit ffa6548

Browse files
committed
Reset games played also OnFarmingStopped()
1 parent 53d59ce commit ffa6548

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ArchiSteamFarm/Bot.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,11 @@ internal async Task<bool> RefreshSession() {
315315
return false;
316316
}
317317

318+
internal void OnFarmingStopped() => ResetGamesPlayed();
319+
318320
internal async Task OnFarmingFinished(bool farmedSomething) {
321+
OnFarmingStopped();
322+
319323
if ((farmedSomething || !FirstTradeSent) && BotConfig.SendOnFarmingFinished) {
320324
FirstTradeSent = true;
321325
await ResponseSendTrade(BotConfig.SteamMasterID).ConfigureAwait(false);
@@ -326,11 +330,8 @@ internal async Task OnFarmingFinished(bool farmedSomething) {
326330
SkipFirstShutdown = false;
327331
} else {
328332
Stop();
329-
return;
330333
}
331334
}
332-
333-
ResetGamesPlayed();
334335
}
335336

336337
internal async Task<string> Response(ulong steamID, string message) {

ArchiSteamFarm/CardsFarmer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ internal async Task StopFarming() {
173173
FarmResetEvent.Set();
174174

175175
Logging.LogGenericInfo("Waiting for reaction...", Bot.BotName);
176-
for (byte i = 0; (i < Program.GlobalConfig.HttpTimeout) && NowFarming; i++) {
176+
for (byte i = 0; (i < 5) && NowFarming; i++) {
177177
await Utilities.SleepAsync(1000).ConfigureAwait(false);
178178
}
179179

@@ -183,6 +183,7 @@ internal async Task StopFarming() {
183183

184184
FarmResetEvent.Reset();
185185
Logging.LogGenericInfo("Farming stopped!", Bot.BotName);
186+
Bot.OnFarmingStopped();
186187
FarmingSemaphore.Release();
187188
}
188189

0 commit comments

Comments
 (0)