From b63d2995ed04bc76948979f7dae03c005dc7630e Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 12 Apr 2020 20:48:03 -0500 Subject: [PATCH] allow auto log filepath generation for pluto iw5 --- Application/IW4MServer.cs | 9 ++++++--- Plugins/ScriptPlugins/ParserPIW5.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index 53ff9f12..50efd66b 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -937,6 +937,7 @@ namespace IW4MAdmin (await this.GetDvarAsync("g_gametype")).Value : infoResponse.Where(kvp => kvp.Key.Contains("gametype")).Select(kvp => kvp.Value).First(); var basepath = await this.GetDvarAsync("fs_basepath"); + var basegame = await this.GetDvarAsync("fs_basegame"); var game = infoResponse == null || !infoResponse.ContainsKey("fs_game") ? (await this.GetDvarAsync("fs_game")).Value : infoResponse["fs_game"]; @@ -944,7 +945,9 @@ namespace IW4MAdmin var logsync = await this.GetDvarAsync("g_logsync"); var ip = await this.GetDvarAsync("net_ip"); - WorkingDirectory = basepath.Value; + WorkingDirectory = Directory.Exists(basegame?.Value ?? "") ? + basegame.Value : + basepath.Value; try { @@ -1014,8 +1017,8 @@ namespace IW4MAdmin string mainPath = EventParser.Configuration.GameDirectory; LogPath = string.IsNullOrEmpty(game) ? - $"{basepath?.Value?.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{mainPath}{Path.DirectorySeparatorChar}{logfile?.Value}" : - $"{basepath?.Value?.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{game?.Replace('/', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{logfile?.Value}"; + $"{WorkingDirectory.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{mainPath}{Path.DirectorySeparatorChar}{logfile?.Value}" : + $"{WorkingDirectory.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{game?.Replace('/', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{logfile?.Value}"; // fix wine drive name mangling if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) diff --git a/Plugins/ScriptPlugins/ParserPIW5.js b/Plugins/ScriptPlugins/ParserPIW5.js index e0e19928..667a3b48 100644 --- a/Plugins/ScriptPlugins/ParserPIW5.js +++ b/Plugins/ScriptPlugins/ParserPIW5.js @@ -3,7 +3,7 @@ var eventParser; var plugin = { author: 'RaidMax', - version: 0.1, + version: 0.2, name: 'Plutonium IW5 Parser', isParser: true, @@ -25,7 +25,7 @@ var plugin = { rconParser.Configuration.Dvar.AddMapping(106, 2); rconParser.Configuration.Dvar.AddMapping(107, 3); rconParser.Configuration.WaitForResponse = false; - rconParser.Configuration.CanGenerateLogPath = false; + rconParser.Configuration.CanGenerateLogPath = true; rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +([0-9]+) +(?:[0-1]{1}) +([0-9]+) +([A-F0-9]+) +(.+?) +(?:[0-9]+) +(\\d+\\.\\d+\\.\\d+\\.\\d+\\:-?\\d{1,5}|0+\\.0+:-?\\d{1,5}|loopback) +(?:-?[0-9]+) +(?:[0-9]+) *$'; rconParser.Configuration.Status.AddMapping(100, 1);