Fix restart option (no longer gives error about game currently running)
All checks were successful
Build / Build Launcher (push) Successful in 1m57s
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:
@@ -88,7 +88,7 @@ public class LocalPlugin : PluginData
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
var assembly = Assembly.LoadFile(assemblyPath);
|
var assembly = Assembly.LoadFile(assemblyPath);
|
||||||
LogFile.WriteLine("Resolving " + assembly.GetName().Name + " for " + args.RequestingAssembly?.FullName);
|
LogFile.WriteLine("Resolving " + assembly.GetName().Name + " for " + args.RequestingAssembly?.FullName, false);
|
||||||
|
|
||||||
var main = Main.Instance;
|
var main = Main.Instance;
|
||||||
if (!main.Config.IsEnabled(assemblyPath))
|
if (!main.Config.IsEnabled(assemblyPath))
|
||||||
|
@@ -106,7 +106,7 @@ public static class LoaderTools
|
|||||||
public static void Restart()
|
public static void Restart()
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", "steam://rungameid/244850");
|
Process.Start("explorer.exe", "steam://rungameid/244850");
|
||||||
Environment.Exit(0);
|
Process.GetCurrentProcess().Kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ExecuteMain(SEPMPlugin plugin)
|
public static void ExecuteMain(SEPMPlugin plugin)
|
||||||
|
@@ -79,16 +79,24 @@ public class PluginConfig
|
|||||||
var toRemove = new List<string>();
|
var toRemove = new List<string>();
|
||||||
|
|
||||||
var sb = new StringBuilder("Enabled plugins: ");
|
var sb = new StringBuilder("Enabled plugins: ");
|
||||||
|
var localPlugins = new StringBuilder("Local plugins: ");
|
||||||
foreach (var id in EnabledPlugins)
|
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);
|
toRemove.Add(id);
|
||||||
}
|
}
|
||||||
else
|
else if (!plugin.IsLocal)
|
||||||
{
|
{
|
||||||
sb.Append(id).Append(", ");
|
sb.Append(id).Append(", ");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localPlugins.Append(id).Append(", ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (EnabledPlugins.Count > 0)
|
if (EnabledPlugins.Count > 0)
|
||||||
sb.Length -= 2;
|
sb.Length -= 2;
|
||||||
@@ -96,6 +104,11 @@ public class PluginConfig
|
|||||||
sb.Append("None");
|
sb.Append("None");
|
||||||
LogFile.WriteLine(sb.ToString());
|
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)
|
foreach (var id in toRemove)
|
||||||
EnabledPlugins.Remove(id);
|
EnabledPlugins.Remove(id);
|
||||||
|
@@ -102,7 +102,7 @@ public class PluginInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
LogFile.WriteLine($"Registered {count} session components from: {mainAssembly.FullName}");
|
LogFile.WriteLine($"Registered {count} session components from: {mainAssembly.FullName}", !data.IsLocal);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user