Hi,
I use an override version of NetworkLobbyManager in order to spawn my playerPrefabs.
The NetworkIdentity.localPlayerAuthority flag of the playerPrefab is set.
According to my own understanding of the documentation, at runtime, the NetworkIdentity.clientAuthorityOwner attribut of the spawned playerPrefabs should be set.
But the probleme is : they are not. Is that a bug ?
My unity version is 5.2.0f3
EDIT :
Providing help without source code is not easy. I reproduced the issue on this minimalistic project : [55148-test-cltauthowner.zip|55148]. In this sample, the NetworkLobbyManager is not an override, but the behaviour remains the same.
When the players are ready the “XXX : clientAuthorityOwner is null” message is printed indefinitely (where XXX is “ServerSide” or “ClientSide” depending on which one is launched on the editor).
For those (like me) how don’t trust zip files on a web page, here is a description of the project setting :
The gameScene :
The default unity scene scene
The lobbyScene :
The PlayerBehaviour Script :
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class TEST_PlayerBehaviour : NetworkBehaviour {
void Update()
{
//Retreive the NetworkIdentity on runtime
NetworkIdentity networkIdentity = GetComponent<NetworkIdentity>();
//Display clientAuthorityOwner on server side
if (isServer)
{
if (networkIdentity.clientAuthorityOwner != null)
{
Debug.Log("ServerSide : " + networkIdentity.clientAuthorityOwner.ToString());
}
else
{
Debug.Log("ServerSide : clientAuthorityOwner is null");
}
}
//Display clientAuthorityOwner on client side
else
{
if (networkIdentity.clientAuthorityOwner != null)
{
Debug.Log("ClientSide : " + networkIdentity.clientAuthorityOwner.ToString());
}
else
{
Debug.Log("ClientSide : clientAuthorityOwner is null");
}
}
}
}
Thanks for your help.