mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkManager: Consolidated two if's in OnClientDisconnectInternal
This commit is contained in:
parent
7eb3dd3198
commit
d8f06b2922
@ -1283,11 +1283,18 @@ void OnClientDisconnectInternal()
|
||||
// shutdown client
|
||||
NetworkClient.Shutdown();
|
||||
|
||||
// If we're in ServerOnly mode now, StopClient was called for host client.
|
||||
// We need to reset clientStarted to false so that when we return to
|
||||
// Host mode, we properly respawn objects from StartClient again.
|
||||
if (mode == NetworkManagerMode.ServerOnly)
|
||||
{
|
||||
foreach (NetworkIdentity identity in NetworkServer.spawned.Values)
|
||||
identity.clientStarted = false;
|
||||
|
||||
// Exit here if we're now in ServerOnly mode (StopClient called in Host mode).
|
||||
if (mode == NetworkManagerMode.ServerOnly) return;
|
||||
// This allows the server to keep running without the host client, keeping remote clients connected.
|
||||
return;
|
||||
}
|
||||
|
||||
// Get Network Manager out of DDOL before going to offline scene
|
||||
// to avoid collision and let a fresh Network Manager be created.
|
||||
|
Loading…
Reference in New Issue
Block a user