mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-27 12:35:28 +00:00
add unitask
This commit is contained in:
parent
aa70fe3fad
commit
961e12d2f3
@ -62,6 +62,7 @@ copy /y "$(OwmlDir)\OWML.Abstractions.dll" "$(UnityAssetsDir)"
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.125" IncludeAssets="compile" />
|
||||
<Reference Include="..\Mirror\*.dll" />
|
||||
<Reference Include="..\UniTask\*.dll" />
|
||||
<ProjectReference Include="..\FizzyFacepunch\FizzyFacepunch.csproj" />
|
||||
<ProjectReference Include="..\QSBPatcher\QSBPatcher.csproj" />
|
||||
<ProjectReference Include="..\MirrorWeaver\MirrorWeaver.csproj" ReferenceOutputAssembly="false" />
|
||||
|
@ -14,7 +14,9 @@ using QSB.StatueSync;
|
||||
using QSB.TimeSync;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
@ -88,12 +90,9 @@ namespace QSB
|
||||
DebugAssetBundle = Helper.Assets.LoadBundle("AssetBundles/debug");
|
||||
TextAssetsBundle = Helper.Assets.LoadBundle("AssetBundles/textassets");
|
||||
|
||||
DebugSettings = Helper.Storage.Load<DebugSettings>("debugsettings.json");
|
||||
DebugSettings = Helper.Storage.Load<DebugSettings>("debugsettings.json") ?? new DebugSettings();
|
||||
|
||||
if (DebugSettings == null)
|
||||
{
|
||||
DebugSettings = new DebugSettings();
|
||||
}
|
||||
InitializeAssemblies();
|
||||
|
||||
QSBPatchManager.Init();
|
||||
DeterministicManager.Init();
|
||||
@ -121,7 +120,7 @@ namespace QSB
|
||||
QSBPatchManager.OnUnpatchType += OnUnpatchType;
|
||||
}
|
||||
|
||||
private void OnPatchType(QSBPatchTypes type)
|
||||
private static void OnPatchType(QSBPatchTypes type)
|
||||
{
|
||||
if (type == QSBPatchTypes.OnClientConnect)
|
||||
{
|
||||
@ -129,7 +128,7 @@ namespace QSB
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpatchType(QSBPatchTypes type)
|
||||
private static void OnUnpatchType(QSBPatchTypes type)
|
||||
{
|
||||
if (type == QSBPatchTypes.OnClientConnect)
|
||||
{
|
||||
@ -137,6 +136,22 @@ namespace QSB
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeAssemblies()
|
||||
{
|
||||
DebugLog.DebugWrite("Running RuntimeInitializeOnLoad methods for our assemblies", MessageType.Info);
|
||||
foreach (var path in Directory.EnumerateFiles(Helper.Manifest.ModFolderPath, "*.dll"))
|
||||
{
|
||||
var assembly = Assembly.LoadFile(path);
|
||||
DebugLog.DebugWrite(assembly.ToString());
|
||||
assembly.GetTypes()
|
||||
.SelectMany(x => x.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly))
|
||||
.Where(x => x.GetCustomAttribute<RuntimeInitializeOnLoadMethodAttribute>() != null)
|
||||
.ForEach(x => x.Invoke(null, null));
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"Assemblies initialized", MessageType.Success);
|
||||
}
|
||||
|
||||
public override void Configure(IModConfig config)
|
||||
{
|
||||
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
||||
|
@ -23,7 +23,6 @@ using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
|
||||
@ -59,14 +58,6 @@ namespace QSB
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
AppDomain.CurrentDomain.GetAssemblies()
|
||||
.Where(x => x.GetName().Name.StartsWith("Mirror"))
|
||||
.Append(typeof(QSBNetworkManager).Assembly)
|
||||
.SelectMany(x => x.GetTypes())
|
||||
.SelectMany(x => x.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly))
|
||||
.Where(x => x.GetCustomAttribute<RuntimeInitializeOnLoadMethodAttribute>() != null)
|
||||
.ForEach(x => x.Invoke(null, null));
|
||||
|
||||
gameObject.SetActive(false);
|
||||
|
||||
if (QSBCore.UseKcpTransport)
|
||||
|
BIN
UniTask/UniTask.dll
Normal file
BIN
UniTask/UniTask.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user