From 2b3e21d4baca4b103eb30079aab8cbc7ee76d337 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 21 Aug 2020 18:12:00 -0500 Subject: [PATCH] fix most played formatting issue prevent reverse proxy to 127.0.0.1 from counting as IW4MAdmin client copy humanizer support lib to output dir --- Application/BuildScripts/PostPublish.bat | 4 ++++ Plugins/Stats/Commands/MostPlayedCommand.cs | 2 +- SharedLibraryCore/BaseController.cs | 2 +- SharedLibraryCore/SharedLibraryCore.csproj | 8 ++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Application/BuildScripts/PostPublish.bat b/Application/BuildScripts/PostPublish.bat index b3e398306..99bcff0b5 100644 --- a/Application/BuildScripts/PostPublish.bat +++ b/Application/BuildScripts/PostPublish.bat @@ -26,6 +26,10 @@ if not exist "%PublishDir%\Lib\" md "%PublishDir%\Lib\" move "%PublishDir%\*.dll" "%PublishDir%\Lib\" move "%PublishDir%\*.json" "%PublishDir%\Lib\" move "%PublishDir%\runtimes" "%PublishDir%\Lib\runtimes" +move "%PublishDir%\ru" "%PublishDir%\Lib\ru" +move "%PublishDir%\de" "%PublishDir%\Lib\de" +move "%PublishDir%\pt" "%PublishDir%\Lib\pt" +move "%PublishDir%\es" "%PublishDir%\Lib\es" if exist "%PublishDir%\refs" move "%PublishDir%\refs" "%PublishDir%\Lib\refs" echo making start scripts diff --git a/Plugins/Stats/Commands/MostPlayedCommand.cs b/Plugins/Stats/Commands/MostPlayedCommand.cs index 4001dacc8..fc8b124a5 100644 --- a/Plugins/Stats/Commands/MostPlayedCommand.cs +++ b/Plugins/Stats/Commands/MostPlayedCommand.cs @@ -51,7 +51,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands var iqList = await iqStats.ToListAsync(); - mostPlayed.AddRange(iqList.Select(stats => translationLookup["COMMANDS_MOST_PLAYED_FORMAT"].FormatExt(stats.Name, (DateTime.UtcNow - DateTime.UtcNow.AddSeconds(-stats.TotalConnectionTime)).HumanizeForCurrentCulture()))); + mostPlayed.AddRange(iqList.Select(stats => translationLookup["COMMANDS_MOST_PLAYED_FORMAT"].FormatExt(stats.Name, stats.Kills, (DateTime.UtcNow - DateTime.UtcNow.AddSeconds(-stats.TotalConnectionTime)).HumanizeForCurrentCulture()))); } diff --git a/SharedLibraryCore/BaseController.cs b/SharedLibraryCore/BaseController.cs index 9c343c79e..63e3a316d 100644 --- a/SharedLibraryCore/BaseController.cs +++ b/SharedLibraryCore/BaseController.cs @@ -108,7 +108,7 @@ namespace SharedLibraryCore } // give the local host full access - else + else if (!HttpContext.Request.Headers.ContainsKey("X-Forwarded-For")) { Client.ClientId = 1; Client.Level = EFClient.Permission.Console; diff --git a/SharedLibraryCore/SharedLibraryCore.csproj b/SharedLibraryCore/SharedLibraryCore.csproj index 5a550a17b..a71bf7c0e 100644 --- a/SharedLibraryCore/SharedLibraryCore.csproj +++ b/SharedLibraryCore/SharedLibraryCore.csproj @@ -32,7 +32,11 @@ - + + + + + @@ -56,7 +60,7 @@ - +