2020-11-04 20:01:28 +00:00
|
|
|
|
using QSB.Patches;
|
|
|
|
|
using QSB.WorldSync;
|
2020-08-16 17:15:36 +02:00
|
|
|
|
using UnityEngine;
|
2020-08-13 19:25:12 +02:00
|
|
|
|
|
|
|
|
|
namespace QSB.GeyserSync
|
|
|
|
|
{
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public class GeyserManager : MonoBehaviour
|
|
|
|
|
{
|
2020-12-14 21:41:56 +01:00
|
|
|
|
public void Awake()
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
|
|
|
|
QSBPatchManager.OnPatchType += OnPatchType;
|
|
|
|
|
}
|
2020-08-13 19:25:12 +02:00
|
|
|
|
|
2020-12-14 21:20:53 +00:00
|
|
|
|
public void OnDestroy()
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
|
|
|
|
QSBPatchManager.OnPatchType -= OnPatchType;
|
|
|
|
|
}
|
2020-11-25 09:54:52 +00:00
|
|
|
|
|
2020-12-23 23:11:03 +00:00
|
|
|
|
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
2020-12-23 22:43:05 +00:00
|
|
|
|
=> QSBWorldSync.Init<QSBGeyser, GeyserController>();
|
2020-08-20 19:31:10 +01:00
|
|
|
|
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public void OnPatchType(QSBPatchTypes type)
|
|
|
|
|
{
|
|
|
|
|
if (type != QSBPatchTypes.OnNonServerClientConnect)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-12-14 16:24:52 +00:00
|
|
|
|
QSBCore.Helper.HarmonyHelper.EmptyMethod<GeyserController>("Update");
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-13 19:25:12 +02:00
|
|
|
|
}
|