Using the PlayFab Party SDK for Unity, how can I get a remote player's display name? (e.g., for a lobby UI).
I'm trying to retrieve the display name using the enitity key and type on the remote player's PlayFabPlayer object along with the local player's session ticket, but the GetPlayerCombinedInfo API always returns the display name of the local player, even when passing the entity key and type of the remote player.
private void OnNetworkJoined(object sender, string networkId) { var player = PlayFabMultiplayerManager.Get().LocalPlayer; AddPlayer(player); } private void OnRemotePlayerJoined(object sender, PlayFabPlayer player) { AddPlayer(player); } private void AddPlayer(PlayFabPlayer player) { var sessionTicket = FindObjectOfType<UserInfo>().LoginResult.SessionTicket; Debug.Log(player.EntityKey.Id + " - " + player.EntityKey.Type); PlayFabClientAPI.GetPlayerCombinedInfo( new GetPlayerCombinedInfoRequest { AuthenticationContext = new PlayFabAuthenticationContext { EntityId = player.EntityKey.Id, EntityType = player.EntityKey.Type, EntityToken = player._entityToken, ClientSessionTicket = sessionTicket }, InfoRequestParameters = new GetPlayerCombinedInfoRequestParams { GetUserAccountInfo = true } }, (GetPlayerCombinedInfoResult result) => { var username = result.InfoResultPayload.AccountInfo.TitleInfo.DisplayName; username = username ?? player._platformSpecificUserId; _playerNames.Add(player, username); OnPlayerAdded.Invoke(username); }, (PlayFabError error) => { Debug.LogError("Error retrievering username for player."); Debug.LogError(error); }); }