question

Muhammad Roshaan Tariq avatar image
Muhammad Roshaan Tariq asked

Data Access of Other Players

Hi, I am building a multiplayer game in which at certain point I want to update the data of other players even if they are not present in the game at that time. Is there anyway I can do this?

Or If not, then can I create some custom table with custom attributes on Playfab where I can store the sharable data for players to access and update? And when there's a update in that table all players update themselve with new data

Player DatadataTitle DataShared Group 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

·
Seth Du avatar image
Seth Du answered

Sorry for previous answer. I seem to have misunderstood your needs.

It is feasible to query and update other players data. First you should know the usage of Player Data: https://docs.microsoft.com/en-us/gaming/playfab/features/data/playerdata/. As the player data, including player read-only data and player internal data, has permission configurations, you can choose any of them as public so that those data can be seen by other users via GetUserData Client API call:

Then, to change other Player's Player Data, you can implement functions in Cloud Script and the action can be easily done by Server APIs. However, be aware that before the change is performed, verification process is necessary so that it will ensure the changes on target player's player data is valid.

If you have seen the description of Title Data in my previous reply, please be aware that Title Data cannot be used to update things on a per-client basis.


8 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.

Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·
0 Likes 0 ·
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·

How can I call the cloud code of one player from another player? Is there any API function?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Muhammad Roshaan Tariq commented ·
0 Likes 0 ·
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq Seth Du ♦ commented ·

If you are providing the REST API for getting data and updating other's player data then why I need the cloud script for?

0 Likes 0 ·
Show more comments

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]