allow auto log filepath generation for pluto iw5

This commit is contained in:
RaidMax 2020-04-12 20:48:03 -05:00
parent 8fb2394130
commit b63d2995ed
2 changed files with 8 additions and 5 deletions

View File

@ -937,6 +937,7 @@ namespace IW4MAdmin
(await this.GetDvarAsync<string>("g_gametype")).Value :
infoResponse.Where(kvp => kvp.Key.Contains("gametype")).Select(kvp => kvp.Value).First();
var basepath = await this.GetDvarAsync<string>("fs_basepath");
var basegame = await this.GetDvarAsync<string>("fs_basegame");
var game = infoResponse == null || !infoResponse.ContainsKey("fs_game") ?
(await this.GetDvarAsync<string>("fs_game")).Value :
infoResponse["fs_game"];
@ -944,7 +945,9 @@ namespace IW4MAdmin
var logsync = await this.GetDvarAsync<int>("g_logsync");
var ip = await this.GetDvarAsync<string>("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))

View File

@ -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);