Added OnServerStarted callback

This commit is contained in:
Albin Corén 2018-03-28 17:38:00 +02:00
parent 0622ca7a37
commit 8e2db5131a

View File

@ -45,6 +45,7 @@ namespace MLAPI
public bool IsClientConnected;
public Action OnClientConnectedCallback = null;
public Action OnClientDisconnectCallback = null;
public Action OnServerStarted = null;
public NetworkingConfiguration NetworkConfig;
@ -202,6 +203,9 @@ namespace MLAPI
isServer = true;
isClient = false;
isListening = true;
if (OnServerStarted != null)
OnServerStarted.Invoke();
}
public void StartClient(NetworkingConfiguration netConfig)
@ -271,6 +275,9 @@ namespace MLAPI
{
SpawnManager.SpawnPlayerObject(-1, 0);
}
if (OnServerStarted != null)
OnServerStarted.Invoke();
}
private void OnEnable()