Skip to content

Commit

Permalink
Merge pull request #487 from misternebula/init-assemblies-hotfix
Browse files Browse the repository at this point in the history
InitializeAssemblies hotfix
  • Loading branch information
JohnCorby authored Feb 26, 2022
2 parents 2dacfd1 + 2f7fb71 commit ec6528b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions QSB/QSBCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,20 @@ private static void InitializeAssemblies()
foreach (var path in Directory.EnumerateFiles(Helper.Manifest.ModFolderPath, "*.dll"))
{
var assembly = Assembly.LoadFile(path);
if (Path.GetFileNameWithoutExtension(path) == "ProxyScripts")
{
continue;
}

DebugLog.DebugWrite(assembly.ToString());
assembly.GetTypes()
assembly
.GetTypes()
.SelectMany(x => x.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly))
.Where(x => x.IsDefined(typeof(RuntimeInitializeOnLoadMethodAttribute)))
.ForEach(x => x.Invoke(null, null));
}

DebugLog.DebugWrite($"Assemblies initialized", MessageType.Success);
DebugLog.DebugWrite("Assemblies initialized", MessageType.Success);
}

public override void Configure(IModConfig config) => DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
Expand Down Expand Up @@ -178,4 +184,4 @@ private void Update()
* Daft Punk
* Natalie Holt
* WMD
*/
*/
2 changes: 1 addition & 1 deletion QSB/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications.\n- Make sure you have forwarded/opened the correct ports. (See the GitHub readme.)"
},
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
"version": "0.17.0",
"version": "0.17.1",
"owmlVersion": "2.3.2",
"dependencies": [ "_nebula.MenuFramework" ]
}

0 comments on commit ec6528b

Please sign in to comment.