Merge branch 'dev' into picture-frame-doors

This commit is contained in:
Mister_Nebula 2022-03-11 10:21:42 +00:00
commit db5f9acea7
5 changed files with 18 additions and 21 deletions

View File

@ -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);
}

View File

@ -5,5 +5,6 @@ public enum QSBPatchTypes
OnClientConnect,
OnNonServerClientConnect,
OnServerClientConnect,
RespawnTime
RespawnTime,
OnModStart
}

View File

@ -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)

View File

@ -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))]

View File

@ -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);
}
}
}
}