Skip to content

Commit

Permalink
fix: NetworkClient.Shutdown calls ClientScene.Shutdown again to prope…
Browse files Browse the repository at this point in the history
…rly clean up client scene. ClientScene only cleans up itself without touching transport or NetworkIdentities (fixes the bug where the player object wouldn't be destroyed after calling StopClient)
  • Loading branch information
miwarnec committed Apr 6, 2019
1 parent c691c07 commit fb716df
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions Assets/Mirror/Runtime/ClientScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ public static class ClientScene
// then the client's player object won't be removed after disconnecting!
internal static void Shutdown()
{
NetworkIdentity.spawned.Clear();
ClearSpawners();
pendingOwnerNetIds.Clear();
spawnableObjects = null;
readyConnection = null;
ready = false;
isSpawnFinished = false;

Transport.activeTransport.ClientDisconnect();
}

// this is called from message handler for Owner message
Expand Down
1 change: 1 addition & 0 deletions Assets/Mirror/Runtime/NetworkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ public static void UnregisterHandler(MsgType msgType)
public static void Shutdown()
{
if (LogFilter.Debug) Debug.Log("Shutting down client.");
ClientScene.Shutdown();
connectState = ConnectState.None;
}

Expand Down

0 comments on commit fb716df

Please sign in to comment.