From 06b20856385c0aad9fbf103fa3039faddb6fd5a6 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Thu, 18 Apr 2024 10:44:42 +0200 Subject: [PATCH] Track DoH/DoL job levels --- Influx/Influx.csproj | 2 +- Influx/Influx/InfluxStatisticsClient.cs | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Influx/Influx.csproj b/Influx/Influx.csproj index 008bc5d..b4ca043 100644 --- a/Influx/Influx.csproj +++ b/Influx/Influx.csproj @@ -1,7 +1,7 @@ net8.0-windows - 0.13 + 0.14 12 enable true diff --git a/Influx/Influx/InfluxStatisticsClient.cs b/Influx/Influx/InfluxStatisticsClient.cs index 30fb5ce..e0d841c 100644 --- a/Influx/Influx/InfluxStatisticsClient.cs +++ b/Influx/Influx/InfluxStatisticsClient.cs @@ -24,7 +24,7 @@ internal sealed class InfluxStatisticsClient : IDisposable private readonly IPluginLog _pluginLog; private readonly IReadOnlyDictionary _classJobToArrayIndex; private readonly IReadOnlyDictionary _classJobNames; - private readonly IReadOnlyDictionary _expToJobs; + private readonly IReadOnlyDictionary _expToJobs; private readonly ReadOnlyDictionary _prices; public InfluxStatisticsClient(IChatGui chatGui, Configuration configuration, IDataManager dataManager, @@ -40,10 +40,10 @@ internal sealed class InfluxStatisticsClient : IDisposable .ToDictionary(x => (byte)x.RowId, x => (byte)x.ExpArrayIndex); _classJobNames = dataManager.GetExcelSheet()!.Where(x => x.RowId > 0) .ToDictionary(x => (byte)x.RowId, x => x.Abbreviation.ToString()); - _expToJobs = dataManager.GetExcelSheet()!.Where(x => x.RowId > 0) - .Where(x => x.JobIndex > 0) + _expToJobs = dataManager.GetExcelSheet()!.Where(x => x.RowId > 0 && !string.IsNullOrEmpty(x.Name)) + .Where(x => x.JobIndex > 0 || x.DohDolJobIndex >= 0) .Where(x => x.Abbreviation.ToString() != "SMN") - .ToDictionary(x => x.ExpArrayIndex, x => x.Abbreviation.ToString()); + .ToDictionary(x => x.ExpArrayIndex, x => new ClassJobDetail(x.Abbreviation.ToString(), x.DohDolJobIndex >= 0)); _prices = dataManager.GetExcelSheet()! .AsEnumerable() .ToDictionary(x => x.RowId, x => new PriceInfo @@ -207,13 +207,14 @@ internal sealed class InfluxStatisticsClient : IDisposable if (localStats.ClassJobLevels.Count > 0) { - foreach (var (expIndex, abbreviation) in _expToJobs) + foreach (var (expIndex, job) in _expToJobs) { var level = localStats.ClassJobLevels[expIndex]; if (level > 0) { yield return pointData("experience") - .Tag("job", abbreviation) + .Tag("job", job.Abbreviation) + .Tag("job_type", job.Type) .Field("level", level); } } @@ -330,4 +331,9 @@ internal sealed class InfluxStatisticsClient : IDisposable public uint Hq => Normal + (uint)Math.Ceiling((decimal)Normal / 10); public uint UiCategory { get; set; } } + + private sealed record ClassJobDetail(string Abbreviation, bool IsNonCombat) + { + public string Type => IsNonCombat ? "doh_dol" : "combat"; + } }