From 843c01061d87c9437874506a12db1ec5ce9e0eaa Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 8 Jan 2021 19:21:23 -0600 Subject: [PATCH] update 'uptime' output use translations for certain webfront page meta that was neglected update plutonium parsers to not use new line in notices as it is not supported --- Plugins/ScriptPlugins/ParserPIW5.js | 3 ++- Plugins/ScriptPlugins/ParserPT6.js | 3 ++- SharedLibraryCore/Commands/NativeCommands.cs | 4 ++-- SharedLibraryCore/Configuration/ApplicationConfiguration.cs | 2 +- WebfrontCore/Controllers/AccountController.cs | 1 - WebfrontCore/Controllers/ClientController.cs | 4 ++-- WebfrontCore/Controllers/ConsoleController.cs | 4 ++-- WebfrontCore/Controllers/HomeController.cs | 4 ++-- WebfrontCore/Controllers/PenaltyController.cs | 4 ++-- 9 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Plugins/ScriptPlugins/ParserPIW5.js b/Plugins/ScriptPlugins/ParserPIW5.js index 9df8f0d7f..1cd9746e8 100644 --- a/Plugins/ScriptPlugins/ParserPIW5.js +++ b/Plugins/ScriptPlugins/ParserPIW5.js @@ -3,7 +3,7 @@ var eventParser; var plugin = { author: 'RaidMax', - version: 0.5, + version: 0.6, name: 'Plutonium IW5 Parser', isParser: true, @@ -26,6 +26,7 @@ var plugin = { rconParser.Configuration.Dvar.AddMapping(107, 2); rconParser.Configuration.WaitForResponse = true; rconParser.Configuration.CanGenerateLogPath = true; + rconParser.Configuration.NoticeLineSeparator = '. '; rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +lastmsg +address +qport +rate *'; rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +-?([0-9]+) +(?:[0-1]{1}) +([0-9]{1,4}|[A-Z]{4}) +([a-f|A-F|0-9]{16}) +(.+?) +(?:[0-9]+) +(\\d+\\.\\d+\\.\\d+\\.\\d+\\:-?\\d{1,5}|0+\\.0+:-?\\d{1,5}|loopback) +(?:-?[0-9]+) +(?:[0-9]+) *$'; diff --git a/Plugins/ScriptPlugins/ParserPT6.js b/Plugins/ScriptPlugins/ParserPT6.js index 08026b211..7caa17756 100644 --- a/Plugins/ScriptPlugins/ParserPT6.js +++ b/Plugins/ScriptPlugins/ParserPT6.js @@ -3,7 +3,7 @@ var eventParser; var plugin = { author: 'RaidMax, Xerxes', - version: 0.8, + version: 0.9, name: 'Plutonium T6 Parser', isParser: true, @@ -26,6 +26,7 @@ var plugin = { rconParser.Configuration.Dvar.AddMapping(106, 1); rconParser.Configuration.Dvar.AddMapping(107, 2); rconParser.Configuration.WaitForResponse = false; + rconParser.Configuration.NoticeLineSeparator = '. '; rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +lastmsg +address +qport +rate *'; rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +([0-9]+) +(?:[0-1]{1}) +([0-9]+) +([A-F0-9]+|0) +(.+?) +(?:[0-9]+) +(\\d+\\.\\d+\\.\\d+\\.\\d+\\:-?\\d{1,5}|0+\\.0+:-?\\d{1,5}|loopback) +(?:-?[0-9]+) +(?:[0-9]+) *$'; diff --git a/SharedLibraryCore/Commands/NativeCommands.cs b/SharedLibraryCore/Commands/NativeCommands.cs index 6b8d0dbd0..3926f83bf 100644 --- a/SharedLibraryCore/Commands/NativeCommands.cs +++ b/SharedLibraryCore/Commands/NativeCommands.cs @@ -830,9 +830,9 @@ namespace SharedLibraryCore.Commands public override Task ExecuteAsync(GameEvent E) { - TimeSpan uptime = DateTime.Now - System.Diagnostics.Process.GetCurrentProcess().StartTime; + var uptime = DateTime.Now - System.Diagnostics.Process.GetCurrentProcess().StartTime; var loc = _translationLookup; - E.Origin.Tell(loc["COMMANDS_UPTIME_TEXT"].FormatExt(uptime.Days, uptime.Hours, uptime.Minutes)); + E.Origin.Tell(loc["COMMANDS_UPTIME_TEXT"].FormatExt(uptime.HumanizeForCurrentCulture(4))); return Task.CompletedTask; } } diff --git a/SharedLibraryCore/Configuration/ApplicationConfiguration.cs b/SharedLibraryCore/Configuration/ApplicationConfiguration.cs index 999ddccea..35290ad84 100644 --- a/SharedLibraryCore/Configuration/ApplicationConfiguration.cs +++ b/SharedLibraryCore/Configuration/ApplicationConfiguration.cs @@ -129,7 +129,7 @@ namespace SharedLibraryCore.Configuration TimeSpan.FromDays(1), TimeSpan.FromDays(2), TimeSpan.FromDays(7), - TimeSpan.FromDays(31) + TimeSpan.FromDays(30) }; [LocalizedDisplayName("WEBFRONT_CONFIGURATION_PRESET_BAN_REASONS")] diff --git a/WebfrontCore/Controllers/AccountController.cs b/WebfrontCore/Controllers/AccountController.cs index 798ab98bc..6041e9c8a 100644 --- a/WebfrontCore/Controllers/AccountController.cs +++ b/WebfrontCore/Controllers/AccountController.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using SharedLibraryCore; using SharedLibraryCore.Interfaces; diff --git a/WebfrontCore/Controllers/ClientController.cs b/WebfrontCore/Controllers/ClientController.cs index a7e792615..547d3b7af 100644 --- a/WebfrontCore/Controllers/ClientController.cs +++ b/WebfrontCore/Controllers/ClientController.cs @@ -131,8 +131,8 @@ namespace WebfrontCore.Controllers } ViewBag.Title = Localization["WEBFRONT_CLIENT_PRIVILEGED_TITLE"]; - ViewBag.Description = "List of all privileged clients on IW4MAdmin"; - ViewBag.Keywords = "IW4MAdmin, privileged, admins, clients, administrators"; + ViewBag.Description = Localization["WEBFRONT_DESCRIPTION_PRIVILEGED"]; + ViewBag.Keywords = Localization["WEBFRONT_KEYWORDS_PRIVILEGED"]; return View("Privileged/Index", adminsDict); } diff --git a/WebfrontCore/Controllers/ConsoleController.cs b/WebfrontCore/Controllers/ConsoleController.cs index e3e8f5b99..203652084 100644 --- a/WebfrontCore/Controllers/ConsoleController.cs +++ b/WebfrontCore/Controllers/ConsoleController.cs @@ -26,9 +26,9 @@ namespace WebfrontCore.Controllers ID = s.EndPoint, }); - ViewBag.Description = "Use the IW4MAdmin web console to execute commands"; + ViewBag.Description = Localization["WEFBRONT_DESCRIPTION_CONSOLE"]; ViewBag.Title = Localization["WEBFRONT_CONSOLE_TITLE"]; - ViewBag.Keywords = "IW4MAdmin, console, execute, commands"; + ViewBag.Keywords = Localization["WEBFRONT_KEYWORDS_CONSOLE"]; return View(activeServers); } diff --git a/WebfrontCore/Controllers/HomeController.cs b/WebfrontCore/Controllers/HomeController.cs index fbc03f6d4..d6d73bb98 100644 --- a/WebfrontCore/Controllers/HomeController.cs +++ b/WebfrontCore/Controllers/HomeController.cs @@ -24,9 +24,9 @@ namespace WebfrontCore.Controllers public async Task Index(Game? game = null) { - ViewBag.Description = "IW4MAdmin is a complete server administration tool for IW4x."; + ViewBag.Description = Localization["WEBFRONT_DESCRIPTION_HOME"]; ViewBag.Title = Localization["WEBFRONT_HOME_TITLE"]; - ViewBag.Keywords = "IW4MAdmin, server, administration, IW4x, MW2, Modern Warfare 2"; + ViewBag.Keywords = Localization["WEBFRONT_KEWORDS_HOME"]; var servers = Manager.GetServers().Where(_server => !game.HasValue ? true : _server.GameName == game); diff --git a/WebfrontCore/Controllers/PenaltyController.cs b/WebfrontCore/Controllers/PenaltyController.cs index 0b40b1371..7620a1652 100644 --- a/WebfrontCore/Controllers/PenaltyController.cs +++ b/WebfrontCore/Controllers/PenaltyController.cs @@ -22,9 +22,9 @@ namespace WebfrontCore.Controllers public IActionResult List(PenaltyType showOnly = PenaltyType.Any, bool hideAutomatedPenalties = true) { - ViewBag.Description = "List of all the recent penalties (bans, kicks, warnings) on IW4MAdmin"; + ViewBag.Description = Localization["WEBFRONT_DESCRIPTION_PENALTIES"]; ViewBag.Title = Localization["WEBFRONT_PENALTY_TITLE"]; - ViewBag.Keywords = "IW4MAdmin, penalties, ban, kick, warns"; + ViewBag.Keywords = Localization["WEBFRONT_KEYWORDS_PENALTIES"]; ViewBag.HideAutomatedPenalties = hideAutomatedPenalties; return View(showOnly);