Compare commits
16 Commits
2023.08.27
...
release/pr
Author | SHA1 | Date | |
---|---|---|---|
95eb73da6e | |||
6ec0a24ca2 | |||
|
03b5b8b143 | ||
|
005a8b050d | ||
|
2c99f7b48e | ||
|
13d4ec3033 | ||
|
e6cdae5a6b | ||
|
d69a9ecf56 | ||
|
b6c32181b0 | ||
|
2017eebeba | ||
|
3192fe35e6 | ||
|
c1dace4af6 | ||
|
5c6ae3146a | ||
|
2e99db2275 | ||
|
79eec08590 | ||
|
69691f75f4 |
@ -1251,6 +1251,10 @@
|
|||||||
"Alias": "Call of the Dead",
|
"Alias": "Call of the Dead",
|
||||||
"Name": "zombie_coast"
|
"Name": "zombie_coast"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Alias": "Shangri-La",
|
||||||
|
"Name": "zombie_temple"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Alias": "Moon",
|
"Alias": "Moon",
|
||||||
"Name": "zombie_moon"
|
"Name": "zombie_moon"
|
||||||
|
@ -432,7 +432,12 @@ namespace IW4MAdmin.Application
|
|||||||
appConfigHandler.BuildAsync().GetAwaiter().GetResult();
|
appConfigHandler.BuildAsync().GetAwaiter().GetResult();
|
||||||
var commandConfigHandler = new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration");
|
var commandConfigHandler = new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration");
|
||||||
commandConfigHandler.BuildAsync().GetAwaiter().GetResult();
|
commandConfigHandler.BuildAsync().GetAwaiter().GetResult();
|
||||||
|
|
||||||
|
if (appConfigHandler.Configuration()?.MasterUrl == new Uri("http://api.raidmax.org:5000"))
|
||||||
|
{
|
||||||
|
appConfigHandler.Configuration().MasterUrl = new ApplicationConfiguration().MasterUrl;
|
||||||
|
}
|
||||||
|
|
||||||
var appConfig = appConfigHandler.Configuration();
|
var appConfig = appConfigHandler.Configuration();
|
||||||
var masterUri = Utilities.IsDevelopment
|
var masterUri = Utilities.IsDevelopment
|
||||||
? new Uri("http://127.0.0.1:8080")
|
? new Uri("http://127.0.0.1:8080")
|
||||||
|
@ -8,9 +8,11 @@ using Data.Abstractions;
|
|||||||
using Data.Models;
|
using Data.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using SharedLibraryCore;
|
using SharedLibraryCore;
|
||||||
|
using SharedLibraryCore.Configuration;
|
||||||
using SharedLibraryCore.Dtos;
|
using SharedLibraryCore.Dtos;
|
||||||
using SharedLibraryCore.Helpers;
|
using SharedLibraryCore.Helpers;
|
||||||
using SharedLibraryCore.Interfaces;
|
using SharedLibraryCore.Interfaces;
|
||||||
|
using WebfrontCore.Permissions;
|
||||||
using WebfrontCore.QueryHelpers.Models;
|
using WebfrontCore.QueryHelpers.Models;
|
||||||
using EFClient = Data.Models.Client.EFClient;
|
using EFClient = Data.Models.Client.EFClient;
|
||||||
|
|
||||||
@ -18,6 +20,7 @@ namespace IW4MAdmin.Application.QueryHelpers;
|
|||||||
|
|
||||||
public class ClientResourceQueryHelper : IResourceQueryHelper<ClientResourceRequest, ClientResourceResponse>
|
public class ClientResourceQueryHelper : IResourceQueryHelper<ClientResourceRequest, ClientResourceResponse>
|
||||||
{
|
{
|
||||||
|
public ApplicationConfiguration _appConfig { get; }
|
||||||
private readonly IDatabaseContextFactory _contextFactory;
|
private readonly IDatabaseContextFactory _contextFactory;
|
||||||
private readonly IGeoLocationService _geoLocationService;
|
private readonly IGeoLocationService _geoLocationService;
|
||||||
|
|
||||||
@ -27,8 +30,10 @@ public class ClientResourceQueryHelper : IResourceQueryHelper<ClientResourceRequ
|
|||||||
public EFAlias Alias { get; set; }
|
public EFAlias Alias { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientResourceQueryHelper(IDatabaseContextFactory contextFactory, IGeoLocationService geoLocationService)
|
public ClientResourceQueryHelper(IDatabaseContextFactory contextFactory, IGeoLocationService geoLocationService,
|
||||||
|
ApplicationConfiguration appConfig)
|
||||||
{
|
{
|
||||||
|
_appConfig = appConfig;
|
||||||
_contextFactory = contextFactory;
|
_contextFactory = contextFactory;
|
||||||
_geoLocationService = geoLocationService;
|
_geoLocationService = geoLocationService;
|
||||||
}
|
}
|
||||||
@ -75,7 +80,9 @@ public class ClientResourceQueryHelper : IResourceQueryHelper<ClientResourceRequ
|
|||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(query.ClientIp))
|
if (!string.IsNullOrWhiteSpace(query.ClientIp))
|
||||||
{
|
{
|
||||||
clientAliases = SearchByIp(query, clientAliases);
|
clientAliases = SearchByIp(query, clientAliases,
|
||||||
|
_appConfig.HasPermission(query.RequesterPermission, WebfrontEntity.ClientIPAddress,
|
||||||
|
WebfrontPermission.Read));
|
||||||
}
|
}
|
||||||
|
|
||||||
var iqGroupedClientAliases = clientAliases.GroupBy(a => new { a.Client.ClientId, a.Client.LastConnection });
|
var iqGroupedClientAliases = clientAliases.GroupBy(a => new { a.Client.ClientId, a.Client.LastConnection });
|
||||||
@ -203,7 +210,7 @@ public class ClientResourceQueryHelper : IResourceQueryHelper<ClientResourceRequ
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static IQueryable<ClientAlias> SearchByIp(ClientResourceRequest query,
|
private static IQueryable<ClientAlias> SearchByIp(ClientResourceRequest query,
|
||||||
IQueryable<ClientAlias> clientAliases)
|
IQueryable<ClientAlias> clientAliases, bool canSearchIP)
|
||||||
{
|
{
|
||||||
var ipString = query.ClientIp.Trim();
|
var ipString = query.ClientIp.Trim();
|
||||||
var ipAddress = ipString.ConvertToIP();
|
var ipAddress = ipString.ConvertToIP();
|
||||||
@ -213,7 +220,7 @@ public class ClientResourceQueryHelper : IResourceQueryHelper<ClientResourceRequ
|
|||||||
clientAliases = clientAliases.Where(clientAlias =>
|
clientAliases = clientAliases.Where(clientAlias =>
|
||||||
clientAlias.Alias.IPAddress != null && clientAlias.Alias.IPAddress == ipAddress);
|
clientAlias.Alias.IPAddress != null && clientAlias.Alias.IPAddress == ipAddress);
|
||||||
}
|
}
|
||||||
else
|
else if(canSearchIP)
|
||||||
{
|
{
|
||||||
clientAliases = clientAliases.Where(clientAlias =>
|
clientAliases = clientAliases.Where(clientAlias =>
|
||||||
EF.Functions.Like(clientAlias.Alias.SearchableIPAddress, $"{ipString}%"));
|
EF.Functions.Like(clientAlias.Alias.SearchableIPAddress, $"{ipString}%"));
|
||||||
|
@ -194,10 +194,14 @@ namespace IW4MAdmin.Application.RConParsers
|
|||||||
foreach (var line in response)
|
foreach (var line in response)
|
||||||
{
|
{
|
||||||
var regex = Regex.Match(line, parserRegex.Pattern);
|
var regex = Regex.Match(line, parserRegex.Pattern);
|
||||||
if (regex.Success && parserRegex.GroupMapping.ContainsKey(groupType))
|
|
||||||
|
if (!regex.Success || !parserRegex.GroupMapping.ContainsKey(groupType))
|
||||||
{
|
{
|
||||||
value = regex.Groups[parserRegex.GroupMapping[groupType]].ToString();
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value = regex.Groups[parserRegex.GroupMapping[groupType]].ToString();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == null)
|
if (value == null)
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
T7 = 8,
|
T7 = 8,
|
||||||
SHG1 = 9,
|
SHG1 = 9,
|
||||||
CSGO = 10,
|
CSGO = 10,
|
||||||
H1 = 11
|
H1 = 11,
|
||||||
|
L4D2 = 12,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ConnectionType
|
public enum ConnectionType
|
||||||
|
@ -88,7 +88,7 @@ IsBotWrapper( client )
|
|||||||
|
|
||||||
GetXuidWrapper()
|
GetXuidWrapper()
|
||||||
{
|
{
|
||||||
return self GetXUID();
|
return self GetGuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
|
@ -53,6 +53,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScriptPlugins", "ScriptPlug
|
|||||||
Plugins\ScriptPlugins\ParserPlutoniumT5.js = Plugins\ScriptPlugins\ParserPlutoniumT5.js
|
Plugins\ScriptPlugins\ParserPlutoniumT5.js = Plugins\ScriptPlugins\ParserPlutoniumT5.js
|
||||||
Plugins\ScriptPlugins\ServerBanner.js = Plugins\ScriptPlugins\ServerBanner.js
|
Plugins\ScriptPlugins\ServerBanner.js = Plugins\ScriptPlugins\ServerBanner.js
|
||||||
Plugins\ScriptPlugins\ParserBOIII.js = Plugins\ScriptPlugins\ParserBOIII.js
|
Plugins\ScriptPlugins\ParserBOIII.js = Plugins\ScriptPlugins\ParserBOIII.js
|
||||||
|
Plugins\ScriptPlugins\ParserL4D2SM.js = Plugins\ScriptPlugins\ParserL4D2SM.js
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}"
|
||||||
|
@ -22,10 +22,10 @@ const plugin = {
|
|||||||
rconParser.Configuration.MapStatus.AddMapping(111, 1);
|
rconParser.Configuration.MapStatus.AddMapping(111, 1);
|
||||||
|
|
||||||
rconParser.Configuration.HostnameStatus.Pattern = '^hostname: +(.+)$';
|
rconParser.Configuration.HostnameStatus.Pattern = '^hostname: +(.+)$';
|
||||||
rconParser.Configuration.MapStatus.AddMapping(113, 1);
|
rconParser.Configuration.HostnameStatus.AddMapping(113, 1);
|
||||||
|
|
||||||
rconParser.Configuration.MaxPlayersStatus.Pattern = '^players *: +\\d+ humans, \\d+ bots \\((\\d+).+';
|
rconParser.Configuration.MaxPlayersStatus.Pattern = '^players *: +\\d+ humans, \\d+ bots \\((\\d+).+';
|
||||||
rconParser.Configuration.MapStatus.AddMapping(114, 1);
|
rconParser.Configuration.MaxPlayersStatus.AddMapping(114, 1);
|
||||||
|
|
||||||
rconParser.Configuration.Dvar.Pattern = '^"(.+)" = "(.+)" (?:\\( def. "(.*)" \\))?(?: |\\w)+- (.+)$';
|
rconParser.Configuration.Dvar.Pattern = '^"(.+)" = "(.+)" (?:\\( def. "(.*)" \\))?(?: |\\w)+- (.+)$';
|
||||||
rconParser.Configuration.Dvar.AddMapping(106, 1);
|
rconParser.Configuration.Dvar.AddMapping(106, 1);
|
||||||
|
@ -3,7 +3,7 @@ let eventParser;
|
|||||||
|
|
||||||
const plugin = {
|
const plugin = {
|
||||||
author: 'RaidMax',
|
author: 'RaidMax',
|
||||||
version: 0.6,
|
version: 0.7,
|
||||||
name: 'CS:GO (SourceMod) Parser',
|
name: 'CS:GO (SourceMod) Parser',
|
||||||
engine: 'Source',
|
engine: 'Source',
|
||||||
isParser: true,
|
isParser: true,
|
||||||
@ -22,10 +22,10 @@ const plugin = {
|
|||||||
rconParser.Configuration.MapStatus.AddMapping(111, 1);
|
rconParser.Configuration.MapStatus.AddMapping(111, 1);
|
||||||
|
|
||||||
rconParser.Configuration.HostnameStatus.Pattern = '^hostname: +(.+)$';
|
rconParser.Configuration.HostnameStatus.Pattern = '^hostname: +(.+)$';
|
||||||
rconParser.Configuration.MapStatus.AddMapping(113, 1);
|
rconParser.Configuration.HostnameStatus.AddMapping(113, 1);
|
||||||
|
|
||||||
rconParser.Configuration.MaxPlayersStatus.Pattern = '^players *: +\\d+ humans, \\d+ bots \\((\\d+).+';
|
rconParser.Configuration.MaxPlayersStatus.Pattern = '^players *: +\\d+ humans, \\d+ bots \\((\\d+).+';
|
||||||
rconParser.Configuration.MapStatus.AddMapping(114, 1);
|
rconParser.Configuration.MaxPlayersStatus.AddMapping(114, 1);
|
||||||
|
|
||||||
rconParser.Configuration.Dvar.Pattern = '^"(.+)" = "(.+)" (?:\\( def. "(.*)" \\))?(?: |\\w)+- (.+)$';
|
rconParser.Configuration.Dvar.Pattern = '^"(.+)" = "(.+)" (?:\\( def. "(.*)" \\))?(?: |\\w)+- (.+)$';
|
||||||
rconParser.Configuration.Dvar.AddMapping(106, 1);
|
rconParser.Configuration.Dvar.AddMapping(106, 1);
|
||||||
|
135
Plugins/ScriptPlugins/ParserL4D2SM.js
Normal file
135
Plugins/ScriptPlugins/ParserL4D2SM.js
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
let rconParser;
|
||||||
|
let eventParser;
|
||||||
|
|
||||||
|
const plugin = {
|
||||||
|
author: 'RaidMax',
|
||||||
|
version: 0.1,
|
||||||
|
name: 'L4D2 (SourceMod) Parser',
|
||||||
|
engine: 'Source',
|
||||||
|
isParser: true,
|
||||||
|
|
||||||
|
onEventAsync: function (gameEvent, server) {
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoadAsync: function (manager) {
|
||||||
|
rconParser = manager.GenerateDynamicRConParser(this.name);
|
||||||
|
eventParser = manager.GenerateDynamicEventParser(this.name);
|
||||||
|
rconParser.RConEngine = this.engine;
|
||||||
|
|
||||||
|
rconParser.Configuration.StatusHeader.Pattern = '# userid name uniqueid connected ping loss state rate adr';
|
||||||
|
|
||||||
|
rconParser.Configuration.MapStatus.Pattern = '^map *: +(.+)$';
|
||||||
|
rconParser.Configuration.MapStatus.AddMapping(111, 1);
|
||||||
|
|
||||||
|
rconParser.Configuration.HostnameStatus.Pattern = '^hostname: +(.+)$';
|
||||||
|
rconParser.Configuration.HostnameStatus.AddMapping(113, 1);
|
||||||
|
|
||||||
|
rconParser.Configuration.MaxPlayersStatus.Pattern = '^players *: +\\d+ humans, \\d+ bots \\((\\d+).+';
|
||||||
|
rconParser.Configuration.MaxPlayersStatus.AddMapping(114, 1);
|
||||||
|
|
||||||
|
rconParser.Configuration.Dvar.Pattern = '^\\"(.+)\\" (?:=|is) \\"(.+)\\"(?: (?:\\( def. \\"(.*)\\" \\)))?$';
|
||||||
|
rconParser.Configuration.Dvar.AddMapping(106, 1);
|
||||||
|
rconParser.Configuration.Dvar.AddMapping(107, 2);
|
||||||
|
rconParser.Configuration.Dvar.AddMapping(108, 3);
|
||||||
|
rconParser.Configuration.Dvar.AddMapping(109, 3);
|
||||||
|
|
||||||
|
rconParser.Configuration.Status.Pattern = '^#\\s*(\\d+) (\\d+) "(.+)" (\\S+) +(\\d+:\\d+(?::\\d+)?) (\\d+) (\\S+) (\\S+) (\\d+) (\\d+\\.\\d+\\.\\d+\\.\\d+:\\d+)$';
|
||||||
|
rconParser.Configuration.Status.AddMapping(100, 2);
|
||||||
|
rconParser.Configuration.Status.AddMapping(101, -1);
|
||||||
|
rconParser.Configuration.Status.AddMapping(102, 6);
|
||||||
|
rconParser.Configuration.Status.AddMapping(103, 4)
|
||||||
|
rconParser.Configuration.Status.AddMapping(104, 3);
|
||||||
|
rconParser.Configuration.Status.AddMapping(105, 10);
|
||||||
|
rconParser.Configuration.Status.AddMapping(200, 1);
|
||||||
|
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('sv_running', '1');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('bugfix_no_version', this.engine);
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('fs_basepath', '');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('fs_basegame', '');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('fs_homepath', '');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('g_log', '');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('net_ip', 'localhost');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('g_gametype', '');
|
||||||
|
rconParser.Configuration.DefaultDvarValues.Add('fs_game', '');
|
||||||
|
|
||||||
|
rconParser.Configuration.OverrideDvarNameMapping.Add('sv_hostname', 'hostname');
|
||||||
|
rconParser.Configuration.OverrideDvarNameMapping.Add('mapname', 'host_map');
|
||||||
|
rconParser.Configuration.OverrideDvarNameMapping.Add('sv_maxclients', 'maxplayers');
|
||||||
|
rconParser.Configuration.OverrideDvarNameMapping.Add('g_password', 'sv_password');
|
||||||
|
rconParser.Configuration.OverrideDvarNameMapping.Add('version', 'bugfix_no_version');
|
||||||
|
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Clear();
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('White', '\x01');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Red', '\x07');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('LightRed', '\x0F');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('DarkRed', '\x02');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Blue', '\x0B');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('DarkBlue', '\x0C');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Purple', '\x03');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Orchid', '\x0E');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Yellow', '\x09');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Gold', '\x10');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('LightGreen', '\x05');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Green', '\x04');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Lime', '\x06');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Grey', '\x08');
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Grey2', '\x0D');
|
||||||
|
// only adding there here for the default accent color
|
||||||
|
rconParser.Configuration.ColorCodeMapping.Add('Cyan', '\x0B');
|
||||||
|
|
||||||
|
rconParser.Configuration.NoticeLineSeparator = '. ';
|
||||||
|
rconParser.Configuration.DefaultRConPort = 27015;
|
||||||
|
rconParser.CanGenerateLogPath = false;
|
||||||
|
|
||||||
|
rconParser.Configuration.CommandPrefixes.RConGetInfo = undefined;
|
||||||
|
rconParser.Configuration.CommandPrefixes.Kick = 'sm_kick #{0} {1}';
|
||||||
|
rconParser.Configuration.CommandPrefixes.Ban = 'sm_kick #{0} {1}';
|
||||||
|
rconParser.Configuration.CommandPrefixes.TempBan = 'sm_kick #{0} {1}';
|
||||||
|
rconParser.Configuration.CommandPrefixes.Say = 'sm_say {0}';
|
||||||
|
rconParser.Configuration.CommandPrefixes.Tell = 'sm_psay #{0} "{1}"';
|
||||||
|
|
||||||
|
eventParser.Configuration.Say.Pattern = '^"(.+)<(\\d+)><(.+)><(.*?)>" (?:say|say_team) "(.*)"$';
|
||||||
|
eventParser.Configuration.Say.AddMapping(5, 1);
|
||||||
|
eventParser.Configuration.Say.AddMapping(3, 2);
|
||||||
|
eventParser.Configuration.Say.AddMapping(1, 3);
|
||||||
|
eventParser.Configuration.Say.AddMapping(7, 4);
|
||||||
|
eventParser.Configuration.Say.AddMapping(13, 5);
|
||||||
|
|
||||||
|
eventParser.Configuration.Kill.Pattern = '^"(.+)<(\\d+)><(.+)><(.*)>" \\[-?\\d+ -?\\d+ -?\\d+\\] killed "(.+)<(\\d+)><(.+)><(.*)>" \\[-?\\d+ -?\\d+ -?\\d+\\] with "(\\S*)" *(?:\\((\\w+)((?: ).+)?\\))?$';
|
||||||
|
eventParser.Configuration.Kill.AddMapping(5, 1);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(3, 2);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(1, 3);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(7, 4);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(6, 5);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(4, 6);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(2, 7);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(8, 8);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(9, 9);
|
||||||
|
eventParser.Configuration.Kill.AddMapping(12, 10);
|
||||||
|
|
||||||
|
eventParser.Configuration.MapEnd.Pattern = '^World triggered "Match_Start" on "(.+)"$';
|
||||||
|
|
||||||
|
eventParser.Configuration.JoinTeam.Pattern = '^"(.+)<(\\d+)><(.*)>" switched from team <(.+)> to <(.+)>$';
|
||||||
|
eventParser.Configuration.JoinTeam.AddMapping(5, 1);
|
||||||
|
eventParser.Configuration.JoinTeam.AddMapping(3, 2);
|
||||||
|
eventParser.Configuration.JoinTeam.AddMapping(1, 3);
|
||||||
|
eventParser.Configuration.JoinTeam.AddMapping(7, 5);
|
||||||
|
|
||||||
|
eventParser.Configuration.TeamMapping.Add('CT', 2);
|
||||||
|
eventParser.Configuration.TeamMapping.Add('TERRORIST', 3);
|
||||||
|
|
||||||
|
eventParser.Configuration.Time.Pattern = '^L [01]\\d/[0-3]\\d/\\d+ - [0-2]\\d:[0-5]\\d:[0-5]\\d:';
|
||||||
|
|
||||||
|
rconParser.Version = 'L4D2SM';
|
||||||
|
rconParser.GameName = 12; // L4D2
|
||||||
|
eventParser.Version = 'L4D2SM';
|
||||||
|
eventParser.GameName = 12; // L4D2
|
||||||
|
eventParser.URLProtocolFormat = 'steam://connect/{{ip}}:{{port}}';
|
||||||
|
},
|
||||||
|
|
||||||
|
onUnloadAsync: function () {
|
||||||
|
},
|
||||||
|
|
||||||
|
onTickAsync: function (server) {
|
||||||
|
}
|
||||||
|
};
|
@ -28,18 +28,19 @@ namespace Stats.Dtos
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time associated with SentAfter date
|
/// The time associated with SentAfter date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SentAfterTime { get; set; } = "00:00";
|
public string SentAfterTime { get; set; }
|
||||||
|
|
||||||
public DateTime? SentAfterDateTime => SentAfter?.Add(TimeSpan.Parse(SentAfterTime));
|
public DateTime? SentAfterDateTime => SentAfter?.Add(string.IsNullOrEmpty(SentAfterTime) ? TimeSpan.Zero : TimeSpan.Parse(SentAfterTime));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// only look for messages sent before this date0
|
/// only look for messages sent before this date0
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime SentBefore { get; set; } = DateTime.UtcNow.Date;
|
public DateTime SentBefore { get; set; } = DateTime.UtcNow.Date;
|
||||||
|
|
||||||
public string SentBeforeTime { get; set; } = DateTime.UtcNow.ToString("HH:mm");
|
public string SentBeforeTime { get; set; }
|
||||||
|
|
||||||
public DateTime? SentBeforeDateTime => SentBefore.Add(TimeSpan.Parse(SentBeforeTime));
|
public DateTime? SentBeforeDateTime =>
|
||||||
|
SentBefore.Add(string.IsNullOrEmpty(SentBeforeTime) ? TimeSpan.Zero : TimeSpan.Parse(SentBeforeTime));
|
||||||
|
|
||||||
public bool IsExactMatch { get; set; }
|
public bool IsExactMatch { get; set; }
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ namespace IW4MAdmin.Plugins.Stats
|
|||||||
{
|
{
|
||||||
private const int ZScoreRange = 3;
|
private const int ZScoreRange = 3;
|
||||||
private const int RankIconDivisions = 24;
|
private const int RankIconDivisions = 24;
|
||||||
private const int MaxMessages = 100;
|
|
||||||
|
|
||||||
public class LogParams
|
public class LogParams
|
||||||
{
|
{
|
||||||
@ -127,70 +126,5 @@ namespace IW4MAdmin.Plugins.Stats
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// todo: lets abstract this out to a generic buildable query
|
|
||||||
/// this is just a dirty PoC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="query"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static ChatSearchQuery ParseSearchInfo(this string query, int count, int offset)
|
|
||||||
{
|
|
||||||
string[] filters = query.Split('|');
|
|
||||||
var searchRequest = new ChatSearchQuery
|
|
||||||
{
|
|
||||||
Filter = query,
|
|
||||||
Count = count,
|
|
||||||
Offset = offset
|
|
||||||
};
|
|
||||||
|
|
||||||
// sanity checks
|
|
||||||
searchRequest.Count = Math.Min(searchRequest.Count, MaxMessages);
|
|
||||||
searchRequest.Count = Math.Max(searchRequest.Count, 0);
|
|
||||||
searchRequest.Offset = Math.Max(searchRequest.Offset, 0);
|
|
||||||
|
|
||||||
if (filters.Length > 1)
|
|
||||||
{
|
|
||||||
if (filters[0].ToLower() != "chat")
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Query is not compatible with chat");
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string filter in filters.Skip(1))
|
|
||||||
{
|
|
||||||
string[] args = filter.Split(' ');
|
|
||||||
|
|
||||||
if (args.Length > 1)
|
|
||||||
{
|
|
||||||
string recombinedArgs = string.Join(' ', args.Skip(1));
|
|
||||||
switch (args[0].ToLower())
|
|
||||||
{
|
|
||||||
case "before":
|
|
||||||
searchRequest.SentBefore = DateTime.Parse(recombinedArgs);
|
|
||||||
break;
|
|
||||||
case "after":
|
|
||||||
searchRequest.SentAfter = DateTime.Parse(recombinedArgs);
|
|
||||||
break;
|
|
||||||
case "server":
|
|
||||||
searchRequest.ServerId = args[1];
|
|
||||||
break;
|
|
||||||
case "client":
|
|
||||||
searchRequest.ClientId = int.Parse(args[1]);
|
|
||||||
break;
|
|
||||||
case "contains":
|
|
||||||
searchRequest.MessageContains = string.Join(' ', args.Skip(1));
|
|
||||||
break;
|
|
||||||
case "sort":
|
|
||||||
searchRequest.Direction = Enum.Parse<SortDirection>(args[1], ignoreCase: true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return searchRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new ArgumentException("No filters specified for chat search");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -469,6 +469,8 @@ public class Plugin : IPluginV2
|
|||||||
ClientId = request.ClientId,
|
ClientId = request.ClientId,
|
||||||
Before = request.Before,
|
Before = request.Before,
|
||||||
SentBefore = request.Before ?? DateTime.UtcNow,
|
SentBefore = request.Before ?? DateTime.UtcNow,
|
||||||
|
SentAfter = request.After,
|
||||||
|
After = request.After,
|
||||||
Count = request.Count,
|
Count = request.Count,
|
||||||
IsProfileMeta = true
|
IsProfileMeta = true
|
||||||
};
|
};
|
||||||
|
@ -56,4 +56,4 @@ Feel free to join the **IW4MAdmin** [Discord](https://discord.gg/ZZFK5p3)
|
|||||||
If you come across an issue, bug, or feature request please post an [issue](https://github.com/RaidMax/IW4M-Admin/issues)
|
If you come across an issue, bug, or feature request please post an [issue](https://github.com/RaidMax/IW4M-Admin/issues)
|
||||||
|
|
||||||
|
|
||||||
#### Explore the [wiki](https://github.com/RaidMax/IW4M-Admin/wiki) to find more information.
|
#### Explore the [wiki](https://git.rimmyscorner.com/Parasyn/IW4M-Admin/wiki) to find more information.
|
||||||
|
@ -206,7 +206,7 @@ namespace SharedLibraryCore.Configuration
|
|||||||
: ManualWebfrontUrl;
|
: ManualWebfrontUrl;
|
||||||
|
|
||||||
[ConfigurationIgnore] public bool IgnoreServerConnectionLost { get; set; }
|
[ConfigurationIgnore] public bool IgnoreServerConnectionLost { get; set; }
|
||||||
[ConfigurationIgnore] public Uri MasterUrl { get; set; } = new("http://api.raidmax.org:5000");
|
[ConfigurationIgnore] public Uri MasterUrl { get; set; } = new("https://master.iw4.zip");
|
||||||
|
|
||||||
public IBaseConfiguration Generate()
|
public IBaseConfiguration Generate()
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,7 @@ namespace SharedLibraryCore.Configuration.Validation
|
|||||||
|
|
||||||
RuleFor(_app => _app.MasterUrl)
|
RuleFor(_app => _app.MasterUrl)
|
||||||
.NotNull()
|
.NotNull()
|
||||||
.Must(_url => _url != null && _url.Scheme == Uri.UriSchemeHttp);
|
.Must(_url => _url != null && (_url.Scheme == Uri.UriSchemeHttp || _url.Scheme == Uri.UriSchemeHttps));
|
||||||
|
|
||||||
RuleFor(_app => _app.CommandPrefix)
|
RuleFor(_app => _app.CommandPrefix)
|
||||||
.NotEmpty();
|
.NotEmpty();
|
||||||
@ -80,4 +80,4 @@ namespace SharedLibraryCore.Configuration.Validation
|
|||||||
.SetValidator(new ServerConfigurationValidator());
|
.SetValidator(new ServerConfigurationValidator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,8 @@ namespace SharedLibraryCore
|
|||||||
T7 = 8,
|
T7 = 8,
|
||||||
SHG1 = 9,
|
SHG1 = 9,
|
||||||
CSGO = 10,
|
CSGO = 10,
|
||||||
H1 = 11
|
H1 = 11,
|
||||||
|
L4D2 = 12
|
||||||
}
|
}
|
||||||
|
|
||||||
// only here for performance
|
// only here for performance
|
||||||
|
@ -50,8 +50,8 @@ namespace SharedLibraryCore
|
|||||||
public static char[] DirectorySeparatorChars = { '\\', '/' };
|
public static char[] DirectorySeparatorChars = { '\\', '/' };
|
||||||
public static char CommandPrefix { get; set; } = '!';
|
public static char CommandPrefix { get; set; } = '!';
|
||||||
|
|
||||||
public static string ToStandardFormat(this DateTime? time) => time?.ToString("yyyy-MM-dd H:mm:ss UTC");
|
public static string ToStandardFormat(this DateTime? time) => time?.ToString("yyyy-MM-dd HH:mm:ss UTC");
|
||||||
public static string ToStandardFormat(this DateTime time) => time.ToString("yyyy-MM-dd H:mm:ss UTC");
|
public static string ToStandardFormat(this DateTime time) => time.ToString("yyyy-MM-dd HH:mm:ss UTC");
|
||||||
|
|
||||||
public static EFClient IW4MAdminClient(Server server = null)
|
public static EFClient IW4MAdminClient(Server server = null)
|
||||||
{
|
{
|
||||||
|
@ -249,7 +249,8 @@ namespace WebfrontCore.Controllers
|
|||||||
{
|
{
|
||||||
ViewBag.Title = Localization["WEBFRONT_SEARCH_RESULTS_TITLE"];
|
ViewBag.Title = Localization["WEBFRONT_SEARCH_RESULTS_TITLE"];
|
||||||
ViewBag.ClientResourceRequest = request;
|
ViewBag.ClientResourceRequest = request;
|
||||||
|
|
||||||
|
request.RequesterPermission = Client.Level;
|
||||||
var response = await _clientResourceHelper.QueryResource(request);
|
var response = await _clientResourceHelper.QueryResource(request);
|
||||||
return request.Offset > 0
|
return request.Offset > 0
|
||||||
? PartialView("Find/_AdvancedFindList", response.Results)
|
? PartialView("Find/_AdvancedFindList", response.Results)
|
||||||
|
@ -137,29 +137,9 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("Message/FindNext")]
|
[HttpGet("Message/FindNext")]
|
||||||
public async Task<IActionResult> FindNextMessages([FromQuery] string query, [FromQuery] int count,
|
public async Task<IActionResult> FindNextMessages(ChatResourceRequest query)
|
||||||
[FromQuery] int offset)
|
|
||||||
{
|
{
|
||||||
ChatSearchQuery searchRequest;
|
var result = await _chatResourceQueryHelper.QueryResource(query);
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
searchRequest = query.ParseSearchInfo(count, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (ArgumentException e)
|
|
||||||
{
|
|
||||||
_logger.LogWarning(e, "Could not parse chat message search query {query}", query);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (FormatException e)
|
|
||||||
{
|
|
||||||
_logger.LogWarning(e, "Could not parse chat message search query filter format {query}", query);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = await _chatResourceQueryHelper.QueryResource(searchRequest);
|
|
||||||
return PartialView("~/Views/Client/Message/_Item.cshtml", result.Results);
|
return PartialView("~/Views/Client/Message/_Item.cshtml", result.Results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,9 @@ public class ClientResourceRequest : ClientPaginationRequest
|
|||||||
public EFClient.Permission? ClientLevel { get; set; }
|
public EFClient.Permission? ClientLevel { get; set; }
|
||||||
public Reference.Game? GameName { get; set; }
|
public Reference.Game? GameName { get; set; }
|
||||||
public bool IncludeGeolocationData { get; set; } = true;
|
public bool IncludeGeolocationData { get; set; } = true;
|
||||||
|
|
||||||
|
public EFClient.Permission RequesterPermission { get; set; } = EFClient.Permission.User;
|
||||||
|
|
||||||
public bool HasData => !string.IsNullOrEmpty(ClientName) || !string.IsNullOrEmpty(ClientIp) ||
|
public bool HasData => !string.IsNullOrEmpty(ClientName) || !string.IsNullOrEmpty(ClientIp) ||
|
||||||
!string.IsNullOrEmpty(ClientGuid) || ClientLevel is not null || GameName is not null;
|
!string.IsNullOrEmpty(ClientGuid) || ClientLevel is not null || GameName is not null;
|
||||||
}
|
}
|
||||||
|
@ -26,14 +26,14 @@ else
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="loaderLoad" class="mt-10 m-auto text-center d-none d-lg-block">
|
<div id="loaderLoad" class="mt-10 m-auto text-center">
|
||||||
<i class="loader-load-more oi oi-chevron-bottom"></i>
|
<i class="loader-load-more oi oi-chevron-bottom"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@section scripts {
|
@section scripts {
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
initLoader('/Message/FindNext?query=@ViewBag.Query', '#message_table_body', @Model.RetrievedResultCount, @ViewBag.QueryLimit);
|
initLoader(`/Message/FindNext${window.location.search}`, '#message_table_body', @Model.RetrievedResultCount, 30);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
@foreach (var server in manager!.GetServers())
|
@foreach (var server in manager!.GetServers())
|
||||||
{
|
{
|
||||||
<option value="@server.Id" selected="@(server.Id == existingChatFilter?.ServerId)">
|
<option value="@server.Id" selected="@(server.Id == existingChatFilter?.ServerId)">
|
||||||
[@server.GameName.ToString()] @server.ServerName
|
[@server.GameName.ToString()] @server.ServerName.StripColors()
|
||||||
</option>
|
</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@ -62,6 +62,7 @@
|
|||||||
value="@afterDate.ToString("s", CultureInfo.InvariantCulture)"/>
|
value="@afterDate.ToString("s", CultureInfo.InvariantCulture)"/>
|
||||||
<input type="time" class="form-control w-half ml-10" name="sentAfterTime"
|
<input type="time" class="form-control w-half ml-10" name="sentAfterTime"
|
||||||
id="sentAfterTime@(Model)"
|
id="sentAfterTime@(Model)"
|
||||||
|
style="color-scheme: dark;"
|
||||||
value="@afterDate.ToString("HH:mm")"/>
|
value="@afterDate.ToString("HH:mm")"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -78,6 +79,7 @@
|
|||||||
value="@beforeDate.ToString("s", CultureInfo.InvariantCulture)"/>
|
value="@beforeDate.ToString("s", CultureInfo.InvariantCulture)"/>
|
||||||
<input type="time" class="form-control w-half ml-10" name="sentBeforeTime"
|
<input type="time" class="form-control w-half ml-10" name="sentBeforeTime"
|
||||||
id="sentBeforeTime@(Model)"
|
id="sentBeforeTime@(Model)"
|
||||||
|
style="color-scheme: dark;"
|
||||||
value="@beforeDate.ToString("HH:mm")"/>
|
value="@beforeDate.ToString("HH:mm")"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,28 +1,4 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.form-inline').submit(function (e) {
|
|
||||||
const id = $(e.currentTarget).find('input');
|
|
||||||
if ($(id).val().length < 3) {
|
|
||||||
e.preventDefault();
|
|
||||||
$(id)
|
|
||||||
.addClass('input-text-danger')
|
|
||||||
.delay(25)
|
|
||||||
.queue(function () {
|
|
||||||
$(this).addClass('input-border-transition').dequeue();
|
|
||||||
})
|
|
||||||
.delay(1000)
|
|
||||||
.queue(function () {
|
|
||||||
$(this).removeClass('input-text-danger').dequeue();
|
|
||||||
})
|
|
||||||
.delay(500)
|
|
||||||
.queue(function () {
|
|
||||||
$(this).removeClass('input-border-transition').dequeue();
|
|
||||||
});
|
|
||||||
} else if ($(id).val().startsWith("chat|")) {
|
|
||||||
e.preventDefault();
|
|
||||||
window.location = "/Message/Find?query=" + $(id).val();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.date-picker-input').each((index, selector) => {
|
$('.date-picker-input').each((index, selector) => {
|
||||||
new Datepicker(selector, {
|
new Datepicker(selector, {
|
||||||
buttonClass: 'btn',
|
buttonClass: 'btn',
|
||||||
@ -33,7 +9,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const clientSearchWrapper = $('*[id^="clientSearchWrapper"]');
|
const clientSearchWrapper = $('*[id^="clientSearchWrapper"]');
|
||||||
const chatSearchWrapper = $('*[id^="chatSearchWrapper"]');
|
const chatSearchWrapper = $('*[id^="chatSearchWrapper"]');
|
||||||
const searchTypeSelector = $('#searchTypeSelectorParent select');
|
const searchTypeSelector = $('#searchTypeSelectorParent select');
|
||||||
|
BIN
assets/github/icon.png
Normal file
BIN
assets/github/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in New Issue
Block a user