From 2b26b9a7070f245d01e35d1fe911caff2c80aea9 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 27 Dec 2019 20:37:50 -0600 Subject: [PATCH] fix javascript libraries not being loaded because the stupid CDN change. MICROSOFT, IF YOU'RE LISTENING, FIX YOUR INTEGRATION WITH CDNJS THANK YOU force demo record and increase max demos saved for IW4x fix issue with disconnect on a not fully connected client --- Application/BuildScripts/PostPublish.bat | 2 +- Application/IW4MServer.cs | 6 ++++++ SharedLibraryCore/Services/ClientService.cs | 7 +++++++ WebfrontCore/Views/Shared/_Layout.cshtml | 10 +++++----- WebfrontCore/bundleconfig.json | 4 ++-- _customcallbacks.gsc | 2 ++ 6 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Application/BuildScripts/PostPublish.bat b/Application/BuildScripts/PostPublish.bat index b3e398306..aa0064bd7 100644 --- a/Application/BuildScripts/PostPublish.bat +++ b/Application/BuildScripts/PostPublish.bat @@ -17,7 +17,7 @@ echo deleting misc files if exist "%PublishDir%\web.config" del "%PublishDir%\web.config" if exist "%PublishDir%\libman.json" del "%PublishDir%\libman.json" del "%PublishDir%\*.exe" -del "%PublishDir%\*.pdb" +REM del "%PublishDir%\*.pdb" echo setting up default folders if not exist "%PublishDir%\Configuration" md "%PublishDir%\Configuration" diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index 52c7bc158..680f5ca8e 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -79,6 +79,12 @@ namespace IW4MAdmin override public async Task OnClientDisconnected(EFClient client) { + if (!GetClientsAsList().Any(_client => _client.NetworkId == client.NetworkId)) + { + Logger.WriteInfo($"{client} disconnecting, but they are not connected"); + return; + } + #if DEBUG == true if (client.ClientNumber >= 0) { diff --git a/SharedLibraryCore/Services/ClientService.cs b/SharedLibraryCore/Services/ClientService.cs index 8fb5d7c00..bfc1e901e 100644 --- a/SharedLibraryCore/Services/ClientService.cs +++ b/SharedLibraryCore/Services/ClientService.cs @@ -406,6 +406,13 @@ namespace SharedLibraryCore.Services public async Task Update(EFClient temporalClient) { + if (temporalClient.ClientId < 1) + { + temporalClient.CurrentServer?.Logger.WriteDebug($"[update] {temporalClient} needs to be updated but they do not have a valid client id, ignoring.."); + // note: we never do anything with the result of this so we can safely return null + return null; + } + using (var context = new DatabaseContext()) { // grab the context version of the entity diff --git a/WebfrontCore/Views/Shared/_Layout.cshtml b/WebfrontCore/Views/Shared/_Layout.cshtml index 99e57dfad..0fb28aede 100644 --- a/WebfrontCore/Views/Shared/_Layout.cshtml +++ b/WebfrontCore/Views/Shared/_Layout.cshtml @@ -144,12 +144,12 @@ - - - + + + - - + + diff --git a/WebfrontCore/bundleconfig.json b/WebfrontCore/bundleconfig.json index 58e161fae..f36df1e03 100644 --- a/WebfrontCore/bundleconfig.json +++ b/WebfrontCore/bundleconfig.json @@ -11,8 +11,8 @@ { "outputFileName": "wwwroot/js/global.min.js", "inputFiles": [ - "wwwroot/lib/jquery/jquery.min.js", - "wwwroot/lib/popper.js/umd/popper.js", + "wwwroot/lib/jquery/dist/jquery.js", + "wwwroot/lib/popper.js/dist/umd/popper.js", "wwwroot/lib/moment.js/moment.min.js", "wwwroot/lib/moment-timezone/moment-timezone.min.js", "wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js", diff --git a/_customcallbacks.gsc b/_customcallbacks.gsc index b00cdf587..7220c6949 100644 --- a/_customcallbacks.gsc +++ b/_customcallbacks.gsc @@ -29,6 +29,8 @@ onPlayerConnect( player ) for( ;; ) { level waittill( "connected", player ); + player setClientDvar("cl_autorecord", 1); + player setClientDvar("cl_demosKeep", 200); player thread waitForFrameThread(); } }