From 51bb10eedc6d072109e9cb3137d9256b709207e2 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 14 Jan 2022 22:25:23 -0800 Subject: [PATCH] rename --- QSB/Anglerfish/WorldObjects/QSBAngler.cs | 2 +- QSB/JellyfishSync/WorldObjects/QSBJellyfish.cs | 2 +- QSB/Menus/MenuManager.cs | 14 +++++++------- QSB/OrbSync/WorldObjects/QSBOrb.cs | 2 +- QSB/QSBCore.cs | 2 +- QSB/QSBNetworkManager.cs | 2 +- QSB/QSBSceneManager.cs | 2 +- QSB/RespawnSync/RespawnManager.cs | 4 ++-- QSB/SatelliteSync/SatelliteProjectorManager.cs | 2 +- QSB/ShipSync/ShipManager.cs | 2 +- QSB/TornadoSync/TornadoManager.cs | 2 +- QSB/WorldSync/WorldObjectManager.cs | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/QSB/Anglerfish/WorldObjects/QSBAngler.cs b/QSB/Anglerfish/WorldObjects/QSBAngler.cs index d9f7365a..2f74d069 100644 --- a/QSB/Anglerfish/WorldObjects/QSBAngler.cs +++ b/QSB/Anglerfish/WorldObjects/QSBAngler.cs @@ -18,7 +18,7 @@ namespace QSB.Anglerfish.WorldObjects { if (QSBCore.IsHost) { - Object.Instantiate(QSBNetworkManager.Instance.AnglerPrefab).SpawnWithServerAuthority(); + Object.Instantiate(QSBNetworkManager.singleton.AnglerPrefab).SpawnWithServerAuthority(); } StartDelayedReady(); diff --git a/QSB/JellyfishSync/WorldObjects/QSBJellyfish.cs b/QSB/JellyfishSync/WorldObjects/QSBJellyfish.cs index 46af5d55..9fe77720 100644 --- a/QSB/JellyfishSync/WorldObjects/QSBJellyfish.cs +++ b/QSB/JellyfishSync/WorldObjects/QSBJellyfish.cs @@ -17,7 +17,7 @@ namespace QSB.JellyfishSync.WorldObjects if (QSBCore.IsHost) { - Object.Instantiate(QSBNetworkManager.Instance.JellyfishPrefab).SpawnWithServerAuthority(); + Object.Instantiate(QSBNetworkManager.singleton.JellyfishPrefab).SpawnWithServerAuthority(); } StartDelayedReady(); diff --git a/QSB/Menus/MenuManager.cs b/QSB/Menus/MenuManager.cs index c06a6fed..cfe6bbd1 100644 --- a/QSB/Menus/MenuManager.cs +++ b/QSB/Menus/MenuManager.cs @@ -43,9 +43,9 @@ namespace QSB.Menus Instance = this; MakeTitleMenus(); QSBSceneManager.OnSceneLoaded += OnSceneLoaded; - QSBNetworkManager.Instance.OnClientConnected += OnConnected; - QSBNetworkManager.Instance.OnClientDisconnected += OnDisconnected; - QSBNetworkManager.Instance.OnClientErrorThrown += OnClientError; + QSBNetworkManager.singleton.OnClientConnected += OnConnected; + QSBNetworkManager.singleton.OnClientDisconnected += OnDisconnected; + QSBNetworkManager.singleton.OnClientErrorThrown += OnClientError; } private void OnSceneLoaded(OWScene oldScene, OWScene newScene, bool isUniverse) @@ -273,7 +273,7 @@ namespace QSB.Menus private void Disconnect() { - QSBNetworkManager.Instance.StopHost(); + QSBNetworkManager.singleton.StopHost(); SetButtonActive(DisconnectButton.gameObject, false); Locator.GetSceneMenuManager().pauseMenu._pauseMenu.EnableMenu(false); @@ -286,7 +286,7 @@ namespace QSB.Menus private void Host() { - QSBNetworkManager.Instance.StartHost(); + QSBNetworkManager.singleton.StartHost(); SetButtonActive(DisconnectButton, true); SetButtonActive(HostButton, false); SetButtonActive(QuitButton, false); @@ -313,8 +313,8 @@ namespace QSB.Menus { var address = ((PopupInputMenu)IPPopup).GetInputText(); - QSBNetworkManager.Instance.networkAddress = address; - QSBNetworkManager.Instance.StartClient(); + QSBNetworkManager.singleton.networkAddress = address; + QSBNetworkManager.singleton.StartClient(); if (QSBSceneManager.CurrentScene == OWScene.TitleScreen) { diff --git a/QSB/OrbSync/WorldObjects/QSBOrb.cs b/QSB/OrbSync/WorldObjects/QSBOrb.cs index 8980e66e..611c890e 100644 --- a/QSB/OrbSync/WorldObjects/QSBOrb.cs +++ b/QSB/OrbSync/WorldObjects/QSBOrb.cs @@ -14,7 +14,7 @@ namespace QSB.OrbSync.WorldObjects { if (QSBCore.IsHost) { - Object.Instantiate(QSBNetworkManager.Instance.OrbPrefab).SpawnWithServerAuthority(); + Object.Instantiate(QSBNetworkManager.singleton.OrbPrefab).SpawnWithServerAuthority(); } StartDelayedReady(); diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index a4e982c8..e54907c5 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -151,7 +151,7 @@ namespace QSB { DefaultServerIP = config.GetSettingsValue("defaultServerIP"); Port = config.GetSettingsValue("port"); - if (QSBNetworkManager.Instance != null) + if (QSBNetworkManager.singleton != null) { // todo QSBNetworkManager.Instance.networkPort = Port; } diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index c842b1a8..62b28f3d 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -29,7 +29,7 @@ namespace QSB { public class QSBNetworkManager : NetworkManager { - public static QSBNetworkManager Instance => (QSBNetworkManager)singleton; + public static QSBNetworkManager singleton => (QSBNetworkManager)NetworkManager.singleton; public event Action OnNetworkManagerReady; public event Action OnClientConnected; diff --git a/QSB/QSBSceneManager.cs b/QSB/QSBSceneManager.cs index 604dc247..390587bb 100644 --- a/QSB/QSBSceneManager.cs +++ b/QSB/QSBSceneManager.cs @@ -42,7 +42,7 @@ namespace QSB if (newScene == OWScene.TitleScreen && QSBCore.IsInMultiplayer) { - QSBNetworkManager.Instance.StopHost(); + QSBNetworkManager.singleton.StopHost(); } } diff --git a/QSB/RespawnSync/RespawnManager.cs b/QSB/RespawnSync/RespawnManager.cs index 8e81eb38..f8aa48ef 100644 --- a/QSB/RespawnSync/RespawnManager.cs +++ b/QSB/RespawnSync/RespawnManager.cs @@ -30,8 +30,8 @@ namespace QSB.RespawnSync => QSBCore.UnityEvents.RunWhen( () => Locator.GetMarkerManager() != null, () => Init(newScene, inUniverse)); - QSBNetworkManager.Instance.OnClientConnected += OnConnected; - QSBNetworkManager.Instance.OnClientDisconnected += OnDisconnected; + QSBNetworkManager.singleton.OnClientConnected += OnConnected; + QSBNetworkManager.singleton.OnClientDisconnected += OnDisconnected; } private void OnConnected() diff --git a/QSB/SatelliteSync/SatelliteProjectorManager.cs b/QSB/SatelliteSync/SatelliteProjectorManager.cs index 7fa1ab0d..e387384a 100644 --- a/QSB/SatelliteSync/SatelliteProjectorManager.cs +++ b/QSB/SatelliteSync/SatelliteProjectorManager.cs @@ -33,7 +33,7 @@ namespace QSB.SatelliteSync { Instance = this; QSBSceneManager.OnUniverseSceneLoaded += OnSceneLoaded; - QSBNetworkManager.Instance.OnClientConnected += OnConnected; + QSBNetworkManager.singleton.OnClientConnected += OnConnected; } public void OnDestroy() => QSBSceneManager.OnUniverseSceneLoaded -= OnSceneLoaded; diff --git a/QSB/ShipSync/ShipManager.cs b/QSB/ShipSync/ShipManager.cs index f0da6569..861d411f 100644 --- a/QSB/ShipSync/ShipManager.cs +++ b/QSB/ShipSync/ShipManager.cs @@ -88,7 +88,7 @@ namespace QSB.ShipSync DebugLog.ToConsole($"Error - Tried to spawn ship, but LocalPlayer's TransformSync is null!", MessageType.Error); } - Instantiate(QSBNetworkManager.Instance.ShipPrefab).SpawnWithServerAuthority(); + Instantiate(QSBNetworkManager.singleton.ShipPrefab).SpawnWithServerAuthority(); } QSBWorldSync.Init(); diff --git a/QSB/TornadoSync/TornadoManager.cs b/QSB/TornadoSync/TornadoManager.cs index f44bcee9..4b963f76 100644 --- a/QSB/TornadoSync/TornadoManager.cs +++ b/QSB/TornadoSync/TornadoManager.cs @@ -44,7 +44,7 @@ namespace QSB.TornadoSync private static void SpawnOccasional(OWRigidbody body, OWRigidbody refBody) { - var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetRequiredComponent(); + var transformSync = Instantiate(QSBNetworkManager.singleton.OccasionalPrefab).GetRequiredComponent(); transformSync.InitBodyIndexes(body, refBody); transformSync.gameObject.SpawnWithServerAuthority(); } diff --git a/QSB/WorldSync/WorldObjectManager.cs b/QSB/WorldSync/WorldObjectManager.cs index 94f38606..f6d84827 100644 --- a/QSB/WorldSync/WorldObjectManager.cs +++ b/QSB/WorldSync/WorldObjectManager.cs @@ -60,10 +60,10 @@ namespace QSB.WorldSync public static void Rebuild(OWScene scene) { - if (!QSBNetworkManager.Instance.IsReady) + if (!QSBNetworkManager.singleton.IsReady) { DebugLog.ToConsole($"Warning - Tried to rebuild WorldObjects when Network Manager not ready! Building when ready...", MessageType.Warning); - QSBCore.UnityEvents.RunWhen(() => QSBNetworkManager.Instance.IsReady, () => Rebuild(scene)); + QSBCore.UnityEvents.RunWhen(() => QSBNetworkManager.singleton.IsReady, () => Rebuild(scene)); return; }