From 0a1dc46760faa44aab4abca7d88213375482d00f Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sat, 2 Feb 2019 19:40:37 -0600 Subject: [PATCH] Add commenting for parsers rename IW4*Parser to Base*Parser --- .../{IW4EventParser.cs => BaseEventParser.cs} | 82 +++++++++---------- .../EventParsers/DynamicEventParser.cs | 6 +- .../DynamicEventParserConfiguration.cs | 6 +- Application/EventParsers/IW3EventParser.cs | 2 +- Application/EventParsers/T5MEventParser.cs | 2 +- Application/EventParsers/T6MEventParser.cs | 2 +- Application/IO/GameLogEventDetection.cs | 2 - Application/IW4MServer.cs | 8 +- .../{IW4RConParser.cs => BaseRConParser.cs} | 26 +++--- Application/RconParsers/DynamicRConParser.cs | 13 ++- .../DynamicRConParserConfiguration.cs | 6 +- Application/RconParsers/IW3RConParser.cs | 2 +- SharedLibraryCore/Helpers/ParserRegex.cs | 19 +++++ .../Interfaces/IEventParserConfiguration.cs | 21 +++++ SharedLibraryCore/Interfaces/IRConParser.cs | 36 ++++++++ .../Interfaces/IRConParserConfiguration.cs | 12 +++ 16 files changed, 171 insertions(+), 74 deletions(-) rename Application/EventParsers/{IW4EventParser.cs => BaseEventParser.cs} (75%) rename Application/RconParsers/{IW4RConParser.cs => BaseRConParser.cs} (87%) diff --git a/Application/EventParsers/IW4EventParser.cs b/Application/EventParsers/BaseEventParser.cs similarity index 75% rename from Application/EventParsers/IW4EventParser.cs rename to Application/EventParsers/BaseEventParser.cs index 685334b74..7d1982fac 100644 --- a/Application/EventParsers/IW4EventParser.cs +++ b/Application/EventParsers/BaseEventParser.cs @@ -7,9 +7,9 @@ using System.Text.RegularExpressions; namespace IW4MAdmin.Application.EventParsers { - class IW4EventParser : IEventParser + class BaseEventParser : IEventParser { - public IW4EventParser() + public BaseEventParser() { Configuration = new DynamicEventParserConfiguration() { @@ -17,53 +17,53 @@ namespace IW4MAdmin.Application.EventParsers }; Configuration.Say.Pattern = @"^(say|sayteam);(.{1,32});([0-9]+)(.*);(.*)$"; - Configuration.Say.GroupMapping.Add(ParserRegex.GroupType.EventType, 1); - Configuration.Say.GroupMapping.Add(ParserRegex.GroupType.OriginNetworkId, 2); - Configuration.Say.GroupMapping.Add(ParserRegex.GroupType.OriginClientNumber, 3); - Configuration.Say.GroupMapping.Add(ParserRegex.GroupType.OriginName, 4); - Configuration.Say.GroupMapping.Add(ParserRegex.GroupType.Message, 5); + Configuration.Say.AddMapping(ParserRegex.GroupType.EventType, 1); + Configuration.Say.AddMapping(ParserRegex.GroupType.OriginNetworkId, 2); + Configuration.Say.AddMapping(ParserRegex.GroupType.OriginClientNumber, 3); + Configuration.Say.AddMapping(ParserRegex.GroupType.OriginName, 4); + Configuration.Say.AddMapping(ParserRegex.GroupType.Message, 5); Configuration.Quit.Pattern = @"^(Q);(.{16,32}|bot[0-9]+);([0-9]+);(.*)$"; - Configuration.Quit.GroupMapping.Add(ParserRegex.GroupType.EventType, 1); - Configuration.Quit.GroupMapping.Add(ParserRegex.GroupType.OriginNetworkId, 2); - Configuration.Quit.GroupMapping.Add(ParserRegex.GroupType.OriginClientNumber, 3); - Configuration.Quit.GroupMapping.Add(ParserRegex.GroupType.OriginName, 4); + Configuration.Quit.AddMapping(ParserRegex.GroupType.EventType, 1); + Configuration.Quit.AddMapping(ParserRegex.GroupType.OriginNetworkId, 2); + Configuration.Quit.AddMapping(ParserRegex.GroupType.OriginClientNumber, 3); + Configuration.Quit.AddMapping(ParserRegex.GroupType.OriginName, 4); Configuration.Join.Pattern = @"^(J);(.{16,32}|bot[0-9]+);([0-9]+);(.*)$"; - Configuration.Join.GroupMapping.Add(ParserRegex.GroupType.EventType, 1); - Configuration.Join.GroupMapping.Add(ParserRegex.GroupType.OriginNetworkId, 2); - Configuration.Join.GroupMapping.Add(ParserRegex.GroupType.OriginClientNumber, 3); - Configuration.Join.GroupMapping.Add(ParserRegex.GroupType.OriginName, 4); + Configuration.Join.AddMapping(ParserRegex.GroupType.EventType, 1); + Configuration.Join.AddMapping(ParserRegex.GroupType.OriginNetworkId, 2); + Configuration.Join.AddMapping(ParserRegex.GroupType.OriginClientNumber, 3); + Configuration.Join.AddMapping(ParserRegex.GroupType.OriginName, 4); Configuration.Damage.Pattern = @"^(D);([A-Fa-f0-9_]{16,32}|bot[0-9]+);(-?[0-9]+);(axis|allies|world);(.{1,24});([A-Fa-f0-9_]{16,32}|bot[0-9]+)?;-?([0-9]+);(axis|allies|world);(.{1,24})?;((?:[0-9]+|[a-z]+|_)+);([0-9]+);((?:[A-Z]|_)+);((?:[a-z]|_)+)$"; - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.EventType, 1); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.TargetNetworkId, 2); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.TargetClientNumber, 3); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.TargetTeam, 4); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.TargetName, 5); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.OriginNetworkId, 6); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.OriginClientNumber, 7); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.OriginTeam, 8); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.OriginName, 9); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.Weapon, 10); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.Damage, 11); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.MeansOfDeath, 12); - Configuration.Damage.GroupMapping.Add(ParserRegex.GroupType.HitLocation, 13); + Configuration.Damage.AddMapping(ParserRegex.GroupType.EventType, 1); + Configuration.Damage.AddMapping(ParserRegex.GroupType.TargetNetworkId, 2); + Configuration.Damage.AddMapping(ParserRegex.GroupType.TargetClientNumber, 3); + Configuration.Damage.AddMapping(ParserRegex.GroupType.TargetTeam, 4); + Configuration.Damage.AddMapping(ParserRegex.GroupType.TargetName, 5); + Configuration.Damage.AddMapping(ParserRegex.GroupType.OriginNetworkId, 6); + Configuration.Damage.AddMapping(ParserRegex.GroupType.OriginClientNumber, 7); + Configuration.Damage.AddMapping(ParserRegex.GroupType.OriginTeam, 8); + Configuration.Damage.AddMapping(ParserRegex.GroupType.OriginName, 9); + Configuration.Damage.AddMapping(ParserRegex.GroupType.Weapon, 10); + Configuration.Damage.AddMapping(ParserRegex.GroupType.Damage, 11); + Configuration.Damage.AddMapping(ParserRegex.GroupType.MeansOfDeath, 12); + Configuration.Damage.AddMapping(ParserRegex.GroupType.HitLocation, 13); Configuration.Kill.Pattern = @"^(K);([A-Fa-f0-9_]{16,32}|bot[0-9]+);(-?[0-9]+);(axis|allies|world);(.{1,24});([A-Fa-f0-9_]{16,32}|bot[0-9]+)?;-?([0-9]+);(axis|allies|world);(.{1,24})?;((?:[0-9]+|[a-z]+|_)+);([0-9]+);((?:[A-Z]|_)+);((?:[a-z]|_)+)$"; - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.EventType, 1); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.TargetNetworkId, 2); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.TargetClientNumber, 3); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.TargetTeam, 4); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.TargetName, 5); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.OriginNetworkId, 6); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.OriginClientNumber, 7); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.OriginTeam, 8); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.OriginName, 9); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.Weapon, 10); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.Damage, 11); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.MeansOfDeath, 12); - Configuration.Kill.GroupMapping.Add(ParserRegex.GroupType.HitLocation, 13); + Configuration.Kill.AddMapping(ParserRegex.GroupType.EventType, 1); + Configuration.Kill.AddMapping(ParserRegex.GroupType.TargetNetworkId, 2); + Configuration.Kill.AddMapping(ParserRegex.GroupType.TargetClientNumber, 3); + Configuration.Kill.AddMapping(ParserRegex.GroupType.TargetTeam, 4); + Configuration.Kill.AddMapping(ParserRegex.GroupType.TargetName, 5); + Configuration.Kill.AddMapping(ParserRegex.GroupType.OriginNetworkId, 6); + Configuration.Kill.AddMapping(ParserRegex.GroupType.OriginClientNumber, 7); + Configuration.Kill.AddMapping(ParserRegex.GroupType.OriginTeam, 8); + Configuration.Kill.AddMapping(ParserRegex.GroupType.OriginName, 9); + Configuration.Kill.AddMapping(ParserRegex.GroupType.Weapon, 10); + Configuration.Kill.AddMapping(ParserRegex.GroupType.Damage, 11); + Configuration.Kill.AddMapping(ParserRegex.GroupType.MeansOfDeath, 12); + Configuration.Kill.AddMapping(ParserRegex.GroupType.HitLocation, 13); } public IEventParserConfiguration Configuration { get; set; } diff --git a/Application/EventParsers/DynamicEventParser.cs b/Application/EventParsers/DynamicEventParser.cs index 116b01532..97c9804cd 100644 --- a/Application/EventParsers/DynamicEventParser.cs +++ b/Application/EventParsers/DynamicEventParser.cs @@ -5,7 +5,11 @@ using static SharedLibraryCore.Server; namespace IW4MAdmin.Application.EventParsers { - sealed internal class DynamicEventParser : IW4EventParser + /// + /// empty generic implementation of the IEventParserConfiguration + /// allows script plugins to generate dynamic event parsers + /// + sealed internal class DynamicEventParser : BaseEventParser { } } diff --git a/Application/EventParsers/DynamicEventParserConfiguration.cs b/Application/EventParsers/DynamicEventParserConfiguration.cs index d4f5b61ef..479983ca7 100644 --- a/Application/EventParsers/DynamicEventParserConfiguration.cs +++ b/Application/EventParsers/DynamicEventParserConfiguration.cs @@ -2,7 +2,11 @@ namespace IW4MAdmin.Application.EventParsers { - class DynamicEventParserConfiguration : IEventParserConfiguration + /// + /// generic implementation of the IEventParserConfiguration + /// allows script plugins to generate dynamic configurations + /// + sealed internal class DynamicEventParserConfiguration : IEventParserConfiguration { public string GameDirectory { get; set; } public ParserRegex Say { get; set; } = new ParserRegex(); diff --git a/Application/EventParsers/IW3EventParser.cs b/Application/EventParsers/IW3EventParser.cs index b7cd6acd8..85643ed4c 100644 --- a/Application/EventParsers/IW3EventParser.cs +++ b/Application/EventParsers/IW3EventParser.cs @@ -4,7 +4,7 @@ using System.Text; namespace IW4MAdmin.Application.EventParsers { - class IW3EventParser : IW4EventParser + class IW3EventParser : BaseEventParser { public IW3EventParser() : base() { diff --git a/Application/EventParsers/T5MEventParser.cs b/Application/EventParsers/T5MEventParser.cs index b804db335..3a9d32e75 100644 --- a/Application/EventParsers/T5MEventParser.cs +++ b/Application/EventParsers/T5MEventParser.cs @@ -4,7 +4,7 @@ using System.Text; namespace IW4MAdmin.Application.EventParsers { - class T5MEventParser : IW4EventParser + class T5MEventParser : BaseEventParser { public T5MEventParser() : base() { diff --git a/Application/EventParsers/T6MEventParser.cs b/Application/EventParsers/T6MEventParser.cs index 761331ed4..d94581f49 100644 --- a/Application/EventParsers/T6MEventParser.cs +++ b/Application/EventParsers/T6MEventParser.cs @@ -2,7 +2,7 @@ namespace IW4MAdmin.Application.EventParsers { - class T6MEventParser : IW4EventParser + class T6MEventParser : BaseEventParser { public T6MEventParser() : base() { diff --git a/Application/IO/GameLogEventDetection.cs b/Application/IO/GameLogEventDetection.cs index 23376592e..c14587887 100644 --- a/Application/IO/GameLogEventDetection.cs +++ b/Application/IO/GameLogEventDetection.cs @@ -1,8 +1,6 @@ using SharedLibraryCore; using SharedLibraryCore.Interfaces; using System; -using System.Collections.Generic; -using System.IO; using System.Threading; using System.Threading.Tasks; diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index 82ac5a359..daa7b9bfe 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -671,8 +671,8 @@ namespace IW4MAdmin var eventParser = Manager.AdditionalEventParsers .FirstOrDefault(_parser => _parser.Version == Manager.GetApplicationSettings().Configuration().CustomParserVersion); - rconParser = rconParser ?? new IW4RConParser(); - eventParser = eventParser ?? new IW4EventParser(); + rconParser = rconParser ?? new BaseRConParser(); + eventParser = eventParser ?? new BaseEventParser(); RemoteConnection.SetConfiguration(rconParser.Configuration); @@ -685,8 +685,8 @@ namespace IW4MAdmin if (GameName == Game.IW4) { - EventParser = new IW4EventParser(); - RconParser = new IW4RConParser(); + EventParser = new BaseEventParser(); + RconParser = new BaseRConParser(); } else if (GameName == Game.T5M) diff --git a/Application/RconParsers/IW4RConParser.cs b/Application/RconParsers/BaseRConParser.cs similarity index 87% rename from Application/RconParsers/IW4RConParser.cs rename to Application/RconParsers/BaseRConParser.cs index 8ee8c91b5..75e6fa851 100644 --- a/Application/RconParsers/IW4RConParser.cs +++ b/Application/RconParsers/BaseRConParser.cs @@ -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; } diff --git a/Application/RconParsers/DynamicRConParser.cs b/Application/RconParsers/DynamicRConParser.cs index ec46f4cd2..f17d3884f 100644 --- a/Application/RconParsers/DynamicRConParser.cs +++ b/Application/RconParsers/DynamicRConParser.cs @@ -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 + /// + /// empty implementation of the IW4RConParser + /// allows script plugins to generate dynamic RCon parsers + /// + sealed internal class DynamicRConParser : BaseRConParser { } } diff --git a/Application/RconParsers/DynamicRConParserConfiguration.cs b/Application/RconParsers/DynamicRConParserConfiguration.cs index dae52b0fe..9db8f2cdf 100644 --- a/Application/RconParsers/DynamicRConParserConfiguration.cs +++ b/Application/RconParsers/DynamicRConParserConfiguration.cs @@ -4,7 +4,11 @@ using SharedLibraryCore.RCon; namespace IW4MAdmin.Application.RconParsers { - class DynamicRConParserConfiguration : IRConParserConfiguration + /// + /// generic implementation of the IRConParserConfiguration + /// allows script plugins to generate dynamic RCon configurations + /// + sealed internal class DynamicRConParserConfiguration : IRConParserConfiguration { public CommandPrefix CommandPrefixes { get; set; } public Server.Game GameName { get; set; } diff --git a/Application/RconParsers/IW3RConParser.cs b/Application/RconParsers/IW3RConParser.cs index 2fbac1713..d09374ff0 100644 --- a/Application/RconParsers/IW3RConParser.cs +++ b/Application/RconParsers/IW3RConParser.cs @@ -6,7 +6,7 @@ using System.Text; namespace IW4MAdmin.Application.RconParsers { - class IW3RConParser : IW4RConParser + class IW3RConParser : BaseRConParser { public IW3RConParser() : base() { diff --git a/SharedLibraryCore/Helpers/ParserRegex.cs b/SharedLibraryCore/Helpers/ParserRegex.cs index d1eca175c..0582aa204 100644 --- a/SharedLibraryCore/Helpers/ParserRegex.cs +++ b/SharedLibraryCore/Helpers/ParserRegex.cs @@ -6,6 +6,10 @@ namespace SharedLibraryCore.Interfaces { public sealed class ParserRegex { + /// + /// represents the logical mapping of information provided by + /// game logs, get status, and get dvar information + /// public enum GroupType { EventType, @@ -35,9 +39,24 @@ namespace SharedLibraryCore.Interfaces RConDvarDomain = 110, AdditionalGroup = 200 } + + /// + /// stores the regular expression groups that will be mapped to group types + /// public string Pattern { get; set; } + + /// + /// stores the mapping from group type to group index in the regular expression + /// public Dictionary GroupMapping { get; private set; } + /// + /// helper method to enable script parsers to app regex mapping + /// the first parameter specifies the group type contained in the regex pattern + /// the second parameter specifies the group index to retrieve in the matched regex pattern + /// + /// group type + /// group index public void AddMapping(object mapKey, object mapValue) { if (int.TryParse(mapKey.ToString(), out int key) && int.TryParse(mapValue.ToString(), out int value)) diff --git a/SharedLibraryCore/Interfaces/IEventParserConfiguration.cs b/SharedLibraryCore/Interfaces/IEventParserConfiguration.cs index ee99eac71..e2f976030 100644 --- a/SharedLibraryCore/Interfaces/IEventParserConfiguration.cs +++ b/SharedLibraryCore/Interfaces/IEventParserConfiguration.cs @@ -2,12 +2,33 @@ { public interface IEventParserConfiguration { + /// + /// stores the fs_game directory (this folder may vary between different clients) + /// string GameDirectory { get; set; } + /// + /// stores the regex information for a say event printed in the game log + /// ParserRegex Say { get; set; } + /// + /// stores the regex information for a join event printed in the game log + /// ParserRegex Join { get; set; } + /// + /// stores the regex information for a quit event printed in the game log + /// ParserRegex Quit { get; set; } + /// + /// stores the regex information for a kill event printed in the game log + /// ParserRegex Kill { get; set; } + /// + /// stores the regex information for a damage event printed in the game log + /// ParserRegex Damage { get; set; } + /// + /// stores the regex information for an action event printed in the game log + /// ParserRegex Action { get; set; } } } diff --git a/SharedLibraryCore/Interfaces/IRConParser.cs b/SharedLibraryCore/Interfaces/IRConParser.cs index ae513ca3b..4a982cc86 100644 --- a/SharedLibraryCore/Interfaces/IRConParser.cs +++ b/SharedLibraryCore/Interfaces/IRConParser.cs @@ -9,11 +9,47 @@ namespace SharedLibraryCore.Interfaces { public interface IRConParser { + /// + /// retrieves the value of a given DVAR + /// + /// type of DVAR expected (string, int, float etc...) + /// RCon connection to retrieve with + /// name of DVAR + /// Task> GetDvarAsync(Connection connection, string dvarName); + + /// + /// set value of DVAR by name + /// + /// RCon connection to use + /// name of DVAR to set + /// value to set DVAR to + /// Task SetDvarAsync(Connection connection, string dvarName, object dvarValue); + + /// + /// executes a console command on the server + /// + /// RCon connection to use + /// console command to execute + /// Task ExecuteCommandAsync(Connection connection, string command); + + /// + /// get the list of connected clients from status response + /// + /// RCon connection to use + /// Task> GetStatusAsync(Connection connection); + + /// + /// stores the RCon configuration + /// IRConParserConfiguration Configuration { get; set; } + + /// + /// stores the game/client specific version (usually the value of the "version" DVAR) + /// string Version { get; set; } } } diff --git a/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs b/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs index 18d412443..ec1a1b07f 100644 --- a/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs +++ b/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs @@ -4,9 +4,21 @@ namespace SharedLibraryCore.Interfaces { public interface IRConParserConfiguration { + /// + /// stores the command format for console commands + /// CommandPrefix CommandPrefixes { get; set; } + /// + /// optionally stores the game name type + /// Server.Game GameName { get; set; } + /// + /// stores the regex info for parsing get status response + /// ParserRegex Status { get; set; } + /// + /// stores the regex info for parsing get DVAR responses + /// ParserRegex Dvar { get; set; } } }