diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index bfd679a2b..1d393cd56 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -673,7 +673,7 @@ namespace IW4MAdmin else if (E.Type == GameEvent.EventType.MapChange) { - ServerLogger.LogInformation("New map loaded - {clientCount} active players", ClientNum); + ServerLogger.LogInformation("New map loaded - {ClientCount} active players", ClientNum); // iw4 doesn't log the game info if (E.Extra == null) @@ -737,6 +737,8 @@ namespace IW4MAdmin { lastGameTime = E.GameTime.Value; } + + MatchStartTime = DateTime.Now; } else if (E.Type == GameEvent.EventType.MapEnd) @@ -747,6 +749,8 @@ namespace IW4MAdmin { lastGameTime = E.GameTime.Value; } + + MatchEndTime = DateTime.Now; } else if (E.Type == GameEvent.EventType.Tell) diff --git a/SharedLibraryCore/Interfaces/IGameServer.cs b/SharedLibraryCore/Interfaces/IGameServer.cs index 1d63870b9..707ee865c 100644 --- a/SharedLibraryCore/Interfaces/IGameServer.cs +++ b/SharedLibraryCore/Interfaces/IGameServer.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; using Data.Models; using SharedLibraryCore.Database.Models; @@ -14,6 +15,8 @@ namespace SharedLibraryCore.Interfaces /// source of kick action /// previous penalty the kick is occuring for (if applicable) /// - public Task Kick(string reason, EFClient target, EFClient origin, EFPenalty previousPenalty = null); + Task Kick(string reason, EFClient target, EFClient origin, EFPenalty previousPenalty = null); + DateTime? MatchEndTime { get; } + DateTime? MatchStartTime { get; } } -} \ No newline at end of file +} diff --git a/SharedLibraryCore/Server.cs b/SharedLibraryCore/Server.cs index 5903bd23e..943860bd8 100644 --- a/SharedLibraryCore/Server.cs +++ b/SharedLibraryCore/Server.cs @@ -100,6 +100,8 @@ namespace SharedLibraryCore public List ChatHistory { get; protected set; } public ClientHistoryInfo ClientHistory { get; } public Game GameName { get; set; } + public DateTime? MatchEndTime { get; protected set; } + public DateTime? MatchStartTime { get; protected set; } public string Hostname {