Skip to content

Commit

Permalink
fix: client disconnected on server event never raised (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymdun committed Mar 29, 2020
1 parent 36bb3a2 commit 9d9efa0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Assets/Mirror/Runtime/NetworkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ public void OnAuthenticated(NetworkConnectionToServer conn)
/// </summary>
public void Disconnect()
{
connectState = ConnectState.Disconnected;

// local or remote connection?
if (isLocalClient)
{
Expand All @@ -290,6 +288,9 @@ public void Disconnect()
RemoveTransportHandlers();
}
}
// set connectState as Disconnected after, otherwise Disconnected event is never raised
connectState = ConnectState.Disconnected;

HandleClientDisconnect();
}

Expand Down

0 comments on commit 9d9efa0

Please sign in to comment.