Skip to content

Commit

Permalink
fix: set authority when replacing the player
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Nov 30, 2019
1 parent c58ead1 commit 2195fee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Assets/Mirror/Runtime/NetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,13 @@ internal static bool InternalReplacePlayerForConnection(NetworkConnection conn,

//NOTE: DONT set connection ready.

// special case, we are in host mode, set hasAuthority to true so that all overrides see it
if (conn is ULocalConnectionToClient)
{
identity.hasAuthority = true;
ClientScene.InternalAddPlayer(identity);
}

// add connection to observers AFTER the playerController was set.
// by definition, there is nothing to observe if there is no player
// controller.
Expand Down

0 comments on commit 2195fee

Please sign in to comment.