Fix restart option (no longer gives error about game currently running)
All checks were successful
Build / Build Launcher (push) Successful in 1m57s

Prevent local plugin info from being logged to game logs (now only logs to pluginloader's loader.log)
This commit is contained in:
2024-04-15 22:39:07 -04:00
parent 72a3a3da71
commit af9fa1c510
4 changed files with 19 additions and 6 deletions

View File

@@ -79,16 +79,24 @@ public class PluginConfig
var toRemove = new List<string>();
var sb = new StringBuilder("Enabled plugins: ");
var localPlugins = new StringBuilder("Local plugins: ");
foreach (var id in EnabledPlugins)
if (!plugins.Contains(id))
{
if (!plugins.TryGetPlugin(id, out var plugin))
{
LogFile.WriteLine($"{id} was in the config but is no longer available");
LogFile.WriteLine($"{id} was in the config but is no longer available", false);
toRemove.Add(id);
}
else
else if (!plugin.IsLocal)
{
sb.Append(id).Append(", ");
}
else
{
localPlugins.Append(id).Append(", ");
}
}
if (EnabledPlugins.Count > 0)
sb.Length -= 2;
@@ -96,6 +104,11 @@ public class PluginConfig
sb.Append("None");
LogFile.WriteLine(sb.ToString());
if (localPlugins.Length > 15)
localPlugins.Length -= 2;
else
localPlugins.Append("None");
LogFile.WriteLine(localPlugins.ToString(), false);
foreach (var id in toRemove)
EnabledPlugins.Remove(id);