示例#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 += tas_Said;

            pollTimer           = new Timer(PollTimeout * 1000);
            pollTimer.Enabled   = false;
            pollTimer.AutoReset = false;
            pollTimer.Elapsed  += pollTimer_Elapsed;

            spring.SpringExited += spring_SpringExited;
            spring.GameOver     += spring_GameOver;

            tas.BattleUserLeft          += tas_BattleUserLeft;
            tas.UserStatusChanged       += tas_UserStatusChanged;
            tas.BattleUserJoined        += tas_BattleUserJoined;
            tas.BattleMapChanged        += tas_BattleMapChanged;
            tas.BattleUserStatusChanged += tas_BattleUserStatusChanged;
            tas.BattleLockChanged       += tas_BattleLockChanged;
            tas.BattleOpened            += tas_BattleOpened;

            linker         = new UnknownFilesLinker(spring);
            fileDownloader = new FileDownloader(spring);
            fileDownloader.DownloadCompleted += fileDownloader_DownloadCompleted;
            //fileDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(fileDownloader_DownloadProgressChanged);

            tas.BattleFound += tas_BattleFound;
        }
示例#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 += tas_Said;

            pollTimer           = new Timer(PollTimeout * 1000);
            pollTimer.Enabled   = false;
            pollTimer.AutoReset = false;
            pollTimer.Elapsed  += pollTimer_Elapsed;

            spring.SpringExited      += spring_SpringExited;
            spring.GameOver          += spring_GameOver;
            spring.NotifyModsChanged += spring_NotifyModsChanged;

            tas.BattleUserLeft          += tas_BattleUserLeft;
            tas.UserStatusChanged       += tas_UserStatusChanged;
            tas.BattleUserJoined        += tas_BattleUserJoined;
            tas.BattleMapChanged        += tas_BattleMapChanged;
            tas.BattleUserStatusChanged += tas_BattleUserStatusChanged;
            tas.BattleLockChanged       += tas_BattleLockChanged;
            tas.BattleOpened            += tas_BattleOpened;

            linkProvider = new ResourceLinkProvider();
            spring.UnitSyncWrapper.Downloader.LinksRecieved += linkProvider.Downloader_LinksRecieved;
        }