|
@@ -99,6 +99,7 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
var metadata = BepInPlugin.FromCecilType(type);
|
|
var metadata = BepInPlugin.FromCecilType(type);
|
|
|
|
|
|
|
|
+ // Perform checks that will prevent the plugin from being loaded in ALL cases
|
|
if (metadata == null)
|
|
if (metadata == null)
|
|
{
|
|
{
|
|
Logger.LogWarning($"Skipping over type [{type.FullName}] as no metadata attribute is specified");
|
|
Logger.LogWarning($"Skipping over type [{type.FullName}] as no metadata attribute is specified");
|
|
@@ -123,16 +124,7 @@ namespace BepInEx.Bootstrap
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- //Perform a filter for currently running process
|
|
|
|
var filters = BepInProcess.FromCecilType(type);
|
|
var filters = BepInProcess.FromCecilType(type);
|
|
- bool invalidProcessName = filters.Count != 0 && filters.All(x => !string.Equals(x.ProcessName.Replace(".exe", ""), Paths.ProcessName, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
-
|
|
|
|
- if (invalidProcessName)
|
|
|
|
- {
|
|
|
|
- Logger.LogWarning($"Skipping over plugin [{metadata.GUID}] due to process filter");
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
var dependencies = BepInDependency.FromCecilType(type);
|
|
var dependencies = BepInDependency.FromCecilType(type);
|
|
|
|
|
|
return new PluginInfo
|
|
return new PluginInfo
|
|
@@ -199,9 +191,13 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
foreach (var pluginInfo in pluginInfos)
|
|
foreach (var pluginInfo in pluginInfos)
|
|
{
|
|
{
|
|
- if (pluginInfo.Metadata.GUID == null)
|
|
|
|
|
|
+ // Perform checks that will prevent loading plugins in this run
|
|
|
|
+ var filters = pluginInfo.Processes.ToList();
|
|
|
|
+ bool invalidProcessName = filters.Count != 0 && filters.All(x => !string.Equals(x.ProcessName.Replace(".exe", ""), Paths.ProcessName, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
+
|
|
|
|
+ if (invalidProcessName)
|
|
{
|
|
{
|
|
- Logger.LogWarning($"Skipping [{pluginInfo.Metadata.Name}] because it does not have a valid GUID.");
|
|
|
|
|
|
+ Logger.LogWarning($"Skipping over plugin [{pluginInfo.Metadata.GUID}] due to process filter");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|