|
@@ -84,16 +84,16 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
foreach (var pluginInfoGroup in plugins.GroupBy(info => info.Metadata.GUID))
|
|
foreach (var pluginInfoGroup in plugins.GroupBy(info => info.Metadata.GUID))
|
|
{
|
|
{
|
|
- var alreadyLoaded = false;
|
|
|
|
|
|
+ PluginInfo loadedVersion = null;
|
|
foreach (var pluginInfo in pluginInfoGroup.OrderByDescending(x => x.Metadata.Version))
|
|
foreach (var pluginInfo in pluginInfoGroup.OrderByDescending(x => x.Metadata.Version))
|
|
{
|
|
{
|
|
- if (alreadyLoaded)
|
|
|
|
|
|
+ if (loadedVersion != null)
|
|
{
|
|
{
|
|
- Logger.LogWarning($"Skipping because a newer version exists [{pluginInfo.Metadata.Name} {pluginInfo.Metadata.Version}]");
|
|
|
|
|
|
+ Logger.LogWarning($"Skipping [{pluginInfo}] because a newer version exists [{loadedVersion}]");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- alreadyLoaded = true;
|
|
|
|
|
|
+ loadedVersion = pluginInfo;
|
|
|
|
|
|
// Perform checks that will prevent loading plugins in this run
|
|
// Perform checks that will prevent loading plugins in this run
|
|
var filters = pluginInfo.Processes.ToList();
|
|
var filters = pluginInfo.Processes.ToList();
|
|
@@ -101,7 +101,8 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
if (invalidProcessName)
|
|
if (invalidProcessName)
|
|
{
|
|
{
|
|
- Logger.LogWarning($"Skipping because of process filters [{pluginInfo.Metadata.Name} {pluginInfo.Metadata.Version}]");
|
|
|
|
|
|
+ Logger.LogWarning($"Skipping [{pluginInfo}] because of process filters");
|
|
|
|
+ Logger.LogDebug($"[{pluginInfo}] has the following process filters: {string.Join(", ", pluginInfo.Processes.Select(p => p.ProcessName).ToArray())}");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,13 +119,13 @@ namespace BepInEx.Bootstrap
|
|
dependencyDict.Remove(pluginInfo.Metadata.GUID);
|
|
dependencyDict.Remove(pluginInfo.Metadata.GUID);
|
|
|
|
|
|
var incompatiblePlugins = pluginInfo.Incompatibilities.Select(x => x.IncompatibilityGUID).Where(x => pluginsByGuid.ContainsKey(x)).ToArray();
|
|
var incompatiblePlugins = pluginInfo.Incompatibilities.Select(x => x.IncompatibilityGUID).Where(x => pluginsByGuid.ContainsKey(x)).ToArray();
|
|
- string message = $@"Could not load [{pluginInfo.Metadata.Name}] because it is incompatible with: {string.Join(", ", incompatiblePlugins)}";
|
|
|
|
|
|
+ string message = $@"Could not load [{pluginInfo}] because it is incompatible with: {string.Join(", ", incompatiblePlugins)}";
|
|
DependencyErrors.Add(message);
|
|
DependencyErrors.Add(message);
|
|
Logger.LogError(message);
|
|
Logger.LogError(message);
|
|
}
|
|
}
|
|
else if (PluginTargetsWrongBepin(pluginInfo))
|
|
else if (PluginTargetsWrongBepin(pluginInfo))
|
|
{
|
|
{
|
|
- string message = $@"Plugin [{pluginInfo.Metadata.Name}] targets a wrong version of BepInEx ({pluginInfo.TargettedBepInExVersion}) and might not work until you update";
|
|
|
|
|
|
+ string message = $@"Plugin [{pluginInfo}] targets a wrong version of BepInEx ({pluginInfo.TargettedBepInExVersion}) and might not work until you update";
|
|
DependencyErrors.Add(message);
|
|
DependencyErrors.Add(message);
|
|
Logger.LogWarning(message);
|
|
Logger.LogWarning(message);
|
|
}
|
|
}
|
|
@@ -181,7 +182,7 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
if (dependsOnInvalidPlugin)
|
|
if (dependsOnInvalidPlugin)
|
|
{
|
|
{
|
|
- string message = $"Skipping [{plugin.Metadata.Name}] because it has a dependency that was not loaded. See previous errors for details.";
|
|
|
|
|
|
+ string message = $"Skipping [{plugin}] because it has a dependency that was not loaded. See previous errors for details.";
|
|
DependencyErrors.Add(message);
|
|
DependencyErrors.Add(message);
|
|
Logger.LogWarning(message);
|
|
Logger.LogWarning(message);
|
|
continue;
|
|
continue;
|
|
@@ -191,7 +192,7 @@ namespace BepInEx.Bootstrap
|
|
{
|
|
{
|
|
bool IsEmptyVersion(Version v) => v.Major == 0 && v.Minor == 0 && v.Build <= 0 && v.Revision <= 0;
|
|
bool IsEmptyVersion(Version v) => v.Major == 0 && v.Minor == 0 && v.Build <= 0 && v.Revision <= 0;
|
|
|
|
|
|
- string message = $@"Could not load [{plugin.Metadata.Name}] because it has missing dependencies: {
|
|
|
|
|
|
+ string message = $@"Could not load [{plugin}] because it has missing dependencies: {
|
|
string.Join(", ", missingDependencies.Select(s => IsEmptyVersion(s.MinimumVersion) ? s.DependencyGUID : $"{s.DependencyGUID} (v{s.MinimumVersion} or newer)").ToArray())
|
|
string.Join(", ", missingDependencies.Select(s => IsEmptyVersion(s.MinimumVersion) ? s.DependencyGUID : $"{s.DependencyGUID} (v{s.MinimumVersion} or newer)").ToArray())
|
|
}";
|
|
}";
|
|
DependencyErrors.Add(message);
|
|
DependencyErrors.Add(message);
|
|
@@ -203,7 +204,7 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- Logger.LogInfo($"Loading [{plugin.Metadata.Name} {plugin.Metadata.Version}]");
|
|
|
|
|
|
+ Logger.LogInfo($"Loading [{plugin}]");
|
|
|
|
|
|
if (!loadedAssemblies.TryGetValue(plugin.Location, out var ass))
|
|
if (!loadedAssemblies.TryGetValue(plugin.Location, out var ass))
|
|
loadedAssemblies[plugin.Location] = ass = Assembly.LoadFile(plugin.Location);
|
|
loadedAssemblies[plugin.Location] = ass = Assembly.LoadFile(plugin.Location);
|
|
@@ -218,7 +219,7 @@ namespace BepInEx.Bootstrap
|
|
invalidPlugins.Add(plugin.Metadata.GUID);
|
|
invalidPlugins.Add(plugin.Metadata.GUID);
|
|
Plugins.Remove(plugin.Metadata.GUID);
|
|
Plugins.Remove(plugin.Metadata.GUID);
|
|
|
|
|
|
- Logger.LogError($"Error loading [{plugin.Metadata.Name}] : {ex.Message}");
|
|
|
|
|
|
+ Logger.LogError($"Error loading [{plugin}] : {ex.Message}");
|
|
if (ex is ReflectionTypeLoadException re)
|
|
if (ex is ReflectionTypeLoadException re)
|
|
Logger.LogDebug(TypeLoader.TypeLoadExceptionToString(re));
|
|
Logger.LogDebug(TypeLoader.TypeLoadExceptionToString(re));
|
|
else
|
|
else
|