diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index deee085d0..4d826b0ca 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -1015,7 +1015,7 @@ namespace IW4MAdmin var version = await this.GetMappedDvarValueOrDefaultAsync("version"); Version = version.Value; - GameName = Utilities.GetGame(version?.Value ?? RconParser.Version); + GameName = Utilities.GetGame(version.Value ?? RconParser.Version); if (GameName == Game.UKN) { diff --git a/Data/Models/Reference.cs b/Data/Models/Reference.cs index 6322d6df0..3c8757880 100644 --- a/Data/Models/Reference.cs +++ b/Data/Models/Reference.cs @@ -13,7 +13,8 @@ T4 = 5, T5 = 6, T6 = 7, - T7 = 8 + T7 = 8, + SHG1 = 9 } } } \ No newline at end of file diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index e8a9d1c13..92fd906e6 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -45,6 +45,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScriptPlugins", "ScriptPlug Plugins\ScriptPlugins\SampleScriptPluginCommand.js = Plugins\ScriptPlugins\SampleScriptPluginCommand.js Plugins\ScriptPlugins\SharedGUIDKick.js = Plugins\ScriptPlugins\SharedGUIDKick.js Plugins\ScriptPlugins\VPNDetection.js = Plugins\ScriptPlugins\VPNDetection.js + Plugins\ScriptPlugins\ParserPlutoniumT4.js = Plugins\ScriptPlugins\ParserPlutoniumT4.js + Plugins\ScriptPlugins\ParserS1x.js = Plugins\ScriptPlugins\ParserS1x.js EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}" diff --git a/Plugins/ScriptPlugins/ParserS1x.js b/Plugins/ScriptPlugins/ParserS1x.js new file mode 100644 index 000000000..340d404a9 --- /dev/null +++ b/Plugins/ScriptPlugins/ParserS1x.js @@ -0,0 +1,39 @@ +var rconParser; +var eventParser; + +var plugin = { + author: 'Diavolo, RaidMax', + version: 0.1, + name: 'S1x Parser', + isParser: true, + + onEventAsync: function(gameEvent, server) {}, + + onLoadAsync: function(manager) { + rconParser = manager.GenerateDynamicRConParser(this.name); + eventParser = manager.GenerateDynamicEventParser(this.name); + + rconParser.Configuration.CommandPrefixes.Kick = 'kickClient {0} "{1}"'; + 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.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); + rconParser.Configuration.Status.AddMapping(103, 5); + rconParser.Configuration.Status.AddMapping(104, 6); + rconParser.Configuration.WaitForResponse = false; + + eventParser.Configuration.GameDirectory = ''; + + rconParser.Version = 'S1 MP 1.22 build 2195988 Wed Apr 18 11:26:14 2018 win64'; + rconParser.GameName = 9; // SHG1 + eventParser.Version = 'S1 MP 1.22 build 2195988 Wed Apr 18 11:26:14 2018 win64'; + eventParser.GameName = 9; // SHG1 + }, + + onUnloadAsync: function() {}, + + onTickAsync: function(server) {} +}; \ No newline at end of file diff --git a/SharedLibraryCore/Commands/CommandProcessing.cs b/SharedLibraryCore/Commands/CommandProcessing.cs index 0e021162e..5913be7ed 100644 --- a/SharedLibraryCore/Commands/CommandProcessing.cs +++ b/SharedLibraryCore/Commands/CommandProcessing.cs @@ -22,7 +22,8 @@ namespace SharedLibraryCore.Commands E.Message = E.Data; Command C = null; - foreach (Command cmd in Manager.GetCommands()) + foreach (Command cmd in Manager.GetCommands() + .Where(c => c.Name != null)) { if (cmd.Name.Equals(CommandString, StringComparison.OrdinalIgnoreCase) || (cmd.Alias ?? "").Equals(CommandString, StringComparison.OrdinalIgnoreCase)) diff --git a/SharedLibraryCore/Server.cs b/SharedLibraryCore/Server.cs index 9622be951..9a500aef3 100644 --- a/SharedLibraryCore/Server.cs +++ b/SharedLibraryCore/Server.cs @@ -28,7 +28,8 @@ namespace SharedLibraryCore T4 = 5, T5 = 6, T6 = 7, - T7 = 8 + T7 = 8, + SHG1 = 9 } public Server(ILogger logger, SharedLibraryCore.Interfaces.ILogger deprecatedLogger,