mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50: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.
|
||||
OnStartHost();
|
||||
|
||||
// ConnectHost needs to be called BEFORE server changes scene.
|
||||
// otherwise FinishLoadScene doesn't know that we are in host mode.
|
||||
// TODO move this into FinishStartHost! (and test if it still works)
|
||||
//
|
||||
// ConnectHost needs to be called BEFORE SpawnObjects:
|
||||
// https://github.com/vis2k/Mirror/pull/1249/
|
||||
@ -915,17 +914,17 @@ void FinishLoadScene()
|
||||
Transport.activeTransport.enabled = true;
|
||||
|
||||
// host mode?
|
||||
if (NetworkClient.active && NetworkServer.active)
|
||||
if (mode == NetworkManagerMode.Host)
|
||||
{
|
||||
FinishLoadSceneHost();
|
||||
}
|
||||
// server-only mode?
|
||||
else if (NetworkServer.active)
|
||||
else if (mode == NetworkManagerMode.ServerOnly)
|
||||
{
|
||||
FinishLoadSceneServerOnly();
|
||||
}
|
||||
// client-only mode?
|
||||
else if (NetworkClient.active)
|
||||
else if (mode == NetworkManagerMode.ClientOnly)
|
||||
{
|
||||
FinishLoadSceneClientOnly();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user