From 775c0a91b55f4a730415a1529c584b39e580303b Mon Sep 17 00:00:00 2001 From: RaidMax Date: Tue, 21 Jun 2022 16:33:11 -0500 Subject: [PATCH] small parser changes --- Application/RConParsers/BaseRConParser.cs | 2 +- Plugins/ScriptPlugins/ParserIW6x.js | 2 +- Plugins/ScriptPlugins/ParserS1x.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Application/RConParsers/BaseRConParser.cs b/Application/RConParsers/BaseRConParser.cs index b758b8706..33a528d48 100644 --- a/Application/RConParsers/BaseRConParser.cs +++ b/Application/RConParsers/BaseRConParser.cs @@ -105,7 +105,7 @@ namespace IW4MAdmin.Application.RConParsers lineSplit = Array.Empty(); } - var response = string.Join('\n', lineSplit).TrimEnd('\0'); + var response = string.Join('\n', lineSplit).Replace("\n", "").TrimEnd('\0'); var match = Regex.Match(response, Configuration.Dvar.Pattern); if (response.Contains("Unknown command") || diff --git a/Plugins/ScriptPlugins/ParserIW6x.js b/Plugins/ScriptPlugins/ParserIW6x.js index dd177ee37..d2a98469b 100644 --- a/Plugins/ScriptPlugins/ParserIW6x.js +++ b/Plugins/ScriptPlugins/ParserIW6x.js @@ -20,7 +20,7 @@ var plugin = { rconParser.Configuration.CommandPrefixes.Ban = 'clientkick {0} "{1}"'; rconParser.Configuration.CommandPrefixes.TempBan = 'clientkick {0} "{1}"'; rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint\n'; - rconParser.Configuration.Dvar.Pattern = '^ *\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"\\n(?:latched: \\"(.+)?\\"\\n)? *(.+)$'; + rconParser.Configuration.Dvar.Pattern = '^ *\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"\\n?(?:latched: \\"(.+)?\\"\\n?)? *(.+)$'; rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +-?([0-9]+) +(Yes|No) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){8,32}|(?:[a-z]|[0-9]){8,32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +(\\d+\\.\\d+\\.\\d+.\\d+\\:-*\\d{1,5}|0+.0+:-*\\d{1,5}|loopback|unknown|bot) +(-*[0-9]+) *$'; rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +address +qport *'; rconParser.Configuration.WaitForResponse = false; diff --git a/Plugins/ScriptPlugins/ParserS1x.js b/Plugins/ScriptPlugins/ParserS1x.js index 137b567b2..bb56df7c5 100644 --- a/Plugins/ScriptPlugins/ParserS1x.js +++ b/Plugins/ScriptPlugins/ParserS1x.js @@ -17,7 +17,7 @@ var plugin = { rconParser.Configuration.CommandPrefixes.Ban = 'kickClient {0} "{1}"'; rconParser.Configuration.CommandPrefixes.TempBan = 'kickClient {0} "{1}"'; rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint'; - rconParser.Configuration.Dvar.Pattern = '^ *\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"\\n(?:latched: \\"(.+)?\\"\\n)? *(.+)$'; + rconParser.Configuration.Dvar.Pattern = '^ *\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"\\n?(?:latched: \\"(.+)?\\"\\n?)? *(.+)$'; rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +-?([0-9]+) +(Yes|No) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){8,32}|(?:[a-z]|[0-9]){8,32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +(\\d+\\.\\d+\\.\\d+.\\d+\\:-*\\d{1,5}|0+.0+:-*\\d{1,5}|loopback|unknown|bot) +(-*[0-9]+) *$'; rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +address +qport *'; rconParser.Configuration.Status.AddMapping(102, 4); @@ -37,4 +37,4 @@ var plugin = { onUnloadAsync: function() {}, onTickAsync: function(server) {} -}; \ No newline at end of file +};