File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -838,7 +838,11 @@ private string ResponseFarm(ulong steamID) {
838838 return "This bot instance is not connected!" ;
839839 }
840840
841- CardsFarmer . RestartFarming ( ) . Forget ( ) ;
841+ if ( CardsFarmer . CurrentGamesFarming . Count > 0 ) {
842+ return "This bot instance is farming already!" ;
843+ }
844+
845+ CardsFarmer . StartFarming ( ) . Forget ( ) ;
842846 return "Done!" ;
843847 }
844848
@@ -1662,7 +1666,8 @@ private async void OnGuestPassList(SteamApps.GuestPassListCallback callback) {
16621666 }
16631667
16641668 if ( acceptedSomething ) {
1665- CardsFarmer . RestartFarming ( ) . Forget ( ) ;
1669+ // Start farming, but only if we're not farming already
1670+ CardsFarmer . StartFarming ( ) . Forget ( ) ;
16661671 }
16671672 }
16681673
@@ -2017,8 +2022,8 @@ private void OnPurchaseResponse(ArchiHandler.PurchaseResponseCallback callback)
20172022 }
20182023
20192024 if ( callback . PurchaseResult == ArchiHandler . PurchaseResponseCallback . EPurchaseResult . OK ) {
2020- // We will restart CF module to recalculate current status and decide about new optimal approach
2021- CardsFarmer . RestartFarming ( ) . Forget ( ) ;
2025+ // Start farming, but only if we're not farming already
2026+ CardsFarmer . StartFarming ( ) . Forget ( ) ;
20222027 }
20232028 }
20242029 }
Original file line number Diff line number Diff line change @@ -187,11 +187,6 @@ internal async Task StopFarming() {
187187 FarmingSemaphore . Release ( ) ;
188188 }
189189
190- internal async Task RestartFarming ( ) {
191- await StopFarming ( ) . ConfigureAwait ( false ) ;
192- await StartFarming ( ) . ConfigureAwait ( false ) ;
193- }
194-
195190 internal void OnNewItemsNotification ( ) {
196191 if ( ! NowFarming ) {
197192 return ;
You can’t perform that action at this time.
0 commit comments