question

andrestallos avatar image
andrestallos asked

GetPlayerCombinedInfoRequest no longer includes DisplayName in response

Hello,

We have recently noticed that the API call server.GetPlayerCombinedInfoRequest is no longer including the DisplayName in the response. We have been using this call in a cloudscript handler to let players check out a different player's profile, and it was working as expected until recently (one or two days ago, we aren't sure).

We set the GetPlayerProfile flag in the request as true, and we do get the PlayerProfile in the response, but it does not include the DisplayName. It does include PublisherId, TitleId, PlayerId and LastLogin.

For now, we have implemented a workaround adding another API call, server.GetPlayerProfile, which does include the DisplayName in the response, but this is obviously inefficient.

As I mentioned, it was all working fine until recently, and now it's failing consistently (and we haven't touched our code). I haven't seen any note about this in the release notes, so I'm flagging this in case there's a bug somewhere!

Cheers

apisPlayer DataCloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

We haven't actually changed any of the code for that API in some time. Can you let us know the Title ID, the PlayFab ID of the user you're querying, and the specific values you're passing into the call?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

andrestallos avatar image
andrestallos answered

It is happening in all our titles (for example 8A42), and for all players. Say player 7815908F20BAF70F makes the cloudscript call, and passes 7B26A208FA72733F in args.Data.playerId, in the following cloudscript call:

handlers.OnGetOtherPlayerData = function(args)
{
var infoRequestParameters = new Object();
infoRequestParameters.GetUserVirtualCurrency = false;
infoRequestParameters.GetUserData = false;
infoRequestParameters.GetUserReadOnlyData = true;
infoRequestParameters.UserReadOnlyDataKeys = ["AchievementsData","AchievementsCurrentData","CosmeticData","GuildData","LevelData","Xp", "DailyCounters"];
infoRequestParameters.GetPlayerStatistics = true;
infoRequestParameters.PlayerStatisticNames = ["Rating","Xp"];
infoRequestParameters.GetPlayerProfile = true;
infoRequestParameters.ProfileConstraints = new Object();
infoRequestParameters.ProfileConstraints.ShowLastLogin = true;
var playerCombinedInfo = server.GetPlayerCombinedInfo({PlayFabId:args.Data.playerId, InfoRequestParameters:infoRequestParameters});
var playerCombinedData = playerCombinedInfo.InfoResultPayload;
log.info("playerCombinedData " + JSON.stringify(playerCombinedData));// Checking this result shows PlayerProfile data with all expected fields except DisplayName
var playerData = new Object();
playerData.playerName = playerCombinedData.PlayerProfile.DisplayName; // This used to get the displayname correctly, but now is empty
//...
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

The profile constraints requested *by setting the relevant parameter to true) are the only ones returned. So unless you set ShowDisplayName to true in ProfileConstraints, it cannot be returned.

0 Likes 0 ·
andrestallos avatar image andrestallos brendan commented ·

Ooops! You are absolutely right, I don't know how we missed that. Setting ShowDisplayName to true gets it working perfectly.

I'm pretty sure that it was somehow working before, without having to add that line, but in any case this is indeed how I understand it should work according to the documentation.

Thank you for looking into it, and sorry for the mistake!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.