Esempio n. 1
0
        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.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);

            linker        = new UnknownFilesLinker(spring);
            mapDownloader = new MapDownloader(spring);
            mapDownloader.DownloadCompleted       += new EventHandler <TasEventArgs>(mapDownloader_DownloadCompleted);
            mapDownloader.DownloadProgressChanged += new EventHandler <TasEventArgs>(mapDownloader_DownloadProgressChanged);

            modDownloader = new ModDownloader(spring);
            modDownloader.DownloadCompleted       += new EventHandler <TasEventArgs>(modDownloader_DownloadCompleted);
            modDownloader.DownloadProgressChanged += new EventHandler <TasEventArgs>(mapDownloader_DownloadProgressChanged);


            tas.BattleFound += new EventHandler <TasEventArgs>(tas_BattleFound);
        }
Esempio n. 2
0
    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.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);

      linker = new UnknownFilesLinker(spring);
      mapDownloader = new MapDownloader(spring);
      mapDownloader.DownloadCompleted += new EventHandler<TasEventArgs>(mapDownloader_DownloadCompleted);
      mapDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(mapDownloader_DownloadProgressChanged);

      modDownloader = new ModDownloader(spring);
      modDownloader.DownloadCompleted += new EventHandler<TasEventArgs>(modDownloader_DownloadCompleted);
      modDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(mapDownloader_DownloadProgressChanged);


      tas.BattleFound += new EventHandler<TasEventArgs>(tas_BattleFound);

    }