Skip to content

Commit

Permalink
Update Si_Logging.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
zawedcvg committed Jul 20, 2024
1 parent 65eac6e commit 0e4099e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Si_Logging/Si_Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ public class HL_Logging : MelonMod

public static bool ParserExePresent()
{
return System.IO.File.Exists(Pref_Log_ParserExe.Value);
return System.IO.File.Exists(GetParserPath());
}
public static string GetParserPath()
{
return System.IO.Path.Combine(MelonEnvironment.UserDataDirectory, Pref_Log_ParserExe.Value);
}

public static void PrintLogLine(string LogMessage, bool suppressConsoleOutput = false)
Expand Down Expand Up @@ -141,7 +145,7 @@ public override void OnInitializeMelon()
_modCategory ??= MelonPreferences.CreateCategory("Silica");
Pref_Log_Damage ??= _modCategory.CreateEntry<bool>("Logging_LogDamage", false);
Pref_Log_Kills_Include_AI_vs_Player ??= _modCategory.CreateEntry<bool>("Logging_LogKills_IncludeAIvsPlayer", true);
Pref_Log_ParserExe ??= _modCategory.CreateEntry<string>("Logging_ParserExePath", "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Silica Dedicated Server\\UserData\\parser.exe");
Pref_Log_ParserExe ??= _modCategory.CreateEntry<string>("Logging_ParserExePath", "parser.exe");
Pref_Log_PerfMonitor_Interval ??= _modCategory.CreateEntry<float>("Logging_PerfMonitor_LogInterval", 60f);
Pref_Log_PerfMonitor_Enable ??= _modCategory.CreateEntry<bool>("Logging_PerfMonitor_Enable", true);
Pref_Log_PlayerConsole_Enable ??= _modCategory.CreateEntry<bool>("Logging_PlayerConsole_Enable", true);
Expand Down Expand Up @@ -840,7 +844,7 @@ public static void Postfix(MusicJukeboxHandler __instance, GameMode __0, Team __
// launch parser
MelonLogger.Msg("Launching parser.");
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = Path.GetFullPath(Pref_Log_ParserExe.Value);
start.FileName = Path.GetFullPath(GetParserPath());
string arguments = string.Format("\"{0}", GetLogFileDirectory());
start.Arguments = arguments;
start.UseShellExecute = false;
Expand Down

0 comments on commit 0e4099e

Please sign in to comment.