33using System . Threading ;
44using System . IO ;
55using System . Windows . Forms ;
6+ using System . Linq ;
67using SteamKit2 ;
78using System . Timers ;
89using SteamKit2 . Internal ;
@@ -116,7 +117,7 @@ public enum BotState
116117 /// <summary>
117118 /// Timer to simulate stopping and restarting a game
118119 /// </summary>
119- private System . Timers . Timer mGameTimer ;
120+ private System . Timers . Timer mGameTimer = new System . Timers . Timer ( ) ;
120121
121122
122123 /// <summary>
@@ -139,6 +140,7 @@ public BotClass(Config.AccountInfo info, Config.Settings settings)
139140 Password = info . Password
140141 } ;
141142 mInfo = info ;
143+ mSettings = settings ;
142144 mSteam . games = info . Games ;
143145 mSteam . sentryPath = Path . Combine ( Application . StartupPath , string . Format ( "Sentryfiles\\ {0}.sentry" , info . Username ) ) ;
144146
@@ -312,7 +314,7 @@ private void OnLoggedOn(SteamUser.LoggedOnCallback callback)
312314 if ( callback . Result == EResult . InvalidPassword )
313315 {
314316 /*Delete old user info*/
315- Properties . Settings . Default . UserInfo . Add ( userInfo ) ;
317+ Properties . Settings . Default . UserInfo . Remove ( userInfo ) ;
316318 Properties . Settings . Default . Save ( ) ;
317319
318320 Print ( "{0} - Invalid password! Try again:" , callback . Result ) ;
@@ -363,7 +365,6 @@ private void OnLoggedOn(SteamUser.LoggedOnCallback callback)
363365 /*Set the timer if it's not already enabled*/
364366 if ( ! mGameTimer . Enabled && mSettings . RestartGamesEveryThreeHours )
365367 {
366- mGameTimer = new System . Timers . Timer ( ) ;
367368 mGameTimer . Interval = TimeSpan . FromMinutes ( 180 + extraTime ) . TotalMilliseconds ;
368369 mGameTimer . Elapsed += new ElapsedEventHandler ( PreformStopStart ) ;
369370 mGameTimer . Start ( ) ;
0 commit comments