mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
This reverts commit 32fdd5215f
.
This commit is contained in:
parent
c3bd1f2798
commit
24033c101b
@ -532,12 +532,9 @@ public void StopHost()
|
||||
/// <summary>Stops the server from listening and simulating the game.</summary>
|
||||
public void StopServer()
|
||||
{
|
||||
// return if already stopped to avoid recursion deadlock
|
||||
if (!isNetworkActive)
|
||||
if (!NetworkServer.active)
|
||||
return;
|
||||
|
||||
//Debug.Log("NetworkManager StopServer");
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnServerAuthenticated.RemoveListener(OnServerAuthenticated);
|
||||
@ -556,10 +553,10 @@ public void StopServer()
|
||||
SceneManager.MoveGameObjectToScene(gameObject, SceneManager.GetActiveScene());
|
||||
#pragma warning restore 618
|
||||
|
||||
isNetworkActive = false;
|
||||
|
||||
OnStopServer();
|
||||
|
||||
//Debug.Log("NetworkManager StopServer");
|
||||
isNetworkActive = false;
|
||||
NetworkServer.Shutdown();
|
||||
|
||||
// set offline mode BEFORE changing scene so that FinishStartScene
|
||||
@ -579,12 +576,6 @@ public void StopServer()
|
||||
/// <summary>Stops and disconnects the client.</summary>
|
||||
public void StopClient()
|
||||
{
|
||||
// return if already stopped to avoid recursion deadlock
|
||||
if (!isNetworkActive)
|
||||
return;
|
||||
|
||||
//Debug.Log("NetworkManager StopClient");
|
||||
|
||||
if (authenticator != null)
|
||||
{
|
||||
authenticator.OnClientAuthenticated.RemoveListener(OnClientAuthenticated);
|
||||
@ -603,10 +594,11 @@ public void StopClient()
|
||||
SceneManager.MoveGameObjectToScene(gameObject, SceneManager.GetActiveScene());
|
||||
#pragma warning restore 618
|
||||
|
||||
isNetworkActive = false;
|
||||
|
||||
OnStopClient();
|
||||
|
||||
//Debug.Log("NetworkManager StopClient");
|
||||
isNetworkActive = false;
|
||||
|
||||
// shutdown client
|
||||
NetworkClient.Disconnect();
|
||||
NetworkClient.Shutdown();
|
||||
|
Loading…
Reference in New Issue
Block a user