From d73d68d9f45962977a2006b000c71c369705cbae Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 21 Jul 2019 17:14:44 -0500 Subject: [PATCH] increase master history to 7 day, up from 1 day --- Master/master/context/history.py | 6 +++--- .../Configuration/LiveRadarConfiguration.cs | 16 ++++++---------- SharedLibraryCore/Events/GameEvent.cs | 10 ++++++++-- WebfrontCore/Controllers/ConsoleController.cs | 19 ++++++++++--------- WebfrontCore/wwwroot/js/console.js | 2 +- 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Master/master/context/history.py b/Master/master/context/history.py index ac54c4b5f..02eefac8d 100644 --- a/Master/master/context/history.py +++ b/Master/master/context/history.py @@ -8,7 +8,7 @@ class History(): self.server_history = list() def add_client_history(self, client_num): - if len(self.client_history) > 2880: + if len(self.client_history) > 20160: self.client_history = self.client_history[1:] self.client_history.append({ 'count' : client_num, @@ -16,7 +16,7 @@ class History(): }) def add_server_history(self, server_num): - if len(self.server_history) > 2880: + if len(self.server_history) > 20160: self.server_history = self.server_history[1:] self.server_history.append({ 'count' : server_num, @@ -24,7 +24,7 @@ class History(): }) def add_instance_history(self, instance_num): - if len(self.instance_history) > 2880: + if len(self.instance_history) > 20160: self.instance_history = self.instance_history[1:] self.instance_history.append({ 'count' : instance_num, diff --git a/Plugins/LiveRadar/Configuration/LiveRadarConfiguration.cs b/Plugins/LiveRadar/Configuration/LiveRadarConfiguration.cs index e529154a7..58c8150b4 100644 --- a/Plugins/LiveRadar/Configuration/LiveRadarConfiguration.cs +++ b/Plugins/LiveRadar/Configuration/LiveRadarConfiguration.cs @@ -1,8 +1,5 @@ -using SharedLibraryCore.Configuration; -using SharedLibraryCore.Interfaces; -using System; +using SharedLibraryCore.Interfaces; using System.Collections.Generic; -using System.Text; namespace LiveRadar.Configuration { @@ -36,8 +33,7 @@ namespace LiveRadar.Configuration MaxRight = -225, MaxLeft = 1809, MaxTop = 1773, - MaxBottom = -469, - ViewPositionRotation = 180 + MaxBottom = -469 }, new MapInfo() @@ -61,10 +57,10 @@ namespace LiveRadar.Configuration Bottom = 999, Left = 173, Right = 942, - MaxTop = 2103, // x max - MaxBottom = -5077, //x min - MaxLeft = 4437, // ymax - MaxRight = -1240, // y min + MaxTop = 2103, + MaxBottom = -5077, + MaxLeft = 4437, + MaxRight = -1240, Rotation = 143, CenterX = -1440, CenterY = 1920, diff --git a/SharedLibraryCore/Events/GameEvent.cs b/SharedLibraryCore/Events/GameEvent.cs index bd25d0d4d..8eb1b7d71 100644 --- a/SharedLibraryCore/Events/GameEvent.cs +++ b/SharedLibraryCore/Events/GameEvent.cs @@ -30,7 +30,11 @@ namespace SharedLibraryCore /// /// client is doing too much of something /// - Throttle + Throttle, + /// + /// the event timed out before completion + /// + Timeout } public enum EventType @@ -225,7 +229,9 @@ namespace SharedLibraryCore { return Task.Run(() => { - OnProcessed.Wait(timeSpan, token); + bool processed = OnProcessed.Wait(timeSpan, token); + // this let's us know if the the action timed out + FailReason = FailReason == EventFailReason.None & !processed ? EventFailReason.Timeout : FailReason; return this; }); } diff --git a/WebfrontCore/Controllers/ConsoleController.cs b/WebfrontCore/Controllers/ConsoleController.cs index 3cbac828d..23a6d4a96 100644 --- a/WebfrontCore/Controllers/ConsoleController.cs +++ b/WebfrontCore/Controllers/ConsoleController.cs @@ -51,12 +51,13 @@ namespace WebfrontCore.Controllers }; Manager.GetEventHandler().AddEvent(remoteEvent); - List response; + List response = null; try { + var completedEvent = await remoteEvent.WaitAsync(Utilities.DefaultCommandTimeout, server.Manager.CancellationToken); // wait for the event to process - if (!(await remoteEvent.WaitAsync(Utilities.DefaultCommandTimeout, server.Manager.CancellationToken)).Failed) + if (!completedEvent.Failed) { response = server.CommandResult.Where(c => c.ClientId == client.ClientId).ToList(); @@ -67,16 +68,16 @@ namespace WebfrontCore.Controllers } } - else + else if (completedEvent.FailReason == GameEvent.EventFailReason.Timeout) { response = new List() - { - new CommandResponseInfo() { - ClientId = client.ClientId, - Response = Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_COMMAND_TIMEOUT"] - } - }; + new CommandResponseInfo() + { + ClientId = client.ClientId, + Response = Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_COMMAND_TIMEOUT"] + } + }; } } diff --git a/WebfrontCore/wwwroot/js/console.js b/WebfrontCore/wwwroot/js/console.js index f5b84803d..5b13e9c08 100644 --- a/WebfrontCore/wwwroot/js/console.js +++ b/WebfrontCore/wwwroot/js/console.js @@ -35,7 +35,7 @@ $(document).ready(function () { }); $(document).keydown(function (event) { - const keyCode = (event.keyCode ? event.keyCode : event.which); + const keyCode = event.keyCode ? event.keyCode : event.which; if (keyCode === 13) { executeCommand(); }