From 3f8b2fac9ef55e7ae2fd08f9afebe49dc0065b37 Mon Sep 17 00:00:00 2001 From: Ayymoss Date: Thu, 22 Aug 2024 19:43:41 +0100 Subject: [PATCH] Add GameName to ClientInfoResult and ClientController Updated `ClientInfoResult` to include a new `GameName` property. Also modified `ClientController` to handle and display this new property properly. --- SharedLibraryCore/Dtos/ClientInfoResult.cs | 3 ++- WebfrontCore/Controllers/API/ClientController.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SharedLibraryCore/Dtos/ClientInfoResult.cs b/SharedLibraryCore/Dtos/ClientInfoResult.cs index cb73e346..28f90634 100644 --- a/SharedLibraryCore/Dtos/ClientInfoResult.cs +++ b/SharedLibraryCore/Dtos/ClientInfoResult.cs @@ -1,5 +1,5 @@ using System; -using Data.Models.Client; +using Data.Models; namespace SharedLibraryCore.Dtos; @@ -9,6 +9,7 @@ public class ClientInfoResult public string Name { get; set; } public string Level { get; set; } public long NetworkId { get; set; } + public string GameName { get; set; } public string? Tag { get; set; } public DateTime FirstConnection { get; set; } public DateTime LastConnection { get; set; } diff --git a/WebfrontCore/Controllers/API/ClientController.cs b/WebfrontCore/Controllers/API/ClientController.cs index 0b07f6d6..b7e7bbd6 100644 --- a/WebfrontCore/Controllers/API/ClientController.cs +++ b/WebfrontCore/Controllers/API/ClientController.cs @@ -9,6 +9,7 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Data.Models; +using Humanizer; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.Extensions.Logging; @@ -90,6 +91,7 @@ namespace WebfrontCore.Controllers.API Name = clientInfo.CleanedName, Level = clientInfo.Level.ToLocalizedLevelName(), NetworkId = clientInfo.NetworkId, + GameName = clientInfo.GameName.ToString(), Tag = metaResult?.Value, FirstConnection = clientInfo.FirstConnection, LastConnection = clientInfo.LastConnection,