track match start/end time where possible

This commit is contained in:
RaidMax 2022-10-23 13:32:09 -05:00
parent 565f22b42e
commit f6b3eb04f2
3 changed files with 13 additions and 4 deletions

View File

@ -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)

View File

@ -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
/// <param name="origin">source of kick action</param>
/// <param name="previousPenalty">previous penalty the kick is occuring for (if applicable)</param>
/// <returns></returns>
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; }
}
}
}

View File

@ -100,6 +100,8 @@ namespace SharedLibraryCore
public List<ChatInfo> 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
{