mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
FinishLoadScene uses new NetworkManager.mode. This way the host connection doesn't need to be connected before changing host server's online scene. This makes everything easier.
This commit is contained in:
commit
3eb11c9a2d
@ -502,8 +502,7 @@ public virtual void StartHost()
|
|||||||
// is called after the server is actually properly started.
|
// is called after the server is actually properly started.
|
||||||
OnStartHost();
|
OnStartHost();
|
||||||
|
|
||||||
// ConnectHost needs to be called BEFORE server changes scene.
|
// TODO move this into FinishStartHost! (and test if it still works)
|
||||||
// otherwise FinishLoadScene doesn't know that we are in host mode.
|
|
||||||
//
|
//
|
||||||
// ConnectHost needs to be called BEFORE SpawnObjects:
|
// ConnectHost needs to be called BEFORE SpawnObjects:
|
||||||
// https://github.com/vis2k/Mirror/pull/1249/
|
// https://github.com/vis2k/Mirror/pull/1249/
|
||||||
@ -915,17 +914,17 @@ void FinishLoadScene()
|
|||||||
Transport.activeTransport.enabled = true;
|
Transport.activeTransport.enabled = true;
|
||||||
|
|
||||||
// host mode?
|
// host mode?
|
||||||
if (NetworkClient.active && NetworkServer.active)
|
if (mode == NetworkManagerMode.Host)
|
||||||
{
|
{
|
||||||
FinishLoadSceneHost();
|
FinishLoadSceneHost();
|
||||||
}
|
}
|
||||||
// server-only mode?
|
// server-only mode?
|
||||||
else if (NetworkServer.active)
|
else if (mode == NetworkManagerMode.ServerOnly)
|
||||||
{
|
{
|
||||||
FinishLoadSceneServerOnly();
|
FinishLoadSceneServerOnly();
|
||||||
}
|
}
|
||||||
// client-only mode?
|
// client-only mode?
|
||||||
else if (NetworkClient.active)
|
else if (mode == NetworkManagerMode.ClientOnly)
|
||||||
{
|
{
|
||||||
FinishLoadSceneClientOnly();
|
FinishLoadSceneClientOnly();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user