예제 #1
0
        public AseBehaviour(IAseQueryService aseQueryService, Configuration configuration, ILogger logger)
        {
            this.aseQueryService = aseQueryService;
            this.logger          = logger;

            aseVersion = AseVersion.v1_5;

            lightCache = new Cache <byte[]>(() => aseQueryService.QueryLight(), cacheTime);
            xFireCache = new Cache <byte[]>(() => aseQueryService.QueryXFireLight(), cacheTime);
            fullCache  = new Cache <byte[]>(() => aseQueryService.QueryFull(), cacheTime);

            StartListening((ushort)(configuration.Port + 123));
        }
예제 #2
0
        public MasterServerAnnouncementBehaviour(HttpClient httpClient, Configuration configuration, ILogger logger, string masterServerUrl, IAseQueryService aseQueryService)
        {
            this.httpClient      = httpClient;
            this.configuration   = configuration;
            this.logger          = logger;
            this.masterServerUrl = masterServerUrl;
            this.aseQueryService = aseQueryService;

            this.timer = new Timer(720_000)
            {
                AutoReset = true,
                Enabled   = true
            };
            timer.Elapsed += OnTimerElapsed;

            _ = this.AnnounceToMasterServer();
        }