Exemplo n.º 1
0
        public void QueueHitboxChecks()
        {
            _hitboxTimer = new Timer(async(e) =>
            {
                var metrics               = new PerformanceMetrics();
                metrics.CreatedDate       = DateTime.UtcNow;
                metrics.IsOwner           = false;
                metrics.Platform          = Constants.Smashcast;
                metrics.ScheduledInterval = _botSettings.IntervalSettings.Smashcast;

                Stopwatch sw = new Stopwatch();
                sw.Start();
                Logging.LogSmashcast("Checking Smashcast Channels.");
                await _platformServices.CheckHitboxLive();
                sw.Stop();
                metrics.RunTime = sw.ElapsedMilliseconds;
                await _loggingManager.LogPerformance(metrics);
                Logging.LogSmashcast("Smashcast Check Complete - Elapsed Runtime: " + sw.ElapsedMilliseconds + " milliseconds.");
            }, null, 0, _botSettings.IntervalSettings.Smashcast);

            _hitboxOwnerTimer = new Timer(async(e) =>
            {
                var metrics               = new PerformanceMetrics();
                metrics.CreatedDate       = DateTime.UtcNow;
                metrics.IsOwner           = true;
                metrics.Platform          = Constants.Smashcast;
                metrics.ScheduledInterval = _botSettings.IntervalSettings.Smashcast;

                Stopwatch sw = new Stopwatch();
                sw.Start();
                Logging.LogSmashcast("Checking Owner Smashcast Channels.");
                await _platformServices.CheckOwnerHitboxLive();
                sw.Stop();
                metrics.RunTime = sw.ElapsedMilliseconds;
                await _loggingManager.LogPerformance(metrics);
                Logging.LogSmashcast("Owner Smashcast Check Complete - Elapsed Runtime: " + sw.ElapsedMilliseconds + " milliseconds.");
            }, null, 0, _botSettings.IntervalSettings.Smashcast);
        }