question

andy-3 avatar image
andy-3 asked

title_player_account PlayFabId does not work with cloud script

We are transitioning to using the title_player_account PlayFabId for the majority of our API calls. When we use the SetUserReadOnlyData client api it works, but when we try to make the same calls withing cloud script, it doesn't update. We don't receive any errors in CloudScript.

It's not throwing any errors, calls are succeeding, but Player Data (Title) isn't being updated

apisCloudScriptPlayer Data
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

·
v-humcin avatar image
v-humcin answered

Can you clarify which data you are trying to work with?

If you view a player in the game manager, the tab "Player Data (Title)" contains three types of data:

  • Player Data (Referred to as UserData in API calls)
  • Read Only Data (Referred to as UserReadOnlyData in API calls)
  • Internal Data

Each of these is distinct and there may be a chance that they are being mixed up. There is no SetUserReadOnlyData Client API call, as updating Read Only Data is restricted to the UpdateUserReadOnlyData API call available in the Server and Admin API.

Are you possibly using the UpdateUserData Client API call on the client and the UpdateUserReadOnlyData Server API call in the cloud script, this could explain why the cloud script is not updating the same data as the client?

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.

andy-3 avatar image andy-3 commented ·

From CloudScript, GetUserReadOnlyData and UpdateUserReadOnlyData are being used and are not working with title_player_account PlayFabId.

From the client, PlayFabClientAPI.GetUserData and PlayFabClientAPI.UpdateUserData are used.
sometimes from the client they work with title_player_account PlayFabId, sometimes they do not.

The same calls that work with master_player_account PlayFabId are not working with player_title_account PlayFabId. @Kirk_Moonlight

0 Likes 0 ·
v-humcin avatar image v-humcin ♦ andy-3 commented ·

The master_player_account PlayFabId is required for thePlayFabClientAPI.GetUserData and PlayFabClientAPI.UpdateUserData API calls, along with the other calls that affect "Player Data". The title_player_account id cannot be used for this purpose and is instead used for the Entity APIs specifically, such as the Groups API.

The Client API is part of the "Classic APIs" which are not built upon the newer entity system, so you will not be able to use the title_player_account for calls from this API. The Server and Admin APIs are also "Classic APIs".

For data storage you may be interested in the Data API as this will allow you to store data using the title_player_account. This is a quickstart guide that can help you with storing data in the Data API using "Entity Objects" and "Entity Files": https://docs.microsoft.com/en-us/gaming/playfab/features/data/entities/quickstart

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.