public AutoHost(TasClient tas, Spring spring, AutoHostConfig conf) { if (conf == null) LoadConfig(); else config = conf; SaveConfig(); this.tas = tas; this.spring = spring; tas.Said += new EventHandler<TasSayEventArgs>(tas_Said); pollTimer = new Timer(PollTimeout * 1000); pollTimer.Enabled = false; pollTimer.AutoReset = false; pollTimer.Elapsed += new ElapsedEventHandler(pollTimer_Elapsed); spring.SpringExited += new EventHandler(spring_SpringExited); spring.GameOver += new EventHandler<SpringLogEventArgs>(spring_GameOver); tas.BattleUserLeft += new EventHandler<TasEventArgs>(tas_BattleUserLeft); tas.UserRemoved += new EventHandler<TasEventArgs>(tas_UserRemoved); tas.UserStatusChanged += new EventHandler<TasEventArgs>(tas_UserStatusChanged); tas.BattleUserJoined += new EventHandler<TasEventArgs>(tas_BattleUserJoined); tas.BattleMapChanged += new EventHandler<TasEventArgs>(tas_BattleMapChanged); tas.BattleUserStatusChanged += new EventHandler<TasEventArgs>(tas_BattleUserStatusChanged); tas.BattleLockChanged += new EventHandler<TasEventArgs>(tas_BattleLockChanged); mapLinker = new MapLinker(spring); mapDownloader = new MapDownloader(spring); mapDownloader.DownloadCompleted += new EventHandler<TasEventArgs>(mapDownloader_DownloadCompleted); mapDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(mapDownloader_DownloadProgressChanged); tas.BattleFound += new EventHandler<TasEventArgs>(tas_BattleFound); }
public AutoHost(TasClient tas, Spring spring, AutoHostConfig conf) { banList = new BanList(this, tas); if (conf == null) { LoadConfig(); } else { config = conf; } SaveConfig(); this.tas = tas; this.spring = spring; tas.Said += new EventHandler <TasSayEventArgs>(tas_Said); pollTimer = new Timer(PollTimeout * 1000); pollTimer.Enabled = false; pollTimer.AutoReset = false; pollTimer.Elapsed += new ElapsedEventHandler(pollTimer_Elapsed); spring.SpringExited += new EventHandler(spring_SpringExited); spring.GameOver += new EventHandler <SpringLogEventArgs>(spring_GameOver); tas.BattleUserLeft += new EventHandler <TasEventArgs>(tas_BattleUserLeft); tas.UserRemoved += new EventHandler <TasEventArgs>(tas_UserRemoved); tas.UserStatusChanged += new EventHandler <TasEventArgs>(tas_UserStatusChanged); tas.BattleUserJoined += new EventHandler <TasEventArgs>(tas_BattleUserJoined); tas.BattleMapChanged += new EventHandler <TasEventArgs>(tas_BattleMapChanged); tas.BattleUserStatusChanged += new EventHandler <TasEventArgs>(tas_BattleUserStatusChanged); tas.BattleLockChanged += new EventHandler <TasEventArgs>(tas_BattleLockChanged); tas.BattleOpened += new EventHandler <TasEventArgs>(tas_BattleOpened); mapLinker = new MapLinker(spring); mapDownloader = new MapDownloader(spring); mapDownloader.DownloadCompleted += new EventHandler <TasEventArgs>(mapDownloader_DownloadCompleted); mapDownloader.DownloadProgressChanged += new EventHandler <TasEventArgs>(mapDownloader_DownloadProgressChanged); tas.BattleFound += new EventHandler <TasEventArgs>(tas_BattleFound); }