diff --git a/Application/ApplicationManager.cs b/Application/ApplicationManager.cs index f0a83c77c..a87844f77 100644 --- a/Application/ApplicationManager.cs +++ b/Application/ApplicationManager.cs @@ -431,6 +431,7 @@ await scriptPlugin.Initialize(this, _scriptCommandFactory, _scriptPluginServiceR foreach (var serverConfig in _appConfig.Servers) { ConfigurationMigration.ModifyLogPath020919(serverConfig); + ConfigurationMigration.UpdatePlutoniumT6Parser(serverConfig); if (serverConfig.RConParserVersion == null || serverConfig.EventParserVersion == null) { @@ -447,6 +448,8 @@ await scriptPlugin.Initialize(this, _scriptCommandFactory, _scriptPluginServiceR serverConfig.ModifyParsers(); } } + + ConfigHandler.Set(_appConfig); await ConfigHandler.Save(); } diff --git a/Application/Migration/ConfigurationMigration.cs b/Application/Migration/ConfigurationMigration.cs index 6a358b9d2..3b6018428 100644 --- a/Application/Migration/ConfigurationMigration.cs +++ b/Application/Migration/ConfigurationMigration.cs @@ -86,6 +86,22 @@ public static void ModifyLogPath020919(SharedLibraryCore.Configuration.ServerCon } } + public static void UpdatePlutoniumT6Parser(SharedLibraryCore.Configuration.ServerConfiguration config) + { + if (config.RConParserVersion != "Plutonium T6 Parser") + { + return; + } + + if (!"Plutonium T6 parser requires an update. Would you like to automatically update now".PromptBool()) + { + return; + } + + config.RConParserVersion = "Plutonium T6 Parser (2024)"; + config.EventParserVersion = "Plutonium T6 Parser (2024)"; + } + public static void RemoveObsoletePlugins20210322() { var files = new[] {"StatsWeb.dll", "StatsWeb.Views.dll", "IW4ScriptCommands.dll"}; diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index 552134990..ec2209b5f 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -33,7 +33,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScriptPlugins", "ScriptPlug Plugins\ScriptPlugins\ParserIW4x.js = Plugins\ScriptPlugins\ParserIW4x.js Plugins\ScriptPlugins\ParserIW6x.js = Plugins\ScriptPlugins\ParserIW6x.js Plugins\ScriptPlugins\ParserPIW5.js = Plugins\ScriptPlugins\ParserPIW5.js - Plugins\ScriptPlugins\ParserPT6.js = Plugins\ScriptPlugins\ParserPT6.js Plugins\ScriptPlugins\ParserRektT5M.js = Plugins\ScriptPlugins\ParserRektT5M.js Plugins\ScriptPlugins\ParserT4.js = Plugins\ScriptPlugins\ParserT4.js Plugins\ScriptPlugins\ParserT7.js = Plugins\ScriptPlugins\ParserT7.js diff --git a/Plugins/ScriptPlugins/ParserPT6.js b/Plugins/ScriptPlugins/ParserPlutoniumT6.js similarity index 50% rename from Plugins/ScriptPlugins/ParserPT6.js rename to Plugins/ScriptPlugins/ParserPlutoniumT6.js index ff480a483..42e08eb2e 100644 --- a/Plugins/ScriptPlugins/ParserPT6.js +++ b/Plugins/ScriptPlugins/ParserPlutoniumT6.js @@ -2,9 +2,9 @@ var rconParser; var eventParser; var plugin = { - author: 'RaidMax, Xerxes', - version: 1.4, - name: 'Plutonium T6 Parser', + author: 'RaidMax, Xerxes, INSANEMODE', + version: 1.0, + name: 'Plutonium T6 Parser (2024)', isParser: true, onEventAsync: function (gameEvent, server) { @@ -14,25 +14,34 @@ var plugin = { rconParser = manager.GenerateDynamicRConParser(this.name); eventParser = manager.GenerateDynamicEventParser(this.name); - rconParser.Configuration.CommandPrefixes.Tell = 'tell {0} {1}'; - rconParser.Configuration.CommandPrefixes.Say = 'say {0}'; - rconParser.Configuration.CommandPrefixes.Kick = 'clientkick_for_reason {0} "{1}"'; - rconParser.Configuration.CommandPrefixes.Ban = 'clientkick_for_reason {0} "{1}"'; - rconParser.Configuration.CommandPrefixes.TempBan = 'clientkick_for_reason {0} "{1}"'; - rconParser.Configuration.CommandPrefixes.RConGetDvar = '\xff\xff\xff\xffrcon {0} get {1}'; - rconParser.Configuration.CommandPrefixes.RConGetInfo = undefined; // adding this in here temporarily until getInfo is fixed in new T6 version + rconParser.Configuration.CommandPrefixes.Tell = 'tell {0} {1}'; + rconParser.Configuration.CommandPrefixes.Say = 'say {0}'; + rconParser.Configuration.CommandPrefixes.Kick = 'clientkick_for_reason {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.Ban = 'clientkick_for_reason {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.TempBan = 'clientkick_for_reason {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.Mute = 'muteClient {0}'; + rconParser.Configuration.CommandPrefixes.Unmute = 'unmuteClient {0}'; + rconParser.Configuration.CommandPrefixes.RConGetDvar = '\xff\xff\xff\xffrcon {0} {1}'; + rconParser.Configuration.CommandPrefixes.RConSetDvar = '\xff\xff\xff\xffrcon {0} set {1}'; + rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint\n'; + rconParser.Configuration.CommandPrefixes.RConGetStatus = '\xff\xff\xff\xffgetstatus'; + rconParser.Configuration.CommandPrefixes.RConGetInfo = '\xff\xff\xff\xffgetinfo'; + rconParser.Configuration.CommandPrefixes.RconGetInfoResponseHeader = '\xff\xff\xff\xffinfoResponse\n'; + rconParser.Configuration.CommandPrefixes.RConCommand = '\xff\xff\xff\xffrcon {0} {1}'; - rconParser.Configuration.Dvar.Pattern = '^(.+) is "(.+)?"$'; + + rconParser.Configuration.Dvar.Pattern = '^(?:\\^7)?\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"\\n?(?:latched: \\"(.+)?\\"\\n)?\\w*(.+)*$'; rconParser.Configuration.Dvar.AddMapping(106, 1); rconParser.Configuration.Dvar.AddMapping(107, 2); - rconParser.Configuration.WaitForResponse = false; + rconParser.Configuration.WaitForResponse = false rconParser.Configuration.NoticeLineSeparator = '. '; rconParser.Configuration.DefaultRConPort = 4976; rconParser.Configuration.DefaultInstallationDirectoryHint = '{LocalAppData}/Plutonium/storage/t6'; rconParser.Configuration.ShouldRemoveDiacritics = true; + rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +lastmsg +address +qport +rate *'; - rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +([0-9]+) +(?:[0-1]{1}) +([0-9]+) +([A-F0-9]+|0) +(.+?) +(?:[0-9]+) +(\\d+\\.\\d+\\.\\d+\\.\\d+\\:-?\\d{1,5}|0+\\.0+:-?\\d{1,5}|loopback|unknown) +(?:-?[0-9]+) +(?:[0-9]+) *$'; + rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +([0-9]+) +(?:[0-1]{1}) +([0-9]+) +([A-F0-9]+|0) +(.+?) +(?:[0-9]+) +(\\d+\\.\\d+\\.\\d+\\.\\d+\\:-?\\d{1,5}|0+\\.0+:-?\\d{1,5}|loopback|unknown|bot) +(?:-?[0-9]+) +(?:[0-9]+) *$'; rconParser.Configuration.Status.AddMapping(100, 1); rconParser.Configuration.Status.AddMapping(101, 2); rconParser.Configuration.Status.AddMapping(102, 3); @@ -54,8 +63,20 @@ var plugin = { rconParser.Configuration.ColorCodeMapping.Add('Grey', '^9'); rconParser.Configuration.ColorCodeMapping.Add('LightBlue', '^;'); rconParser.Configuration.ColorCodeMapping.Add('LightYellow', '^:'); - - eventParser.Configuration.GameDirectory = ''; + rconParser.Configuration.ColorCodeMapping.Add('Flash', '^F'); + rconParser.Configuration.ColorCodeMapping.Add('MWDOWN', '^BmouseWheelDown^'); + rconParser.Configuration.ColorCodeMapping.Add('MWUP', '^BmouseWheelUp^'); + rconParser.Configuration.ColorCodeMapping.Add('MBMiddle', '^BmouseButtonMiddle^'); + rconParser.Configuration.ColorCodeMapping.Add('MBRight', '^BmouseButtonRight^'); + rconParser.Configuration.ColorCodeMapping.Add('MBLeft', '^BmouseButtonLeft^'); + rconParser.Configuration.ColorCodeMapping.Add('MADown', '^BMOUSE_ANIM_DOWN^'); + rconParser.Configuration.ColorCodeMapping.Add('MAUp', '^BMOUSE_ANIM_UP^'); + rconParser.Configuration.ColorCodeMapping.Add('MARight', '^BMOUSE_ANIM_RIGHT^'); + rconParser.Configuration.ColorCodeMapping.Add('MALeft', '^BMOUSE_ANIM_LEFT^'); + + rconParser.Configuration.FloodProtectInterval = 150; + + eventParser.Configuration.GameDirectory = 'main'; eventParser.Configuration.GuidNumberStyle = 7; // Integer rconParser.Version = 'Call of Duty Multiplayer - Ship COD_T6_S MP build 1.0.44 CL(1759941) CODPCAB2 CEG Fri May 9 19:19:19 2014 win-x86 813e66d5';