private void ReportExperience(string reporterName)
        {
            LastResult = GetResult();

            var TimeOfLastRun  = DateTime.UtcNow - _tickStartTime;
            var TimeOfSession  = DateTime.UtcNow - _startTime;
            var AverageRunTime = new TimeSpan(TimeOfSession.Ticks / _tick);
            var ThisExpHour    = CurrentExperience / TimeOfLastRun.TotalHours;

            if (_bestTime == TimeSpan.Zero || _bestTime > TimeOfLastRun)
            {
                _bestTime = TimeOfLastRun;
            }
            if (_worseTime < TimeOfLastRun)
            {
                _worseTime = TimeOfLastRun;
            }
            if (MaxExperienceRun < CurrentExperience)
            {
                MaxExperienceRun = CurrentExperience;
            }
            if (MinExperienceRun == 0 || MinExperienceRun > CurrentExperience)
            {
                MinExperienceRun = CurrentExperience;
            }
            if (MaxExperience < ThisExpHour)
            {
                MaxExperience = ThisExpHour;
            }
            if (MinExperience == 0 || MinExperience > ThisExpHour)
            {
                MinExperience = ThisExpHour;
            }

            Core.Logger.Warn("[{0}] Runs count: {1}", reporterName, _tick);
            Core.Logger.Warn("[{0}] This run time: {1}:{2:D2}:{3:D2}", reporterName, TimeOfLastRun.Hours, TimeOfLastRun.Minutes, TimeOfLastRun.Seconds);
            Core.Logger.Warn("[{0}] Average run time: {1}:{2:D2}:{3:D2}", reporterName, AverageRunTime.Hours, AverageRunTime.Minutes, AverageRunTime.Seconds);
            Core.Logger.Warn("[{0}] Best run time: {1}:{2:D2}:{3:D2}", reporterName, _bestTime.Hours, _bestTime.Minutes, _bestTime.Seconds);
            Core.Logger.Warn("[{0}] Worse run time: {1}:{2:D2}:{3:D2}", reporterName, _worseTime.Hours, _worseTime.Minutes, _worseTime.Seconds);
            Core.Logger.Warn("[{0}] This run XP Gained: {1:0,0}", reporterName, CurrentExperience);
            Core.Logger.Warn("[{0}] This run / Hour: {1:0,0}", reporterName, ThisExpHour);
            Core.Logger.Warn("[{0}] Total XP Gained: {1:0,0}", reporterName, TotalExperience);
            Core.Logger.Warn("[{0}] Total XP / Hour: {1:0,0}", reporterName, TotalExperience / TimeOfSession.TotalHours);
            Core.Logger.Warn("[{0}] Best XP / Hour (single run): {1:0,0}", reporterName, MaxExperience);
            Core.Logger.Warn("[{0}] Worse XP / Hour (single run): {1:0,0}", reporterName, MinExperience);
            Core.Logger.Warn("[{0}] Best XP / Single run: {1:0,0}", reporterName, MaxExperienceRun);
            Core.Logger.Warn("[{0}] Worse XP / Single run: {1:0,0}", reporterName, MinExperienceRun);
        }
Ejemplo n.º 2
0
        private void ReportExperience(string reporterName)
        {
            LastResult = GetResult();

            var timeOfLastRun  = DateTime.UtcNow - _tickStartTime;
            var timeOfSession  = DateTime.UtcNow - _startTime;
            var averageRunTime = new TimeSpan(timeOfSession.Ticks / _tick);
            var thisExpHour    = _currentExperience / timeOfLastRun.TotalHours;

            if (_bestTime == TimeSpan.Zero || _bestTime > timeOfLastRun)
            {
                _bestTime = timeOfLastRun;
            }
            if (_worseTime < timeOfLastRun)
            {
                _worseTime = timeOfLastRun;
            }
            if (_maxExperienceRun < _currentExperience)
            {
                _maxExperienceRun = _currentExperience;
            }
            if (Math.Abs(_minExperienceRun) < double.Epsilon || _minExperienceRun > _currentExperience)
            {
                _minExperienceRun = _currentExperience;
            }
            if (_maxExperience < thisExpHour)
            {
                _maxExperience = thisExpHour;
            }
            if (Math.Abs(_minExperience) < double.Epsilon || _minExperience > thisExpHour)
            {
                _minExperience = thisExpHour;
            }

            s_logger.Information($"[{reporterName}] Runs count: {_tick}");
            s_logger.Information($"[{reporterName}] This run time: {timeOfLastRun}");
            s_logger.Information($"[{reporterName}] Average run time: {averageRunTime}");
            s_logger.Information($"[{reporterName}] Best run time: {_bestTime}");
            s_logger.Information($"[{reporterName}] Worse run time: {_worseTime}");
            s_logger.Information($"[{reporterName}] This run XP Gained: {_currentExperience:0,0}");
            s_logger.Information($"[{reporterName}] This run / Hour: {thisExpHour:0,0}");
            s_logger.Information($"[{reporterName}] Total XP Gained: {_totalExperience:0,0}");
            s_logger.Information($"[{reporterName}] Total XP / Hour: {(_totalExperience / timeOfSession.TotalHours):0,0}");
            s_logger.Information($"[{reporterName}] Best XP / Hour (single run): {_maxExperience:0,0}");
            s_logger.Information($"[{reporterName}] Worse XP / Hour (single run): {_minExperience:0,0}");
            s_logger.Information($"[{reporterName}] Best XP / Single run: {_maxExperienceRun:0,0}");
            s_logger.Information($"[{reporterName}] Worse XP / Single run: {_minExperienceRun:0,0}");
        }