diff --git a/EnoCore/EnoCore.csproj b/EnoCore/EnoCore.csproj index 8de3bb4b..b98e556d 100644 --- a/EnoCore/EnoCore.csproj +++ b/EnoCore/EnoCore.csproj @@ -14,7 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/EnoCore/Logging/EnoLogger.cs b/EnoCore/Logging/EnoLogger.cs index 1b596de8..29d19604 100644 --- a/EnoCore/Logging/EnoLogger.cs +++ b/EnoCore/Logging/EnoLogger.cs @@ -14,12 +14,14 @@ public class EnoLogger : ILogger private readonly string categoryName; private readonly IEnoLogMessageProvider provider; private readonly string tool; + private readonly string? serviceName; - public EnoLogger(IEnoLogMessageProvider provider, string categoryName, string tool) + public EnoLogger(IEnoLogMessageProvider provider, string categoryName, string tool, string? serviceName = null) { this.provider = provider; this.categoryName = categoryName; this.tool = tool; + this.serviceName = serviceName; } public static string GetSeverity(LogLevel logLevel) @@ -150,7 +152,7 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except message, null, null, - null, + this.serviceName, null); this.provider.Log($"##ENOLOGMESSAGE {JsonSerializer.Serialize(enoLogMessage, EnoCoreUtil.CamelCaseEnumConverterOptions)}\n"); } diff --git a/EnoCore/Scoreboard/Scoreboard.cs b/EnoCore/Scoreboard/Scoreboard.cs index 25465bfb..2b21a12a 100644 --- a/EnoCore/Scoreboard/Scoreboard.cs +++ b/EnoCore/Scoreboard/Scoreboard.cs @@ -8,7 +8,7 @@ using EnoCore.Models; public record Scoreboard( - long? CurrentRound, + long CurrentRound, string? StartTimestamp, double? StartTimeEpoch, string? EndTimestamp, diff --git a/FlagShooter/Program.cs b/FlagShooter/Program.cs index 861059c6..825859ed 100644 --- a/FlagShooter/Program.cs +++ b/FlagShooter/Program.cs @@ -127,9 +127,9 @@ public List> BeginSubmitFlags(long flagCount) try { long i = 0; - if (sb != null && sb.CurrentRound != null && sb.CurrentRound > 0) + if (sb != null && sb.CurrentRound > 0) { - for (long r = sb.CurrentRound.Value; r > Math.Max(sb.CurrentRound.Value - this.configuration.FlagValidityInRounds, 0); r--) + for (long r = sb.CurrentRound; r > Math.Max(sb.CurrentRound - this.configuration.FlagValidityInRounds, 0); r--) { for (int team = 0; team < this.configuration.Teams.Count; team++) {