question

Jakub Smekal avatar image
Jakub Smekal asked

Can't get Display name through entity API

Hello,

I am trying to get Title Display name of current player, which is properly set in Game manager.

The first approach works, but the second doesn't. Is there something I misunderstood or is it a bug?

server.GetPlayerProfile({ PlayFabId: currentPlayerId }).PlayerProfile.DisplayName; // -> returns correct name


var accountInfoResult = server.GetUserAccountInfo({ PlayFabId: currentPlayerId });
entity.GetProfile({ Entity: accountInfoResult.UserInfo.TitleInfo.TitlePlayerAccount }).Profile.DisplayName; // -> returns undefined
  
CloudScriptentities
10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

server.GetPlayerProfile retrieves player profile in the classic model, and, in your case, entity.GetProfile retrieves that player’s title_player_account entity profile, which is in the new entity model. Currently, these two models are independent of each other, which means that right now they don’t share the same data model. That's the reason why the second approach fails.

10 |1200

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

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]