diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index a345654db..0990ae284 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -1114,8 +1114,9 @@ namespace IW4MAdmin string mapname = (await this.GetMappedDvarValueOrDefaultAsync("mapname", infoResponse: infoResponse)).Value; int maxplayers = (await this.GetMappedDvarValueOrDefaultAsync("sv_maxclients", infoResponse: infoResponse)).Value; string gametype = (await this.GetMappedDvarValueOrDefaultAsync("g_gametype", "gametype", infoResponse)).Value; - var basepath = (await this.GetMappedDvarValueOrDefaultAsync("fs_basepath")); - var basegame = (await this.GetMappedDvarValueOrDefaultAsync("fs_basegame")); + var basepath = await this.GetMappedDvarValueOrDefaultAsync("fs_basepath"); + var basegame = await this.GetMappedDvarValueOrDefaultAsync("fs_basegame"); + var homepath = await this.GetMappedDvarValueOrDefaultAsync("fs_homepath"); var game = (await this.GetMappedDvarValueOrDefaultAsync("fs_game", infoResponse: infoResponse)); var logfile = await this.GetMappedDvarValueOrDefaultAsync("g_log"); var logsync = await this.GetMappedDvarValueOrDefaultAsync("g_logsync"); @@ -1216,6 +1217,7 @@ namespace IW4MAdmin { BaseGameDirectory = basegame.Value, BasePathDirectory = basepath.Value, + HomePathDirectory = homepath.Value, GameDirectory = EventParser.Configuration.GameDirectory ?? "", ModDirectory = game.Value ?? "", LogFile = logfile.Value, @@ -1266,15 +1268,25 @@ namespace IW4MAdmin { string logPath; var workingDirectory = logInfo.BasePathDirectory; + + bool IsValidGamePath (string path) + { + var baseGameIsDirectory = !string.IsNullOrWhiteSpace(path) && + path.IndexOfAny(Utilities.DirectorySeparatorChars) != -1; - var baseGameIsDirectory = !string.IsNullOrWhiteSpace(logInfo.BaseGameDirectory) && - logInfo.BaseGameDirectory.IndexOfAny(Utilities.DirectorySeparatorChars) != -1; + var baseGameIsRelative = path.FixDirectoryCharacters() + .Equals(logInfo.GameDirectory.FixDirectoryCharacters(), StringComparison.InvariantCultureIgnoreCase); - var baseGameIsRelative = logInfo.BaseGameDirectory.FixDirectoryCharacters() - .Equals(logInfo.GameDirectory.FixDirectoryCharacters(), StringComparison.InvariantCultureIgnoreCase); + return baseGameIsDirectory && !baseGameIsRelative; + } // we want to see if base game is provided and it 'looks' like a directory - if (baseGameIsDirectory && !baseGameIsRelative) + if (IsValidGamePath(logInfo.HomePathDirectory)) + { + workingDirectory = logInfo.HomePathDirectory; + } + + else if (IsValidGamePath(logInfo.BaseGameDirectory)) { workingDirectory = logInfo.BaseGameDirectory; } diff --git a/Application/Misc/LogPathGeneratorInfo.cs b/Application/Misc/LogPathGeneratorInfo.cs index 6b3539b09..ae77e18a6 100644 --- a/Application/Misc/LogPathGeneratorInfo.cs +++ b/Application/Misc/LogPathGeneratorInfo.cs @@ -19,6 +19,12 @@ namespace IW4MAdmin.Application.Misc /// public string BasePathDirectory { get; set; } = ""; + /// + /// directory for local storage + /// fs_homepath + /// + public string HomePathDirectory { get; set; } = ""; + /// /// overide game directory /// plugin driven diff --git a/Plugins/AutomessageFeed/AutomessageFeed.csproj b/Plugins/AutomessageFeed/AutomessageFeed.csproj index 95ce11f6a..d9b11b9ea 100644 --- a/Plugins/AutomessageFeed/AutomessageFeed.csproj +++ b/Plugins/AutomessageFeed/AutomessageFeed.csproj @@ -10,7 +10,7 @@ - + diff --git a/Plugins/IW4ScriptCommands/IW4ScriptCommands.csproj b/Plugins/IW4ScriptCommands/IW4ScriptCommands.csproj index 840f628f4..23a4cfaf3 100644 --- a/Plugins/IW4ScriptCommands/IW4ScriptCommands.csproj +++ b/Plugins/IW4ScriptCommands/IW4ScriptCommands.csproj @@ -10,7 +10,7 @@ - + diff --git a/Plugins/LiveRadar/LiveRadar.csproj b/Plugins/LiveRadar/LiveRadar.csproj index 1add21e01..64d2e9255 100644 --- a/Plugins/LiveRadar/LiveRadar.csproj +++ b/Plugins/LiveRadar/LiveRadar.csproj @@ -23,7 +23,7 @@ - + diff --git a/Plugins/Login/Login.csproj b/Plugins/Login/Login.csproj index e27130efe..ea0399210 100644 --- a/Plugins/Login/Login.csproj +++ b/Plugins/Login/Login.csproj @@ -19,7 +19,7 @@ - + diff --git a/Plugins/ProfanityDeterment/ProfanityDeterment.csproj b/Plugins/ProfanityDeterment/ProfanityDeterment.csproj index 3ea14c95d..1695465c9 100644 --- a/Plugins/ProfanityDeterment/ProfanityDeterment.csproj +++ b/Plugins/ProfanityDeterment/ProfanityDeterment.csproj @@ -16,7 +16,7 @@ - + diff --git a/Plugins/ScriptPlugins/ParserCSGO.js b/Plugins/ScriptPlugins/ParserCSGO.js index f365f6ea8..4c0e4a5f6 100644 --- a/Plugins/ScriptPlugins/ParserCSGO.js +++ b/Plugins/ScriptPlugins/ParserCSGO.js @@ -46,6 +46,7 @@ const plugin = { rconParser.Configuration.DefaultDvarValues.Add('version', this.engine); rconParser.Configuration.DefaultDvarValues.Add('fs_basepath', ''); rconParser.Configuration.DefaultDvarValues.Add('fs_basegame', ''); + rconParser.Configuration.DefaultDvarValues.Add('fs_homepath', ''); rconParser.Configuration.DefaultDvarValues.Add('g_log', ''); rconParser.Configuration.DefaultDvarValues.Add('net_ip', 'localhost'); diff --git a/Plugins/ScriptPlugins/ParserCSGOSM.js b/Plugins/ScriptPlugins/ParserCSGOSM.js index eeb2771b1..bc7307508 100644 --- a/Plugins/ScriptPlugins/ParserCSGOSM.js +++ b/Plugins/ScriptPlugins/ParserCSGOSM.js @@ -46,6 +46,7 @@ const plugin = { rconParser.Configuration.DefaultDvarValues.Add('version', this.engine); rconParser.Configuration.DefaultDvarValues.Add('fs_basepath', ''); rconParser.Configuration.DefaultDvarValues.Add('fs_basegame', ''); + rconParser.Configuration.DefaultDvarValues.Add('fs_homepath', ''); rconParser.Configuration.DefaultDvarValues.Add('g_log', ''); rconParser.Configuration.DefaultDvarValues.Add('net_ip', 'localhost'); diff --git a/Plugins/ScriptPlugins/ParserPT6.js b/Plugins/ScriptPlugins/ParserPT6.js index fda40e5fd..014206a62 100644 --- a/Plugins/ScriptPlugins/ParserPT6.js +++ b/Plugins/ScriptPlugins/ParserPT6.js @@ -3,7 +3,7 @@ var eventParser; var plugin = { author: 'RaidMax, Xerxes', - version: 0.10, + version: 1.0, name: 'Plutonium T6 Parser', isParser: true, @@ -37,7 +37,7 @@ var plugin = { rconParser.Configuration.Status.AddMapping(104, 5); rconParser.Configuration.Status.AddMapping(105, 6); - eventParser.Configuration.GameDirectory = 't6'; + eventParser.Configuration.GameDirectory = ''; 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'; diff --git a/Plugins/ScriptPlugins/ParserT7.js b/Plugins/ScriptPlugins/ParserT7.js index 9c20509fd..20ac95b2f 100644 --- a/Plugins/ScriptPlugins/ParserT7.js +++ b/Plugins/ScriptPlugins/ParserT7.js @@ -33,6 +33,7 @@ var plugin = { rconParser.Configuration.DefaultDvarValues.Add('g_gametype', ''); rconParser.Configuration.DefaultDvarValues.Add('fs_basepath', ''); rconParser.Configuration.DefaultDvarValues.Add('fs_basegame', ''); + rconParser.Configuration.DefaultDvarValues.Add('fs_homepath', ''); rconParser.Configuration.DefaultDvarValues.Add('fs_game', ''); rconParser.Configuration.Status.AddMapping(105, 6); // ip address diff --git a/Plugins/Stats/Stats.csproj b/Plugins/Stats/Stats.csproj index 322eab052..95b217969 100644 --- a/Plugins/Stats/Stats.csproj +++ b/Plugins/Stats/Stats.csproj @@ -17,7 +17,7 @@ - + diff --git a/Plugins/Welcome/Welcome.csproj b/Plugins/Welcome/Welcome.csproj index 62646ec33..de8c395ea 100644 --- a/Plugins/Welcome/Welcome.csproj +++ b/Plugins/Welcome/Welcome.csproj @@ -20,7 +20,7 @@ - + diff --git a/SharedLibraryCore/SharedLibraryCore.csproj b/SharedLibraryCore/SharedLibraryCore.csproj index 49c96ec44..6dc9d347d 100644 --- a/SharedLibraryCore/SharedLibraryCore.csproj +++ b/SharedLibraryCore/SharedLibraryCore.csproj @@ -4,7 +4,7 @@ Library netcoreapp3.1 RaidMax.IW4MAdmin.SharedLibraryCore - 2021.8.26.1 + 2021.8.27.1 RaidMax Forever None Debug;Release;Prerelease @@ -19,7 +19,7 @@ true MIT Shared Library for IW4MAdmin - 2021.8.26.1 + 2021.8.27.1