Fix bug with webfront spamming issues when running

Remove IW5 parser
Begin implementation of dynamic parsers
This commit is contained in:
RaidMax
2019-01-26 20:33:37 -06:00
parent 08c883e0ff
commit 7a6dccc26a
29 changed files with 223 additions and 325 deletions

View File

@ -35,7 +35,7 @@ namespace WebfrontCore.Controllers
Level = p.Level.ToLocalizedLevelName(),
LevelInt = (int)p.Level
}).ToList(),
ChatHistory = s.ChatHistory,
ChatHistory = s.ChatHistory.ToList(),
PlayerHistory = s.ClientHistory.ToArray(),
};
return PartialView("_ClientActivity", serverInfo);

View File

@ -6,9 +6,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using SharedLibraryCore.Database;
using System;
using System.IO;
using System.Reflection;
namespace WebfrontCore
{
@ -62,6 +59,7 @@ namespace WebfrontCore
loggerFactory.AddDebug();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");

View File

@ -2,7 +2,7 @@
@{
Layout = null;
int half = (int)Math.Ceiling(Model.ClientCount / 2.0);
int half = Model.ClientCount == 0 || Model.Players.Count == 0 ? 0 : (int)Math.Ceiling(Model.ClientCount / 2.0);
}
<div class="col-12 col-md-8 d-none d-md-block">
@{
@ -43,7 +43,7 @@
</div>
<div class="col-6 text-right">
@{
for (int i = half; i < Model.ClientCount; i++)
for (int i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++)
{
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />