Skip to content

Commit

Permalink
fix: Remove leftover AddPlayer methods now that extraData is gone (#1…
Browse files Browse the repository at this point in the history
…751)
  • Loading branch information
MrGadget committed Apr 21, 2020
1 parent 6e03a53 commit 2d006fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
17 changes: 1 addition & 16 deletions Assets/Mirror/Runtime/ClientScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,13 @@ internal static void InternalAddPlayer(NetworkIdentity identity)
}
}

/// <summary>
/// This adds a player GameObject for this client.
/// <para>This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called.</para>
/// </summary>
/// <returns>True if player was added.</returns>
public static bool AddPlayer() => AddPlayer(null);

/// <summary>
/// This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.
/// </summary>
/// <param name="readyConn">The connection to become ready for this client.</param>
/// <returns>True if player was added.</returns>
public static bool AddPlayer(NetworkConnection readyConn) => AddPlayer(readyConn, null);

/// <summary>
/// This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.
/// <para>extraMessage can contain character selection, etc.</para>
/// </summary>
/// <param name="readyConn">The connection to become ready for this client.</param>
/// <param name="extraData">An extra message object that can be passed to the server for this player.</param>
/// <returns>True if player was added.</returns>
public static bool AddPlayer(NetworkConnection readyConn, byte[] extraData)
public static bool AddPlayer(NetworkConnection readyConn)
{
// ensure valid ready connection
if (readyConn != null)
Expand Down
4 changes: 2 additions & 2 deletions Assets/Mirror/Runtime/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ public virtual void OnClientConnect(NetworkConnection conn)
if (!ClientScene.ready) ClientScene.Ready(conn);
if (autoCreatePlayer)
{
ClientScene.AddPlayer();
ClientScene.AddPlayer(conn);
}
}
}
Expand Down Expand Up @@ -1442,7 +1442,7 @@ public virtual void OnClientSceneChanged(NetworkConnection conn)
if (clientSceneOperation == SceneOperation.Normal && autoCreatePlayer && ClientScene.localPlayer == null)
{
// add player if existing one is null
ClientScene.AddPlayer();
ClientScene.AddPlayer(conn);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Mirror/Runtime/NetworkManagerHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void OnGUI()

if (ClientScene.localPlayer == null)
{
ClientScene.AddPlayer();
ClientScene.AddPlayer(NetworkClient.connection);
}
}
}
Expand Down

0 comments on commit 2d006fe

Please sign in to comment.