mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
Merge branch 'dev' into picture-frame-doors
This commit is contained in:
commit
db5f9acea7
@ -24,21 +24,10 @@ public static class QSBPatchManager
|
||||
_patchList.Add((QSBPatch)Activator.CreateInstance(type));
|
||||
}
|
||||
|
||||
TypeToInstance = new Dictionary<QSBPatchTypes, Harmony>
|
||||
foreach (QSBPatchTypes type in Enum.GetValues(typeof(QSBPatchTypes)))
|
||||
{
|
||||
{
|
||||
QSBPatchTypes.OnClientConnect, new Harmony("QSB.Client")
|
||||
},
|
||||
{
|
||||
QSBPatchTypes.OnServerClientConnect, new Harmony("QSB.Server")
|
||||
},
|
||||
{
|
||||
QSBPatchTypes.OnNonServerClientConnect, new Harmony("QSB.NonServer")
|
||||
},
|
||||
{
|
||||
QSBPatchTypes.RespawnTime, new Harmony("QSB.Death")
|
||||
}
|
||||
};
|
||||
TypeToInstance.Add(type, new Harmony(type.ToString()));
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite("Patch Manager ready.", MessageType.Success);
|
||||
}
|
||||
|
@ -5,5 +5,6 @@ public enum QSBPatchTypes
|
||||
OnClientConnect,
|
||||
OnNonServerClientConnect,
|
||||
OnServerClientConnect,
|
||||
RespawnTime
|
||||
RespawnTime,
|
||||
OnModStart
|
||||
}
|
@ -108,6 +108,8 @@ public class QSBCore : ModBehaviour
|
||||
QSBWorldSync.Managers = components.OfType<WorldObjectManager>().ToArray();
|
||||
QSBPatchManager.OnPatchType += OnPatchType;
|
||||
QSBPatchManager.OnUnpatchType += OnUnpatchType;
|
||||
|
||||
QSBPatchManager.DoPatchType(QSBPatchTypes.OnModStart);
|
||||
}
|
||||
|
||||
private static void OnPatchType(QSBPatchTypes type)
|
||||
|
@ -1,4 +1,5 @@
|
||||
using HarmonyLib;
|
||||
using QSB.Patches;
|
||||
using QSB.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
@ -8,13 +9,9 @@ namespace QSB;
|
||||
/// TODO: remove this when the bug is fixed in vanilla
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(StreamingGroup))]
|
||||
internal class TEMP_ShipBugFix : MonoBehaviour, IAddComponentOnStart
|
||||
internal class TEMP_ShipBugFix : QSBPatch
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Harmony.CreateAndPatchAll(typeof(TEMP_ShipBugFix));
|
||||
Destroy(this);
|
||||
}
|
||||
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(StreamingGroup.LoadRequiredColliders))]
|
||||
|
@ -9,6 +9,7 @@ using QSB.Player;
|
||||
using QSB.Player.Messages;
|
||||
using QSB.TimeSync.Messages;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
@ -126,6 +127,13 @@ public class WakeUpSync : NetworkBehaviour
|
||||
{
|
||||
WakeUpOrSleep();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_hasWokenUp)
|
||||
{
|
||||
Delay.RunWhen(() => QSBWorldSync.AllObjectsReady, WakeUp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user