increase master history to 7 day, up from 1 day

This commit is contained in:
RaidMax 2019-07-21 17:14:44 -05:00
parent 50ba71c6fb
commit d73d68d9f4
5 changed files with 28 additions and 25 deletions

View File

@ -8,7 +8,7 @@ class History():
self.server_history = list() self.server_history = list()
def add_client_history(self, client_num): 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 = self.client_history[1:]
self.client_history.append({ self.client_history.append({
'count' : client_num, 'count' : client_num,
@ -16,7 +16,7 @@ class History():
}) })
def add_server_history(self, server_num): 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 = self.server_history[1:]
self.server_history.append({ self.server_history.append({
'count' : server_num, 'count' : server_num,
@ -24,7 +24,7 @@ class History():
}) })
def add_instance_history(self, instance_num): 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 = self.instance_history[1:]
self.instance_history.append({ self.instance_history.append({
'count' : instance_num, 'count' : instance_num,

View File

@ -1,8 +1,5 @@
using SharedLibraryCore.Configuration; using SharedLibraryCore.Interfaces;
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
namespace LiveRadar.Configuration namespace LiveRadar.Configuration
{ {
@ -36,8 +33,7 @@ namespace LiveRadar.Configuration
MaxRight = -225, MaxRight = -225,
MaxLeft = 1809, MaxLeft = 1809,
MaxTop = 1773, MaxTop = 1773,
MaxBottom = -469, MaxBottom = -469
ViewPositionRotation = 180
}, },
new MapInfo() new MapInfo()
@ -61,10 +57,10 @@ namespace LiveRadar.Configuration
Bottom = 999, Bottom = 999,
Left = 173, Left = 173,
Right = 942, Right = 942,
MaxTop = 2103, // x max MaxTop = 2103,
MaxBottom = -5077, //x min MaxBottom = -5077,
MaxLeft = 4437, // ymax MaxLeft = 4437,
MaxRight = -1240, // y min MaxRight = -1240,
Rotation = 143, Rotation = 143,
CenterX = -1440, CenterX = -1440,
CenterY = 1920, CenterY = 1920,

View File

@ -30,7 +30,11 @@ namespace SharedLibraryCore
/// <summary> /// <summary>
/// client is doing too much of something /// client is doing too much of something
/// </summary> /// </summary>
Throttle Throttle,
/// <summary>
/// the event timed out before completion
/// </summary>
Timeout
} }
public enum EventType public enum EventType
@ -225,7 +229,9 @@ namespace SharedLibraryCore
{ {
return Task.Run(() => 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; return this;
}); });
} }

View File

@ -51,12 +51,13 @@ namespace WebfrontCore.Controllers
}; };
Manager.GetEventHandler().AddEvent(remoteEvent); Manager.GetEventHandler().AddEvent(remoteEvent);
List<CommandResponseInfo> response; List<CommandResponseInfo> response = null;
try try
{ {
var completedEvent = await remoteEvent.WaitAsync(Utilities.DefaultCommandTimeout, server.Manager.CancellationToken);
// wait for the event to process // 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(); 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<CommandResponseInfo>() response = new List<CommandResponseInfo>()
{
new CommandResponseInfo()
{ {
ClientId = client.ClientId, new CommandResponseInfo()
Response = Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_COMMAND_TIMEOUT"] {
} ClientId = client.ClientId,
}; Response = Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_COMMAND_TIMEOUT"]
}
};
} }
} }

View File

@ -35,7 +35,7 @@ $(document).ready(function () {
}); });
$(document).keydown(function (event) { $(document).keydown(function (event) {
const keyCode = (event.keyCode ? event.keyCode : event.which); const keyCode = event.keyCode ? event.keyCode : event.which;
if (keyCode === 13) { if (keyCode === 13) {
executeCommand(); executeCommand();
} }