Fixes for PR 2.3.4.0

This commit is contained in:
RaidMax 2019-01-27 19:45:35 -06:00
parent 07df6dbf79
commit 760d3026ce
6 changed files with 16 additions and 23 deletions

View File

@ -215,13 +215,7 @@ namespace IW4MAdmin.Application
Running = true; Running = true;
#region CONFIG #region CONFIG
ApplicationConfiguration config = null; var config = ConfigHandler.Configuration();
try
{
config = ConfigHandler.Configuration();
}
catch { }
// copy over default config if it doesn't exist // copy over default config if it doesn't exist
if (config == null) if (config == null)

View File

@ -1,16 +1,11 @@
using System; using IW4MAdmin.Application.Migration;
using System.Threading.Tasks;
using System.IO;
using System.Reflection;
using SharedLibraryCore; using SharedLibraryCore;
using SharedLibraryCore.Objects; using SharedLibraryCore.Localization;
using SharedLibraryCore.Database; using System;
using System.IO;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using SharedLibraryCore.Localization; using System.Threading.Tasks;
using IW4MAdmin.Application.Migration;
using SharedLibraryCore.Exceptions;
namespace IW4MAdmin.Application namespace IW4MAdmin.Application
{ {
@ -39,15 +34,17 @@ namespace IW4MAdmin.Application
try try
{ {
ServerManager = ApplicationManager.GetInstance(); ServerManager = ApplicationManager.GetInstance();
try
if (ServerManager.GetApplicationSettings().Configuration() != null)
{ {
Localization.Configure.Initialize(ServerManager.GetApplicationSettings().Configuration().CustomLocale); Localization.Configure.Initialize(ServerManager.GetApplicationSettings().Configuration().CustomLocale);
} }
catch (ServerException) else
{ {
Localization.Configure.Initialize(); Localization.Configure.Initialize();
} }
loc = Utilities.CurrentLocalization.LocalizationIndex; loc = Utilities.CurrentLocalization.LocalizationIndex;
Console.CancelKeyPress += new ConsoleCancelEventHandler(OnCancelKey); Console.CancelKeyPress += new ConsoleCancelEventHandler(OnCancelKey);
@ -124,7 +121,9 @@ namespace IW4MAdmin.Application
userInput = Console.ReadLine(); userInput = Console.ReadLine();
if (userInput?.ToLower() == "quit") if (userInput?.ToLower() == "quit")
{
ServerManager.Stop(); ServerManager.Stop();
}
if (ServerManager.Servers.Count == 0) if (ServerManager.Servers.Count == 0)
{ {

View File

@ -1,7 +1,7 @@
dotnet publish WebfrontCore/WebfrontCore.csproj -c Prerelease -o X:\IW4MAdmin\Publish\WindowsPrerelease /p:PublishProfile=Prerelease 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 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/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" 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 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\ msbuild DiscordWebhook/DiscordWebhook.pyproj /p:PublishProfile=PreRelease /p:DeployOnBuild=true /p:PublishProfileRootFolder=X:\IW4MAdmin\DiscordWebhook\

View File

@ -41,7 +41,7 @@ namespace SharedLibraryCore.Configuration
return File.WriteAllTextAsync(Path.Join(Utilities.OperatingDirectory, "Configuration", $"{Filename}.json"), appConfigJSON); 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) public void Set(T config)
{ {

View File

@ -157,12 +157,11 @@
<script type="text/javascript" src="~/lib/moment/moment.js"></script> <script type="text/javascript" src="~/lib/moment/moment.js"></script>
<script type="text/javascript" src="~/lib/moment-timezone/builds/moment-timezone-with-data.js"></script> <script type="text/javascript" src="~/lib/moment-timezone/builds/moment-timezone-with-data.js"></script>
<script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.js"></script> <script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js"></script> <script type="text/javascript" src="~/lib/canvasjs/canvasjs.js"></script>
<script type="text/javascript" src="~/js/action.js"></script> <script type="text/javascript" src="~/js/action.js"></script>
<script type="text/javascript" src="~/js/search.js"></script> <script type="text/javascript" src="~/js/search.js"></script>
</environment> </environment>
<environment include="Production"> <environment include="Production">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js"></script>
<script type="text/javascript" src="~/js/global.min.js"></script> <script type="text/javascript" src="~/js/global.min.js"></script>
</environment> </environment>
@RenderSection("scripts", required: false) @RenderSection("scripts", required: false)

View File

@ -17,6 +17,7 @@
"wwwroot/lib/bootstrap/dist/js/bootstrap.min.js", "wwwroot/lib/bootstrap/dist/js/bootstrap.min.js",
"wwwroot/lib/moment/min/moment.min.js", "wwwroot/lib/moment/min/moment.min.js",
"wwwroot/lib/moment-timezone/builds/moment-timezone.min.js", "wwwroot/lib/moment-timezone/builds/moment-timezone.min.js",
"wwwroot/lib/canvasjs/canvasjs.js",
"wwwroot/js/action.js", "wwwroot/js/action.js",
"wwwroot/js/console.js", "wwwroot/js/console.js",
"wwwroot/js/penalty.js", "wwwroot/js/penalty.js",