From 158cc75caa1cd9536a5bade49b3eca99feb0076a Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Tue, 1 Sep 2020 19:28:18 -0500 Subject: [PATCH] reminder to add bsipa to your dependencies --- IPA.Loader/Config/SelfConfig.cs | 2 +- IPA.Loader/Loader/PluginLoader.cs | 22 +++++++++++++++++++++- IPA.Loader/Loader/manifest.json | 2 +- IPA/Program.cs | 2 +- Refs/UnityEngine.CoreModule.Net4.dll | Bin 710656 -> 710656 bytes 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index e682eaea..ab0298fd 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -68,7 +68,7 @@ namespace IPA.Config } internal const string IPAName = "Beat Saber IPA"; - internal const string IPAVersion = "4.1.0.0"; + internal const string IPAVersion = "4.1.1.0"; // uses Updates.AutoUpdate, Updates.AutoCheckUpdates, YeetMods, Debug.ShowCallSource, Debug.ShowDebug, // Debug.CondenseModLogs diff --git a/IPA.Loader/Loader/PluginLoader.cs b/IPA.Loader/Loader/PluginLoader.cs index 95038cfb..7ee77156 100644 --- a/IPA.Loader/Loader/PluginLoader.cs +++ b/IPA.Loader/Loader/PluginLoader.cs @@ -32,6 +32,8 @@ namespace IPA.Loader internal partial class PluginLoader { + internal static PluginMetadata SelfMeta; + internal static Task LoadTask() => TaskEx.Run(() => { @@ -95,6 +97,7 @@ namespace IPA.Loader selfMeta.Manifest = JsonConvert.DeserializeObject(manifest); PluginsMetadata.Add(selfMeta); + SelfMeta = selfMeta; } catch (Exception e) { @@ -225,7 +228,7 @@ namespace IPA.Loader IEnumerable bareManifests = Directory.GetFiles(UnityGame.PluginsPath, "*.json"); bareManifests = bareManifests.Concat(Directory.GetFiles(UnityGame.PluginsPath, "*.manifest")); foreach (var manifest in bareManifests) - { // TODO: maybe find a way to allow a bare manifest to specify an associated file + { try { 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); foreach (var meta in PluginsMetadata) { + bool ignoreBcNoLoader = true; var missingDeps = new List<(string id, Range version, bool disabled)>(); foreach (var dep in meta.Manifest.Dependencies) { #if DEBUG Logger.loader.Debug($"Looking for dependency {dep.Key} with version range {dep.Value.Intersect(new SemVer.Range("*.*.*"))}"); #endif + if (dep.Key == SelfMeta.Id) + ignoreBcNoLoader = false; + if (pluginsToLoad.ContainsKey(dep.Key) && dep.Value.IsSatisfied(pluginsToLoad[dep.Key])) 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) { metadata.Add(meta); diff --git a/IPA.Loader/Loader/manifest.json b/IPA.Loader/Loader/manifest.json index 9eddc4b7..e9b9fad4 100644 --- a/IPA.Loader/Loader/manifest.json +++ b/IPA.Loader/Loader/manifest.json @@ -5,7 +5,7 @@ "#![IPA.Loader.description.md]", "A mod loader specifically for Beat Saber." ], - "gameVersion": "1.11.0", + "gameVersion": "1.11.1", "id": "BSIPA", "name": "Beat Saber IPA", "version": "4.1.0", diff --git a/IPA/Program.cs b/IPA/Program.cs index 9c6b100f..bd06783c 100644 --- a/IPA/Program.cs +++ b/IPA/Program.cs @@ -23,7 +23,7 @@ namespace IPA Unknown } - public const string FileVersion = "4.1.0.0"; + public const string FileVersion = "4.1.1.0"; public static Version Version => Assembly.GetEntryAssembly().GetName().Version; diff --git a/Refs/UnityEngine.CoreModule.Net4.dll b/Refs/UnityEngine.CoreModule.Net4.dll index 4a7cebf46e812af1fc87f587e147157bf2ea4631..f76c3541ddde55dfffe9ce074c2ced11c8adc33f 100644 GIT binary patch delta 47 xcmZqJpxppOEsQNpEzB(}Ev#GErdTmEGBC7Hw_*cgb|B^eV$SW;t++Dh0swYL4}1Us delta 47 wcmZqJpxppOEsQNpEzB(}Ev#GErdTmEFtD{xw*p~yAm#vK&h68!xH9Jg0Cu