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
Answer by Brendan · Jun 22, 2018 at 07:08 AM
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?
Answer by andrestallos · Jun 22, 2018 at 06:34 PM
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 //...
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.
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!
Get players in segment count Via cloud script and update title data 1 Answer
title_player_account PlayFabId does not work with cloud script 1 Answer
GetObjects/SetObjects InternalError 1 Answer
Request timeout 3 Answers
How am I supposed to connect more than 100-1k players to the Servers 2.0? 1 Answer