mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +00:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
commit
8cb6a0b568
@ -118,28 +118,28 @@ public class QSBCore : ModBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void InitializeAssemblies()
|
private static void InitializeAssemblies()
|
||||||
|
{
|
||||||
|
DebugLog.DebugWrite("Running RuntimeInitializeOnLoad methods for our assemblies", MessageType.Info);
|
||||||
|
foreach (var path in Directory.EnumerateFiles(Helper.Manifest.ModFolderPath, "*.dll"))
|
||||||
{
|
{
|
||||||
DebugLog.DebugWrite("Running RuntimeInitializeOnLoad methods for our assemblies", MessageType.Info);
|
var assembly = Assembly.LoadFile(path);
|
||||||
foreach (var path in Directory.EnumerateFiles(Helper.Manifest.ModFolderPath, "*.dll"))
|
if (Path.GetFileNameWithoutExtension(path) == "ProxyScripts")
|
||||||
{
|
{
|
||||||
var assembly = Assembly.LoadFile(path);
|
continue;
|
||||||
if (Path.GetFileNameWithoutExtension(path) == "ProxyScripts")
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugLog.DebugWrite(assembly.ToString());
|
|
||||||
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(assembly.ToString());
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
public override void Configure(IModConfig config) => DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
public override void Configure(IModConfig config) => DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user