From bbade0764682abd2bc162ce7dbed82a160b22cc2 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 3 Aug 2018 21:11:58 -0500 Subject: [PATCH] add localized level names intellisense suggestion junk --- Application/API/Master/IMasterApi.cs | 2 +- Application/IO/GameLogEvent.cs | 2 +- Application/IO/GameLogReader.cs | 2 +- Application/Logger.cs | 4 +-- Application/Manager.cs | 8 +++--- Application/RconParsers/IW4RConParser.cs | 4 +-- Application/RconParsers/IW5MRConParser.cs | 2 +- Application/RconParsers/T6MRConParser.cs | 2 +- Application/Server.cs | 16 ++++++++--- Plugins/Stats/Cheat/Detection.cs | 2 +- Plugins/Welcome/Plugin.cs | 2 +- SharedLibraryCore/Commands/NativeCommands.cs | 15 +++++----- SharedLibraryCore/File.cs | 4 +-- SharedLibraryCore/Objects/Permission.cs | 13 +++++++++ SharedLibraryCore/Objects/Player.cs | 15 +++++++--- SharedLibraryCore/Server.cs | 4 +-- SharedLibraryCore/Utilities.cs | 28 +++++++++++++------ WebfrontCore/Controllers/API/APIController.cs | 4 +-- WebfrontCore/Controllers/ClientController.cs | 4 +-- WebfrontCore/Controllers/ServerController.cs | 3 +- WebfrontCore/Startup.cs | 2 +- .../PenaltyListViewComponent.cs | 2 +- .../ViewComponents/ServerListViewComponent.cs | 3 +- 23 files changed, 93 insertions(+), 50 deletions(-) create mode 100644 SharedLibraryCore/Objects/Permission.cs diff --git a/Application/API/Master/IMasterApi.cs b/Application/API/Master/IMasterApi.cs index 240f5fc9b..ea09511d7 100644 --- a/Application/API/Master/IMasterApi.cs +++ b/Application/API/Master/IMasterApi.cs @@ -36,7 +36,7 @@ namespace IW4MAdmin.Application.API.Master public class Endpoint { #if !DEBUG - private static IMasterApi api = RestClient.For("http://api.raidmax.org:5000"); + private static readonly IMasterApi api = RestClient.For("http://api.raidmax.org:5000"); #else private static IMasterApi api = RestClient.For("http://127.0.0.1"); #endif diff --git a/Application/IO/GameLogEvent.cs b/Application/IO/GameLogEvent.cs index 2bc18387f..7785b0a4c 100644 --- a/Application/IO/GameLogEvent.cs +++ b/Application/IO/GameLogEvent.cs @@ -11,7 +11,7 @@ namespace IW4MAdmin.Application.IO Server Server; long PreviousFileSize; GameLogReader Reader; - string GameLogFile; + readonly string GameLogFile; class EventState { diff --git a/Application/IO/GameLogReader.cs b/Application/IO/GameLogReader.cs index 3a8c10f40..c5df1fe56 100644 --- a/Application/IO/GameLogReader.cs +++ b/Application/IO/GameLogReader.cs @@ -10,7 +10,7 @@ namespace IW4MAdmin.Application.IO class GameLogReader { IEventParser Parser; - string LogFile; + readonly string LogFile; public GameLogReader(string logFile, IEventParser parser) { diff --git a/Application/Logger.cs b/Application/Logger.cs index ef0c5eaaa..d8d066dc9 100644 --- a/Application/Logger.cs +++ b/Application/Logger.cs @@ -17,8 +17,8 @@ namespace IW4MAdmin.Application Assert } - string FileName; - object ThreadLock; + readonly string FileName; + readonly object ThreadLock; public Logger(string fn) { diff --git a/Application/Manager.cs b/Application/Manager.cs index d1a7db1f7..a740164ae 100644 --- a/Application/Manager.cs +++ b/Application/Manager.cs @@ -36,12 +36,12 @@ namespace IW4MAdmin.Application public DateTime StartTime { get; private set; } static ApplicationManager Instance; - List TaskStatuses; + readonly List TaskStatuses; List Commands; - List MessageTokens; + readonly List MessageTokens; ClientService ClientSvc; - AliasService AliasSvc; - PenaltyService PenaltySvc; + readonly AliasService AliasSvc; + readonly PenaltyService PenaltySvc; BaseConfigurationHandler ConfigHandler; EventApi Api; GameEventHandler Handler; diff --git a/Application/RconParsers/IW4RConParser.cs b/Application/RconParsers/IW4RConParser.cs index 3ac146e79..8a1a2378a 100644 --- a/Application/RconParsers/IW4RConParser.cs +++ b/Application/RconParsers/IW4RConParser.cs @@ -14,7 +14,7 @@ namespace Application.RconParsers { class IW4RConParser : IRConParser { - private static CommandPrefix Prefixes = new CommandPrefix() + private static readonly CommandPrefix Prefixes = new CommandPrefix() { Tell = "tellraw {0} {1}", Say = "sayraw {0}", @@ -23,7 +23,7 @@ namespace Application.RconParsers TempBan = "tempbanclient {0} \"{1}\"" }; - private static string StatusRegex = @"^( *[0-9]+) +-*([0-9]+) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){16}|(?:[a-z]|[0-9]){32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +([0-9]+) +(\d+\.\d+\.\d+.\d+\:-*\d{1,5}|0+.0+:-*\d{1,5}|loopback) +(-*[0-9]+) +([0-9]+) *$"; + private static readonly string StatusRegex = @"^( *[0-9]+) +-*([0-9]+) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){16}|(?:[a-z]|[0-9]){32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +([0-9]+) +(\d+\.\d+\.\d+.\d+\:-*\d{1,5}|0+.0+:-*\d{1,5}|loopback) +(-*[0-9]+) +([0-9]+) *$"; public async Task ExecuteCommandAsync(Connection connection, string command) { diff --git a/Application/RconParsers/IW5MRConParser.cs b/Application/RconParsers/IW5MRConParser.cs index c75f6878b..43044fa33 100644 --- a/Application/RconParsers/IW5MRConParser.cs +++ b/Application/RconParsers/IW5MRConParser.cs @@ -16,7 +16,7 @@ namespace Application.RconParsers { public class IW5MRConParser : IRConParser { - private static CommandPrefix Prefixes = new CommandPrefix() + private static readonly CommandPrefix Prefixes = new CommandPrefix() { Tell = "tell {0} {1}", Say = "say {0}", diff --git a/Application/RconParsers/T6MRConParser.cs b/Application/RconParsers/T6MRConParser.cs index 555e327b5..398fd86ea 100644 --- a/Application/RconParsers/T6MRConParser.cs +++ b/Application/RconParsers/T6MRConParser.cs @@ -52,7 +52,7 @@ namespace Application.RconParsers public PInfo[] Players { get; set; } } - private static CommandPrefix Prefixes = new CommandPrefix() + private static readonly CommandPrefix Prefixes = new CommandPrefix() { Tell = "tell {0} {1}", Say = "say {0}", diff --git a/Application/Server.cs b/Application/Server.cs index 0d5a5b785..de7af1e1e 100644 --- a/Application/Server.cs +++ b/Application/Server.cs @@ -218,14 +218,23 @@ namespace IW4MAdmin if (currentBan.Type == Penalty.PenaltyType.TempBan) { string formattedKick = String.Format( - RconParser.GetCommandPrefixes().Kick, - polledPlayer.ClientNumber, + RconParser.GetCommandPrefixes().Kick, + polledPlayer.ClientNumber, $"{loc["SERVER_TB_REMAIN"]} ({(currentBan.Expires - DateTime.UtcNow).TimeSpanText()} {loc["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]})"); await this.ExecuteCommandAsync(formattedKick); } + // the player is permanently banned else - await player.Kick($"{loc["SERVER_BAN_PREV"]} {currentBan.Offense} ({loc["SERVER_BAN_APPEAL"]} {Website})", autoKickClient); + { + // don't store the kick message + string formattedKick = String.Format( + RconParser.GetCommandPrefixes().Kick, + polledPlayer.ClientNumber, + $"{loc["SERVER_BAN_PREV"]} {currentBan.Offense} ({loc["SERVER_BAN_APPEAL"]} {Website})"); + await this.ExecuteCommandAsync(formattedKick); + } + // reban the "evading" guid if (player.Level != Player.Permission.Banned && currentBan.Type == Penalty.PenaltyType.Ban) await player.Ban($"{currentBan.Offense}", autoKickClient); @@ -594,7 +603,6 @@ namespace IW4MAdmin DateTime start = DateTime.Now; DateTime playerCountStart = DateTime.Now; DateTime lastCount = DateTime.Now; - DateTime tickTime = DateTime.Now; override public async Task ProcessUpdatesAsync(CancellationToken cts) { diff --git a/Plugins/Stats/Cheat/Detection.cs b/Plugins/Stats/Cheat/Detection.cs index 0ebd0ab92..37ac214c4 100644 --- a/Plugins/Stats/Cheat/Detection.cs +++ b/Plugins/Stats/Cheat/Detection.cs @@ -30,7 +30,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat long LastOffset; ILogger Log; Strain Strain; - DateTime ConnectionTime = DateTime.UtcNow; + readonly DateTime ConnectionTime = DateTime.UtcNow; public Detection(ILogger log, EFClientStatistics clientStats) { diff --git a/Plugins/Welcome/Plugin.cs b/Plugins/Welcome/Plugin.cs index 449714f2b..153dc697c 100644 --- a/Plugins/Welcome/Plugin.cs +++ b/Plugins/Welcome/Plugin.cs @@ -99,7 +99,7 @@ namespace IW4MAdmin.Plugins.Welcome private string ProcessAnnouncement(string msg, Player joining) { msg = msg.Replace("{{ClientName}}", joining.Name); - msg = msg.Replace("{{ClientLevel}}", Utilities.ConvertLevelToColor(joining.Level)); + msg = msg.Replace("{{ClientLevel}}", Utilities.ConvertLevelToColor(joining.Level, joining.ClientPermission.Name)); try { CountryLookupProj.CountryLookup CLT = new CountryLookupProj.CountryLookup($"{Utilities.OperatingDirectory}Plugins{System.IO.Path.DirectorySeparatorChar}GeoIP.dat"); diff --git a/SharedLibraryCore/Commands/NativeCommands.cs b/SharedLibraryCore/Commands/NativeCommands.cs index 40f3e4f1b..cca2cd52b 100644 --- a/SharedLibraryCore/Commands/NativeCommands.cs +++ b/SharedLibraryCore/Commands/NativeCommands.cs @@ -273,7 +273,7 @@ namespace SharedLibraryCore.Commands public override async Task ExecuteAsync(GameEvent E) { - String You = String.Format("{0} [^3#{1}^7] {2} [^3@{3}^7] [{4}^7] IP: {5}", E.Origin.Name, E.Origin.ClientNumber, E.Origin.NetworkId, E.Origin.ClientId, Utilities.ConvertLevelToColor(E.Origin.Level), E.Origin.IPAddressString); + String You = String.Format("{0} [^3#{1}^7] {2} [^3@{3}^7] [{4}^7] IP: {5}", E.Origin.Name, E.Origin.ClientNumber, E.Origin.NetworkId, E.Origin.ClientId, Utilities.ConvertLevelToColor(E.Origin.Level, E.Origin.ClientPermission.Name), E.Origin.IPAddressString); await E.Origin.Tell(You); } } @@ -294,11 +294,11 @@ namespace SharedLibraryCore.Commands if (P == null) continue; - + // todo: fix spacing if (P.Masked) - playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(Player.Permission.User), P.ClientNumber, P.Name, Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - Player.Permission.User.ToString().Length)); + playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(Player.Permission.User, P.ClientPermission.Name), P.ClientNumber, P.Name, Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - Player.Permission.User.ToString().Length)); else - playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(P.Level), P.ClientNumber, P.Name, Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.Level.ToString().Length)); + playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(P.Level, P.ClientPermission.Name), P.ClientNumber, P.Name, Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.Level.ToString().Length)); if (count == 2 || E.Owner.GetPlayersAsList().Count == 1) { @@ -536,7 +536,7 @@ namespace SharedLibraryCore.Commands var onlineAdmins = S.GetPlayersAsList() .Where(p => p.Level > Player.Permission.Flagged) .Where(p => !p.Masked) - .Select(p => $"[^3{Utilities.ConvertLevelToColor(p.Level)}^7] {p.Name}"); + .Select(p => $"[^3{Utilities.ConvertLevelToColor(p.Level, p.ClientPermission.Name)}^7] {p.Name}"); return onlineAdmins.Count() > 0 ? string.Join(Environment.NewLine, onlineAdmins) : @@ -622,10 +622,11 @@ namespace SharedLibraryCore.Commands foreach (var P in db_players) { + string localizedLevel = Utilities.CurrentLocalization.LocalizationIndex[$"GLOBAL_PERMISSION_{P.Level.ToString().ToUpper()}"]; // they're not going by another alias string msg = P.Name.ToLower().Contains(E.Data.ToLower()) ? - $"[^3{P.Name}^7] [^3@{P.ClientId}^7] - [{ Utilities.ConvertLevelToColor(P.Level)}^7] - {P.IPAddressString} | last seen {Utilities.GetTimePassed(P.LastConnection)}" : - $"({P.AliasLink.Children.First(a => a.Name.ToLower().Contains(E.Data.ToLower())).Name})->[^3{P.Name}^7] [^3@{P.ClientId}^7] - [{ Utilities.ConvertLevelToColor(P.Level)}^7] - {P.IPAddressString} | last seen {Utilities.GetTimePassed(P.LastConnection)}"; + $"[^3{P.Name}^7] [^3@{P.ClientId}^7] - [{ Utilities.ConvertLevelToColor(P.Level, localizedLevel)}^7] - {P.IPAddressString} | last seen {Utilities.GetTimePassed(P.LastConnection)}" : + $"({P.AliasLink.Children.First(a => a.Name.ToLower().Contains(E.Data.ToLower())).Name})->[^3{P.Name}^7] [^3@{P.ClientId}^7] - [{ Utilities.ConvertLevelToColor(P.Level, localizedLevel)}^7] - {P.IPAddressString} | last seen {Utilities.GetTimePassed(P.LastConnection)}"; await E.Origin.Tell(msg); } } diff --git a/SharedLibraryCore/File.cs b/SharedLibraryCore/File.cs index e555ace5d..7be05c67f 100644 --- a/SharedLibraryCore/File.cs +++ b/SharedLibraryCore/File.cs @@ -11,7 +11,7 @@ namespace SharedLibraryCore { public class RemoteFile : IFile { - string Location; + readonly string Location; string[] FileCache = new string[0]; public RemoteFile(string location) : base(string.Empty) @@ -101,7 +101,7 @@ namespace SharedLibraryCore //END private long sze; - private String Name; + private readonly String Name; private StreamReader Handle; } } diff --git a/SharedLibraryCore/Objects/Permission.cs b/SharedLibraryCore/Objects/Permission.cs new file mode 100644 index 000000000..9e30b0a87 --- /dev/null +++ b/SharedLibraryCore/Objects/Permission.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; +using static SharedLibraryCore.Objects.Player; + +namespace SharedLibraryCore.Objects +{ + public sealed class ClientPermission + { + public Permission Level { get; set; } + public string Name { get; set; } + } +} diff --git a/SharedLibraryCore/Objects/Player.cs b/SharedLibraryCore/Objects/Player.cs index 8a6b31ded..334e6550d 100644 --- a/SharedLibraryCore/Objects/Player.cs +++ b/SharedLibraryCore/Objects/Player.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace SharedLibraryCore.Objects SeniorAdmin = 5, Owner = 6, Creator = 7, - Console = 8, + Console = 8 } public Player() @@ -102,8 +103,6 @@ namespace SharedLibraryCore.Objects [NotMapped] public int Score { get; set; } [NotMapped] - public IList Meta { get; set; } - [NotMapped] public bool IsBot { get; set; } private int _ipaddress; public override int IPAddress @@ -115,7 +114,7 @@ namespace SharedLibraryCore.Objects public override string Name { get { return _name; } - set { _name = value; } + set { _name = value; } } [NotMapped] public bool IsAuthenticated { get; set; } @@ -123,6 +122,14 @@ namespace SharedLibraryCore.Objects public ClientState State { get; set; } [NotMapped] public Queue DelayedEvents { get; set; } + [NotMapped] + // this is kinda dirty, but I need localizable level names + public ClientPermission ClientPermission => new ClientPermission() + { + Level = Level, + Name = Utilities.CurrentLocalization + .LocalizationIndex[$"GLOBAL_PERMISSION_{Level.ToString().ToUpper()}"] + }; public override bool Equals(object obj) { diff --git a/SharedLibraryCore/Server.cs b/SharedLibraryCore/Server.cs index 069ca9303..c7955ab5d 100644 --- a/SharedLibraryCore/Server.cs +++ b/SharedLibraryCore/Server.cs @@ -330,8 +330,8 @@ namespace SharedLibraryCore protected ManualResetEventSlim OnRemoteCommandResponse; // only here for performance - private bool CustomSayEnabled; - private string CustomSayName; + private readonly bool CustomSayEnabled; + private readonly string CustomSayName; //Remote public IList CommandResult = new List(); diff --git a/SharedLibraryCore/Utilities.cs b/SharedLibraryCore/Utilities.cs index 2a9e8cd48..a56eab4ab 100644 --- a/SharedLibraryCore/Utilities.cs +++ b/SharedLibraryCore/Utilities.cs @@ -56,7 +56,8 @@ namespace SharedLibraryCore String lookingFor = str.ToLower(); for (Player.Permission Perm = Player.Permission.User; Perm < Player.Permission.Console; Perm++) - if (lookingFor.Contains(Perm.ToString().ToLower())) + if (lookingFor.Contains(Perm.ToString().ToLower()) + || lookingFor.Contains(CurrentLocalization.LocalizationIndex[$"GLOBAL_PERMISSION_{Perm.ToString().ToUpper()}"].ToLower())) return Perm; return Player.Permission.Banned; @@ -83,25 +84,36 @@ namespace SharedLibraryCore /// /// Specified player level /// - public static String ConvertLevelToColor(Player.Permission level) + public static String ConvertLevelToColor(Player.Permission level, string localizedLevel) { + char colorCode = '6'; + // todo: maybe make this game independant? switch (level) { case Player.Permission.Banned: - return "^1" + Player.Permission.Banned; + colorCode = '1'; + break; case Player.Permission.Flagged: - return "^9" + Player.Permission.Flagged; + colorCode = '9'; + break; case Player.Permission.Owner: - return "^5" + Player.Permission.Owner; + colorCode = '5'; + break; case Player.Permission.User: - return "^2" + Player.Permission.User; + colorCode = '2'; + break; case Player.Permission.Trusted: - return "^3" + Player.Permission.Trusted; + colorCode = '3'; + break; default: - return "^6" + level; + break; } + + return $"^{colorCode}{localizedLevel ?? level.ToString()}"; } + public static string ToLocalizedLevelName(this Player.Permission perm) => CurrentLocalization.LocalizationIndex[$"GLOBAL_PERMISSION_{perm.ToString().ToUpper()}"]; + public static String ProcessMessageToken(this Server server, IList tokens, String str) { MatchCollection RegexMatches = Regex.Matches(str, @"\{\{[A-Z]+\}\}", RegexOptions.IgnoreCase); diff --git a/WebfrontCore/Controllers/API/APIController.cs b/WebfrontCore/Controllers/API/APIController.cs index 0969c9505..61c093b86 100644 --- a/WebfrontCore/Controllers/API/APIController.cs +++ b/WebfrontCore/Controllers/API/APIController.cs @@ -37,9 +37,9 @@ namespace WebfrontCore.Controllers.API player.Name, player.Score, player.Ping, - player.State, + State = player.State.ToString(), player.ClientNumber, - player.ConnectionTime, + ConnectionTime = (DateTime.UtcNow - player.ConnectionTime).TotalSeconds, player.Level, }) }); diff --git a/WebfrontCore/Controllers/ClientController.cs b/WebfrontCore/Controllers/ClientController.cs index 4c3732d36..ce4cbae29 100644 --- a/WebfrontCore/Controllers/ClientController.cs +++ b/WebfrontCore/Controllers/ClientController.cs @@ -27,7 +27,7 @@ namespace WebfrontCore.Controllers var clientDto = new PlayerInfo() { Name = client.Name, - Level = client.Level.ToString(), + Level = client.Level.ToLocalizedLevelName(), LevelInt = (int)client.Level, ClientId = client.ClientId, IPAddress = client.IPAddressString, @@ -148,7 +148,7 @@ namespace WebfrontCore.Controllers var clientsDto = clients.Select(c => new PlayerInfo() { Name = c.Name, - Level = c.Level.ToString(), + Level = c.Level.ToLocalizedLevelName(), LevelInt = (int)c.Level, ClientId = c.ClientId, LastSeen = Utilities.GetTimePassed(c.LastConnection, false) diff --git a/WebfrontCore/Controllers/ServerController.cs b/WebfrontCore/Controllers/ServerController.cs index 9e94ed6c9..452851cd7 100644 --- a/WebfrontCore/Controllers/ServerController.cs +++ b/WebfrontCore/Controllers/ServerController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using SharedLibraryCore; using SharedLibraryCore.Dtos; using System; using System.Collections.Generic; @@ -31,7 +32,7 @@ namespace WebfrontCore.Controllers { Name = p.Name, ClientId = p.ClientId, - Level = p.Level.ToString(), + Level = p.Level.ToLocalizedLevelName(), LevelInt = (int)p.Level }).ToList(), ChatHistory = s.ChatHistory, diff --git a/WebfrontCore/Startup.cs b/WebfrontCore/Startup.cs index 22e787968..d18609147 100644 --- a/WebfrontCore/Startup.cs +++ b/WebfrontCore/Startup.cs @@ -14,7 +14,7 @@ namespace WebfrontCore { public class Startup { - private IHostingEnvironment _appHost; + private readonly IHostingEnvironment _appHost; public static IConfigurationRoot Configuration { get; private set; } public Startup(IHostingEnvironment env) diff --git a/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs b/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs index dbed9bdab..9e0038217 100644 --- a/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs +++ b/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs @@ -20,7 +20,7 @@ namespace WebfrontCore.ViewComponents OffenderName = p.Offender.Name, PunisherId = p.PunisherId, PunisherName = p.Punisher.Name, - PunisherLevel = p.Punisher.Level.ToString(), + PunisherLevel = p.Punisher.Level.ToLocalizedLevelName(), #if DEBUG Offense = !string.IsNullOrEmpty(p.AutomatedOffense) ? p.AutomatedOffense : p.Offense, #else diff --git a/WebfrontCore/ViewComponents/ServerListViewComponent.cs b/WebfrontCore/ViewComponents/ServerListViewComponent.cs index a5cea8cf4..7fa253ece 100644 --- a/WebfrontCore/ViewComponents/ServerListViewComponent.cs +++ b/WebfrontCore/ViewComponents/ServerListViewComponent.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using SharedLibraryCore; using SharedLibraryCore.Dtos; using System.Linq; @@ -24,7 +25,7 @@ namespace WebfrontCore.ViewComponents { Name = p.Name, ClientId = p.ClientId, - Level = p.Level.ToString(), + Level = p.Level.ToLocalizedLevelName(), LevelInt = (int)p.Level }).ToList(), ChatHistory = s.ChatHistory,