File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,12 @@ internal async Task Start() {
233
233
IsRunning = true ;
234
234
235
235
Logging . LogGenericInfo ( BotName , "Starting..." ) ;
236
- await Program . LimitSteamRequestsAsync ( ) . ConfigureAwait ( false ) ;
236
+
237
+ // 2FA tokens are expiring soon, use limiter only when we don't have any pending
238
+ if ( TwoFactorAuth == null ) {
239
+ await Program . LimitSteamRequestsAsync ( ) . ConfigureAwait ( false ) ;
240
+ }
241
+
237
242
SteamClient . Connect ( ) ;
238
243
239
244
var fireAndForget = Task . Run ( ( ) => HandleCallbacks ( ) ) ;
@@ -398,7 +403,12 @@ private async void OnDisconnected(SteamClient.DisconnectedCallback callback) {
398
403
}
399
404
400
405
Logging . LogGenericWarning ( BotName , "Disconnected from Steam, reconnecting..." ) ;
401
- await Program . LimitSteamRequestsAsync ( ) . ConfigureAwait ( false ) ;
406
+
407
+ // 2FA tokens are expiring soon, use limiter only when we don't have any pending
408
+ if ( TwoFactorAuth == null ) {
409
+ await Program . LimitSteamRequestsAsync ( ) . ConfigureAwait ( false ) ;
410
+ }
411
+
402
412
SteamClient . Connect ( ) ;
403
413
}
404
414
@@ -533,6 +543,10 @@ private async void OnLoggedOn(SteamUser.LoggedOnCallback callback) {
533
543
case EResult . OK :
534
544
Logging . LogGenericInfo ( BotName , "Successfully logged on!" ) ;
535
545
546
+ // Reset one-time-only access tokens
547
+ AuthCode = null ;
548
+ TwoFactorAuth = null ;
549
+
536
550
if ( ! SteamNickname . Equals ( "null" ) ) {
537
551
SteamFriends . SetPersonaName ( SteamNickname ) ;
538
552
}
You can’t perform that action at this time.
0 commit comments