diff --git a/APITestMod/IQSBAPI.cs b/APITestMod/IQSBAPI.cs index f6311c54..7fe3b560 100644 --- a/APITestMod/IQSBAPI.cs +++ b/APITestMod/IQSBAPI.cs @@ -21,16 +21,6 @@ public interface IQSBAPI /// bool GetIsInMultiplayer(); - /// - /// Invoked on the host when the server is first started. - /// - UnityEvent OnStartHost(); - - /// - /// Invoked on the host when the server is closed. - /// - UnityEvent OnStopHost(); - #endregion #region Player diff --git a/QSB/API/IQSBAPI.cs b/QSB/API/IQSBAPI.cs index f6311c54..7fe3b560 100644 --- a/QSB/API/IQSBAPI.cs +++ b/QSB/API/IQSBAPI.cs @@ -21,16 +21,6 @@ public interface IQSBAPI /// bool GetIsInMultiplayer(); - /// - /// Invoked on the host when the server is first started. - /// - UnityEvent OnStartHost(); - - /// - /// Invoked on the host when the server is closed. - /// - UnityEvent OnStopHost(); - #endregion #region Player diff --git a/QSB/API/QSBAPI.cs b/QSB/API/QSBAPI.cs index a70304d2..a8cf3503 100644 --- a/QSB/API/QSBAPI.cs +++ b/QSB/API/QSBAPI.cs @@ -19,9 +19,6 @@ public class QSBAPI : IQSBAPI public bool GetIsHost() => QSBCore.IsHost; public bool GetIsInMultiplayer() => QSBCore.IsInMultiplayer; - public UnityEvent OnStartHost() => QSBAPIEvents.OnStartHostEvent; - public UnityEvent OnStopHost() => QSBAPIEvents.OnStopHostEvent; - public uint GetLocalPlayerID() => QSBPlayerManager.LocalPlayerId; public string GetPlayerName(uint playerId) => QSBPlayerManager.GetPlayer(playerId).Name; public uint[] GetPlayerIDs() => QSBPlayerManager.PlayerList.Select(x => x.PlayerId).ToArray(); @@ -51,7 +48,4 @@ internal static class QSBAPIEvents internal static readonly PlayerEvent OnPlayerJoinEvent = new(); internal static readonly PlayerEvent OnPlayerLeaveEvent = new(); - - internal static readonly UnityEvent OnStartHostEvent = new(); - internal static readonly UnityEvent OnStopHostEvent = new(); } diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index ca6e9826..2cf83cbe 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -403,15 +403,8 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart base.OnServerDisconnect(conn); } - public override void OnStartServer() - { - QSBAPIEvents.OnStartHostEvent.Invoke(); - base.OnStartServer(); - } - public override void OnStopServer() { - QSBAPIEvents.OnStopHostEvent.Invoke(); DebugLog.DebugWrite("OnStopServer", MessageType.Info); Destroy(GetComponent()); DebugLog.ToConsole("Server stopped!", MessageType.Info);