Browse Source

Merge branch 'master' of https://github.com/BepInEx/BepInEx

ManlyMarco 4 years ago
parent
commit
f63da4a8ae
2 changed files with 8 additions and 12 deletions
  1. 7 11
      BepInEx/Bootstrap/Chainloader.cs
  2. 1 1
      submodules/MonoMod

+ 7 - 11
BepInEx/Bootstrap/Chainloader.cs

@@ -96,6 +96,7 @@ namespace BepInEx.Bootstrap
 
 			var metadata = BepInPlugin.FromCecilType(type);
 
+			// Perform checks that will prevent the plugin from being loaded in ALL cases
 			if (metadata == null)
 			{
 				Logger.LogWarning($"Skipping over type [{type.FullName}] as no metadata attribute is specified");
@@ -120,16 +121,7 @@ namespace BepInEx.Bootstrap
 				return null;
 			}
 
-			//Perform a filter for currently running process
 			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);
 
 			return new PluginInfo
@@ -196,9 +188,13 @@ namespace BepInEx.Bootstrap
 
 				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;
 					}
 

+ 1 - 1
submodules/MonoMod

@@ -1 +1 @@
-Subproject commit a70072cdf759ac0cfa80991fcd2cca67d3eec130
+Subproject commit 9462a0f75b669606b59a4648a3461338d2be32c2