Display name not updating on clients

Hi,

I have an issue with the lobby where the clients only see their display name and only the host seems them all. The Player object on the client has an empty field for the display name when looking at it during runtime. It looks like the client cannot update the name since it has no authority over the object.

This is how it looks:

I have compared the RTSNetworkManager and the RTSPlayer sourcecode with the election state and don’t see any differences that could cause this.

Hi There,

Can you share your LobbyMenu script?

The first place I would look is the event subscriptions there.

private void Start() 
{
    RTSNetworkManager.ClientOnConnected += HandleClientConnected;
    RTSPlayer.AuthorityOnPartyOwnerStateUpdated += AuthorityHandlePartOwnerStateUpdated;
    RTSPlayer.ClientOnInfoUpdated += ClientHandleInfoUpdated;
}

private void OnDestroy() 
{
    RTSNetworkManager.ClientOnConnected -= HandleClientConnected;
    RTSPlayer.AuthorityOnPartyOwnerStateUpdated -= AuthorityHandlePartOwnerStateUpdated;
    RTSPlayer.ClientOnInfoUpdated -= ClientHandleInfoUpdated;
}

Make sure all the event names are correct and the “+” and “-” are correct.

Also, I would put a Debug.Log in the ClientHandleInfoUpdated() method and see if it’s getting called on the client. You will need to run the client in the editor to check this.

Ok, I figured out the issue. I set the RTSPlayer sync setting to “Owner” and not “Observer”.
Since the object contains the list of units and buildings, I thought it is not good to have this information sync to every client, since it should not be known to the other players.
So, I might need to split out the public and the private information into different classes, to achieve this kind of separation.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms