1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

Add commenting for parsers

rename IW4*Parser to Base*Parser
This commit is contained in:
RaidMax
2019-02-02 19:40:37 -06:00
parent 5e7aefb35f
commit 0860ce6f62
16 changed files with 171 additions and 74 deletions

View File

@ -11,9 +11,9 @@ using System.Threading.Tasks;
namespace IW4MAdmin.Application.RconParsers
{
class IW4RConParser : IRConParser
class BaseRConParser : IRConParser
{
public IW4RConParser()
public BaseRConParser()
{
Configuration = new DynamicRConParserConfiguration()
{
@ -33,19 +33,19 @@ namespace IW4MAdmin.Application.RconParsers
};
Configuration.Status.Pattern = @"^ *([0-9]+) +-?([0-9]+) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){16}|(?:[a-z]|[0-9]){32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +([0-9]+) +(\d+\.\d+\.\d+.\d+\:-*\d{1,5}|0+.0+:-*\d{1,5}|loopback) +(-*[0-9]+) +([0-9]+) *$";
Configuration.Status.GroupMapping.Add(ParserRegex.GroupType.RConClientNumber, 1);
Configuration.Status.GroupMapping.Add(ParserRegex.GroupType.RConScore, 2);
Configuration.Status.GroupMapping.Add(ParserRegex.GroupType.RConPing, 3);
Configuration.Status.GroupMapping.Add(ParserRegex.GroupType.RConNetworkId, 4);
Configuration.Status.GroupMapping.Add(ParserRegex.GroupType.RConName, 5);
Configuration.Status.GroupMapping.Add(ParserRegex.GroupType.RConIpAddress, 7);
Configuration.Status.AddMapping(ParserRegex.GroupType.RConClientNumber, 1);
Configuration.Status.AddMapping(ParserRegex.GroupType.RConScore, 2);
Configuration.Status.AddMapping(ParserRegex.GroupType.RConPing, 3);
Configuration.Status.AddMapping(ParserRegex.GroupType.RConNetworkId, 4);
Configuration.Status.AddMapping(ParserRegex.GroupType.RConName, 5);
Configuration.Status.AddMapping(ParserRegex.GroupType.RConIpAddress, 7);
Configuration.Dvar.Pattern = "^\"(.+)\" is: \"(.+)\" default: \"(.+)\"\n(?:latched: \"(.+)\"\n)? *(.+)$";
Configuration.Dvar.GroupMapping.Add(ParserRegex.GroupType.RConDvarName, 1);
Configuration.Dvar.GroupMapping.Add(ParserRegex.GroupType.RConDvarValue, 2);
Configuration.Dvar.GroupMapping.Add(ParserRegex.GroupType.RConDvarDefaultValue, 3);
Configuration.Dvar.GroupMapping.Add(ParserRegex.GroupType.RConDvarLatchedValue, 4);
Configuration.Dvar.GroupMapping.Add(ParserRegex.GroupType.RConDvarDomain, 5);
Configuration.Dvar.AddMapping(ParserRegex.GroupType.RConDvarName, 1);
Configuration.Dvar.AddMapping(ParserRegex.GroupType.RConDvarValue, 2);
Configuration.Dvar.AddMapping(ParserRegex.GroupType.RConDvarDefaultValue, 3);
Configuration.Dvar.AddMapping(ParserRegex.GroupType.RConDvarLatchedValue, 4);
Configuration.Dvar.AddMapping(ParserRegex.GroupType.RConDvarDomain, 5);
}
public IRConParserConfiguration Configuration { get; set; }

View File

@ -1,11 +1,10 @@
using SharedLibraryCore;
using SharedLibraryCore.RCon;
using System;
using static SharedLibraryCore.Server;
namespace IW4MAdmin.Application.RconParsers
namespace IW4MAdmin.Application.RconParsers
{
sealed internal class DynamicRConParser : IW4RConParser
/// <summary>
/// empty implementation of the IW4RConParser
/// allows script plugins to generate dynamic RCon parsers
/// </summary>
sealed internal class DynamicRConParser : BaseRConParser
{
}
}

View File

@ -4,7 +4,11 @@ using SharedLibraryCore.RCon;
namespace IW4MAdmin.Application.RconParsers
{
class DynamicRConParserConfiguration : IRConParserConfiguration
/// <summary>
/// generic implementation of the IRConParserConfiguration
/// allows script plugins to generate dynamic RCon configurations
/// </summary>
sealed internal class DynamicRConParserConfiguration : IRConParserConfiguration
{
public CommandPrefix CommandPrefixes { get; set; }
public Server.Game GameName { get; set; }

View File

@ -6,7 +6,7 @@ using System.Text;
namespace IW4MAdmin.Application.RconParsers
{
class IW3RConParser : IW4RConParser
class IW3RConParser : BaseRConParser
{
public IW3RConParser() : base()
{