private void SceneLoadedForPlayer(NetworkConnection conn, GameObject lobbyPlayerGameObject)
{
if (lobbyPlayerGameObject.GetComponent<NetworkLobbyPlayer>() != null)
{
if (LogFilter.logDebug)
{
Debug.Log(string.Concat(new object[] { "NetworkLobby SceneLoadedForPlayer scene:", Application.loadedLevelName, " ", conn }));
}
if (Application.loadedLevelName == this.m_LobbyScene)
{
PendingPlayer player2;
player2.conn = conn;
player2.lobbyPlayer = lobbyPlayerGameObject;
this.m_PendingPlayers.Add(player2);
}
else
{
short playerControllerId = lobbyPlayerGameObject.GetComponent<NetworkIdentity>().playerControllerId;
GameObject gamePlayer = this.OnLobbyServerCreateGamePlayer(conn, playerControllerId);
if (gamePlayer == null)
{
Transform startPosition = base.GetStartPosition();
if (startPosition != null)
{
gamePlayer = (GameObject) UnityEngine.Object.Instantiate(this.gamePlayerPrefab, startPosition.position, startPosition.rotation);
}
else
{
gamePlayer = (GameObject) UnityEngine.Object.Instantiate(this.gamePlayerPrefab, Vector3.zero, Quaternion.identity);
}
}
if (this.OnLobbyServerSceneLoadedForPlayer(lobbyPlayerGameObject, gamePlayer))
{
NetworkServer.ReplacePlayerForConnection(conn, gamePlayer, playerControllerId);
}
}
}
}