mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
explain StartHost
This commit is contained in:
parent
9d9625b42f
commit
11586a4177
@ -435,6 +435,24 @@ void StartHostClient()
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void StartHost()
|
public virtual void StartHost()
|
||||||
{
|
{
|
||||||
|
// StartHost is inherently ASYNCHRONOUS (=doesn't finish immediately)
|
||||||
|
//
|
||||||
|
// Here is what it does:
|
||||||
|
// Listen
|
||||||
|
// ConnectHost <= this should ideally happen after finishing scene load
|
||||||
|
// if onlineScene:
|
||||||
|
// LoadSceneAsync
|
||||||
|
// ...
|
||||||
|
// FinishLoadScene
|
||||||
|
// SpawnObjects
|
||||||
|
// else:
|
||||||
|
// SpawnObjects
|
||||||
|
// StartHostClient <= not guaranteed to happen after SpawnObjects if onlineScene is set!
|
||||||
|
//
|
||||||
|
// there is NO WAY to make it synchronous because both LoadSceneAsync
|
||||||
|
// and LoadScene do not finish loading immediately. as long as we
|
||||||
|
// have the onlineScene feature, it will be asynchronous!
|
||||||
|
|
||||||
// setup server first
|
// setup server first
|
||||||
SetupServer();
|
SetupServer();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user