|
@ -32,6 +32,8 @@ namespace IPA.Loader |
|
|
|
|
|
|
|
|
internal partial class PluginLoader |
|
|
internal partial class PluginLoader |
|
|
{ |
|
|
{ |
|
|
|
|
|
internal static PluginMetadata SelfMeta; |
|
|
|
|
|
|
|
|
internal static Task LoadTask() => |
|
|
internal static Task LoadTask() => |
|
|
TaskEx.Run(() => |
|
|
TaskEx.Run(() => |
|
|
{ |
|
|
{ |
|
@ -95,6 +97,7 @@ namespace IPA.Loader |
|
|
selfMeta.Manifest = JsonConvert.DeserializeObject<PluginManifest>(manifest); |
|
|
selfMeta.Manifest = JsonConvert.DeserializeObject<PluginManifest>(manifest); |
|
|
|
|
|
|
|
|
PluginsMetadata.Add(selfMeta); |
|
|
PluginsMetadata.Add(selfMeta); |
|
|
|
|
|
SelfMeta = selfMeta; |
|
|
} |
|
|
} |
|
|
catch (Exception e) |
|
|
catch (Exception e) |
|
|
{ |
|
|
{ |
|
@ -225,7 +228,7 @@ namespace IPA.Loader |
|
|
IEnumerable<string> bareManifests = Directory.GetFiles(UnityGame.PluginsPath, "*.json"); |
|
|
IEnumerable<string> bareManifests = Directory.GetFiles(UnityGame.PluginsPath, "*.json"); |
|
|
bareManifests = bareManifests.Concat(Directory.GetFiles(UnityGame.PluginsPath, "*.manifest")); |
|
|
bareManifests = bareManifests.Concat(Directory.GetFiles(UnityGame.PluginsPath, "*.manifest")); |
|
|
foreach (var manifest in bareManifests) |
|
|
foreach (var manifest in bareManifests) |
|
|
{ // TODO: maybe find a way to allow a bare manifest to specify an associated file
|
|
|
|
|
|
|
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var metadata = new PluginMetadata |
|
|
var metadata = new PluginMetadata |
|
@ -641,12 +644,16 @@ namespace IPA.Loader |
|
|
var disabledLookup = DisabledPlugins.NonNull(m => m.Id).ToDictionary(m => m.Id, m => m.Version); |
|
|
var disabledLookup = DisabledPlugins.NonNull(m => m.Id).ToDictionary(m => m.Id, m => m.Version); |
|
|
foreach (var meta in PluginsMetadata) |
|
|
foreach (var meta in PluginsMetadata) |
|
|
{ |
|
|
{ |
|
|
|
|
|
bool ignoreBcNoLoader = true; |
|
|
var missingDeps = new List<(string id, Range version, bool disabled)>(); |
|
|
var missingDeps = new List<(string id, Range version, bool disabled)>(); |
|
|
foreach (var dep in meta.Manifest.Dependencies) |
|
|
foreach (var dep in meta.Manifest.Dependencies) |
|
|
{ |
|
|
{ |
|
|
#if DEBUG
|
|
|
#if DEBUG
|
|
|
Logger.loader.Debug($"Looking for dependency {dep.Key} with version range {dep.Value.Intersect(new SemVer.Range("*.*.*"))}"); |
|
|
Logger.loader.Debug($"Looking for dependency {dep.Key} with version range {dep.Value.Intersect(new SemVer.Range("*.*.*"))}"); |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
if (dep.Key == SelfMeta.Id) |
|
|
|
|
|
ignoreBcNoLoader = false; |
|
|
|
|
|
|
|
|
if (pluginsToLoad.ContainsKey(dep.Key) && dep.Value.IsSatisfied(pluginsToLoad[dep.Key])) |
|
|
if (pluginsToLoad.ContainsKey(dep.Key) && dep.Value.IsSatisfied(pluginsToLoad[dep.Key])) |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
@ -662,6 +669,19 @@ namespace IPA.Loader |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (meta.PluginType != null && !meta.IsSelf && !meta.IsBare && ignoreBcNoLoader) |
|
|
|
|
|
{ |
|
|
|
|
|
ignoredPlugins.Add(meta, new IgnoreReason(Reason.Dependency) |
|
|
|
|
|
{ |
|
|
|
|
|
ReasonText = "BSIPA Plugin does not reference BSIPA!" |
|
|
|
|
|
}); |
|
|
|
|
|
for (int i = 0; i < 20; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
Logger.loader.Warn($"HEY {meta.Id} YOU DEPEND ON BSIPA SO DEPEND ON BSIPA"); |
|
|
|
|
|
} |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (missingDeps.Count == 0) |
|
|
if (missingDeps.Count == 0) |
|
|
{ |
|
|
{ |
|
|
metadata.Add(meta); |
|
|
metadata.Add(meta); |
|
|