File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments