remove Host events

This commit is contained in:
_nebula 2023-08-02 20:38:21 +01:00
parent b45e38556c
commit e0aeb00c7b
4 changed files with 0 additions and 33 deletions

View File

@ -21,16 +21,6 @@ public interface IQSBAPI
/// </summary>
bool GetIsInMultiplayer();
/// <summary>
/// Invoked on the host when the server is first started.
/// </summary>
UnityEvent OnStartHost();
/// <summary>
/// Invoked on the host when the server is closed.
/// </summary>
UnityEvent OnStopHost();
#endregion
#region Player

View File

@ -21,16 +21,6 @@ public interface IQSBAPI
/// </summary>
bool GetIsInMultiplayer();
/// <summary>
/// Invoked on the host when the server is first started.
/// </summary>
UnityEvent OnStartHost();
/// <summary>
/// Invoked on the host when the server is closed.
/// </summary>
UnityEvent OnStopHost();
#endregion
#region Player

View File

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

View File

@ -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<RespawnOnDeath>());
DebugLog.ToConsole("Server stopped!", MessageType.Info);