question

mbekeli minko maurice gabin avatar image
mbekeli minko maurice gabin asked

group/guild data read/write

I have a concern with the proper way to gathered data from a group.

I want to have multiple groups in my games with 10 members max by group, every group have a score base on the sum of every member of the group, and i want to know the best way to achieve this:

  • 1 idea: use a cloud script that execute when player update her score in her personal data, after updating his own score, the script get score in data of all members in the group of the player (include player), add up all score and write in group data score

  • 2 idea: when player update his own score, the script takes additional part of his score, and adds the score in group data and additional player score and write in group data

I want to know the best two ideas, if this idea is realizable, if it optimizes, or if there another way to reach it more easily.

if possible, help me with code to write (C#)

CloudScriptShared Group Datadata
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

·
Xiao Zha avatar image
Xiao Zha answered

Regarding what you're trying to achieve, first of all, PlayFab doesn't generate any events when a player updates their player data, so it can't trigger and execute your script. Moreover, even if the script is triggered, multiple players triggering it at the same time may cause concurrent data updates. This concurrency can lead to conflicts and potential errors in data updates. Therefore, to implement this functionality efficiently, you may want to consider using an external database.

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.