modify iw6x parser to default game log vars temporarily, small amount of code cleanup to git rid of warnings

This commit is contained in:
RaidMax 2020-11-12 20:39:56 -06:00
parent e997b94b3b
commit 6619ce714a
7 changed files with 37 additions and 8 deletions

View File

@ -128,7 +128,17 @@ namespace IW4MAdmin.Application.RCon
byte[][] response = null;
retrySend:
retrySend:
if (connectionState.ConnectionAttempts > 1)
{
using (LogContext.PushProperty("Server", Endpoint.ToString()))
{
_log.LogInformation(
"Retrying RCon message ({connectionAttempts}/{allowedConnectionFailures} attempts) with parameters {payload}",
connectionState.ConnectionAttempts,
StaticHelpers.AllowedConnectionFails, parameters);
}
}
using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
{
DontFragment = true,

View File

@ -3,7 +3,7 @@ var eventParser;
var plugin = {
author: 'Xerxes, RaidMax',
version: 0.1,
version: 0.2,
name: 'IW6x Parser',
isParser: true,
@ -27,6 +27,8 @@ var plugin = {
rconParser.Configuration.Status.AddMapping(102, 4);
rconParser.Configuration.Status.AddMapping(103, 5);
rconParser.Configuration.Status.AddMapping(104, 6);
rconParser.Configuration.DefaultDvarValues.Add('g_log', 'games_mp.log'); // todo: remove this once proper log support is implemented
rconParser.Configuration.DefaultDvarValues.Add('g_logsync', '1'); // todo: remove this once proper log support is implemented
rconParser.Version = 'IW6 MP 3.15 build 2 Sat Sep 14 2013 03:58:30PM win64';
rconParser.GameName = 4; // IW6

View File

@ -10,6 +10,7 @@ using SharedLibraryCore.Interfaces;
using Stats.Dtos;
using StatsWeb.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
@ -88,7 +89,7 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
SentAfter = whenLower
});
return View("_MessageContext", messages.Results);
return View("_MessageContext", messages.Results.ToList());
}
[HttpGet("Message/Find")]
@ -187,13 +188,13 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
// we want to show anything related to the automated offense
else
{
return View("_MessageContext", new[]
return View("_MessageContext", new List<MessageResponse>
{
new ChatInfo()
new MessageResponse()
{
ClientId = penalty.OffenderId,
Message = penalty.AutomatedOffense,
Time = penalty.When
When = penalty.When
}
});
}

View File

@ -6,21 +6,37 @@
string rankIcon(double elo)
{
if (elo >= getDeviation(-0.75) && elo < getDeviation(1.25))
{
return "0_no-place/menu_div_no_place.png";
}
if (elo >= getDeviation(0.125) && elo < getDeviation(0.625))
{
return "1_iron/menu_div_iron_sub03.png";
}
if (elo >= getDeviation(0.625) && elo < getDeviation(1.0))
{
return "2_bronze/menu_div_bronze_sub03.png";
}
if (elo >= getDeviation(1.0) && elo < getDeviation(1.25))
{
return "3_silver/menu_div_silver_sub03.png";
}
if (elo >= getDeviation(1.25) && elo < getDeviation(1.5))
{
return "4_gold/menu_div_gold_sub03.png";
}
if (elo >= getDeviation(1.5) && elo < getDeviation(1.75))
{
return "5_platinum/menu_div_platinum_sub03.png";
}
if (elo >= getDeviation(1.75) && elo < getDeviation(2.0))
{
return "6_semipro/menu_div_semipro_sub03.png";
}
if (elo >= getDeviation(2.0))
{
return "7_pro/menu_div_pro_sub03.png";
}
return "0_no-place/menu_div_no_place.png";
}

View File

@ -1,5 +1,5 @@
@using SharedLibraryCore.Dtos.Meta.Responses
@model IEnumerable<MessageResponse>
@model IList<MessageResponse>
@{
Layout = null;
}

View File

@ -14,7 +14,7 @@ namespace WebfrontCore.ViewComponents
var penalties = await Program.Manager.GetPenaltyService().GetRecentPenalties(PENALTY_COUNT, offset, showOnly, ignoreAutomated);
penalties = User.Identity.IsAuthenticated ? penalties : penalties.Where(p => !p.Sensitive).ToList();
return View("_List", penalties);
return View("~/Views/Penalty/PenaltyInfoList.cshtml", penalties);
}
}
}