Skip to content

Commit

Permalink
Update Pluto T6 parser
Browse files Browse the repository at this point in the history
  • Loading branch information
RaidMax committed Nov 27, 2024
1 parent ef0534c commit 807ea9b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Application/ApplicationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -447,6 +448,8 @@ await scriptPlugin.Initialize(this, _scriptCommandFactory, _scriptPluginServiceR
serverConfig.ModifyParsers();
}
}

ConfigHandler.Set(_appConfig);
await ConfigHandler.Save();
}

Expand Down
16 changes: 16 additions & 0 deletions Application/Migration/ConfigurationMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"};
Expand Down
1 change: 0 additions & 1 deletion IW4MAdmin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -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';
Expand Down

0 comments on commit 807ea9b

Please sign in to comment.