diff --git a/Application/ApplicationManager.cs b/Application/ApplicationManager.cs index 8ffb72d61..2ff9edb54 100644 --- a/Application/ApplicationManager.cs +++ b/Application/ApplicationManager.cs @@ -215,13 +215,7 @@ namespace IW4MAdmin.Application Running = true; #region CONFIG - ApplicationConfiguration config = null; - - try - { - config = ConfigHandler.Configuration(); - } - catch { } + var config = ConfigHandler.Configuration(); // copy over default config if it doesn't exist if (config == null) diff --git a/Application/Main.cs b/Application/Main.cs index 7b08fc0a7..3016c6acb 100644 --- a/Application/Main.cs +++ b/Application/Main.cs @@ -1,16 +1,11 @@ -using System; -using System.Threading.Tasks; -using System.IO; -using System.Reflection; - +using IW4MAdmin.Application.Migration; using SharedLibraryCore; -using SharedLibraryCore.Objects; -using SharedLibraryCore.Database; +using SharedLibraryCore.Localization; +using System; +using System.IO; using System.Text; using System.Threading; -using SharedLibraryCore.Localization; -using IW4MAdmin.Application.Migration; -using SharedLibraryCore.Exceptions; +using System.Threading.Tasks; namespace IW4MAdmin.Application { @@ -39,15 +34,17 @@ namespace IW4MAdmin.Application try { ServerManager = ApplicationManager.GetInstance(); - try + + if (ServerManager.GetApplicationSettings().Configuration() != null) { Localization.Configure.Initialize(ServerManager.GetApplicationSettings().Configuration().CustomLocale); } - catch (ServerException) + else { Localization.Configure.Initialize(); } + loc = Utilities.CurrentLocalization.LocalizationIndex; Console.CancelKeyPress += new ConsoleCancelEventHandler(OnCancelKey); @@ -124,7 +121,9 @@ namespace IW4MAdmin.Application userInput = Console.ReadLine(); if (userInput?.ToLower() == "quit") + { ServerManager.Stop(); + } if (ServerManager.Servers.Count == 0) { diff --git a/RunPublishPre.cmd b/RunPublishPre.cmd index 0ffc3688e..53476b30f 100644 --- a/RunPublishPre.cmd +++ b/RunPublishPre.cmd @@ -1,7 +1,7 @@ dotnet publish WebfrontCore/WebfrontCore.csproj -c Prerelease -o X:\IW4MAdmin\Publish\WindowsPrerelease /p:PublishProfile=Prerelease dotnet publish Application/Application.csproj -c Prerelease -o X:\IW4MAdmin\Publish\WindowsPrerelease /p:PublishProfile=Prerelease dotnet publish GameLogServer/GameLogServer.pyproj -c Release -o X:\IW4MAdmin\Publish\WindowsPrerelease\GameLogServer -dotnet publish GameLogServer/DiscordWebhook.pyproj -c Release -o X:\IW4MAdmin\Publish\WindowsPrerelease\DiscordWebhook +::dotnet publish GameLogServer/DiscordWebhook.pyproj -c Release -o X:\IW4MAdmin\Publish\WindowsPrerelease\DiscordWebhook call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" msbuild GameLogServer/GameLogServer.pyproj /p:PublishProfile=PreRelease /p:DeployOnBuild=true /p:PublishProfileRootFolder=X:\IW4MAdmin\GameLogServer\ msbuild DiscordWebhook/DiscordWebhook.pyproj /p:PublishProfile=PreRelease /p:DeployOnBuild=true /p:PublishProfileRootFolder=X:\IW4MAdmin\DiscordWebhook\ diff --git a/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs b/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs index 29656a2a7..a40a0da08 100644 --- a/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs +++ b/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs @@ -41,7 +41,7 @@ namespace SharedLibraryCore.Configuration return File.WriteAllTextAsync(Path.Join(Utilities.OperatingDirectory, "Configuration", $"{Filename}.json"), appConfigJSON); } - public T Configuration() => _configuration == null ? throw new ServerException("Configuration is null") : _configuration; + public T Configuration() => _configuration; public void Set(T config) { diff --git a/WebfrontCore/Views/Shared/_Layout.cshtml b/WebfrontCore/Views/Shared/_Layout.cshtml index 86bcbf159..249b23225 100644 --- a/WebfrontCore/Views/Shared/_Layout.cshtml +++ b/WebfrontCore/Views/Shared/_Layout.cshtml @@ -157,12 +157,11 @@ - + - @RenderSection("scripts", required: false) diff --git a/WebfrontCore/bundleconfig.json b/WebfrontCore/bundleconfig.json index d99d6deb6..3f59bd27a 100644 --- a/WebfrontCore/bundleconfig.json +++ b/WebfrontCore/bundleconfig.json @@ -17,6 +17,7 @@ "wwwroot/lib/bootstrap/dist/js/bootstrap.min.js", "wwwroot/lib/moment/min/moment.min.js", "wwwroot/lib/moment-timezone/builds/moment-timezone.min.js", + "wwwroot/lib/canvasjs/canvasjs.js", "wwwroot/js/action.js", "wwwroot/js/console.js", "wwwroot/js/penalty.js",