Skip to content

Commit 8e2db51

Browse files
committed
Added OnServerStarted callback
1 parent 0622ca7 commit 8e2db51

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

MLAPI/MonoBehaviours/Core/NetworkingManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public bool isHost
4545
public bool IsClientConnected;
4646
public Action OnClientConnectedCallback = null;
4747
public Action OnClientDisconnectCallback = null;
48+
public Action OnServerStarted = null;
4849

4950
public NetworkingConfiguration NetworkConfig;
5051

@@ -202,6 +203,9 @@ public void StartServer(NetworkingConfiguration netConfig)
202203
isServer = true;
203204
isClient = false;
204205
isListening = true;
206+
207+
if (OnServerStarted != null)
208+
OnServerStarted.Invoke();
205209
}
206210

207211
public void StartClient(NetworkingConfiguration netConfig)
@@ -271,6 +275,9 @@ public void StartHost(NetworkingConfiguration netConfig)
271275
{
272276
SpawnManager.SpawnPlayerObject(-1, 0);
273277
}
278+
279+
if (OnServerStarted != null)
280+
OnServerStarted.Invoke();
274281
}
275282

276283
private void OnEnable()

0 commit comments

Comments
 (0)