question

sking avatar image
sking asked

How to allocate a prize table to all players in the leaderboard

I want to run a cloud function for every single player in the leader board when it's reset, regardless of rank. How do I go about this? Should I set the From To rank arguments as 1-10000000000? Also, is there anywhere I can see what fields the context object will have that will be sent to my cloud function?

Also, I want to set their statistic myself via the cloud function. Will I encounter a race condition where Playfab will set the leaderboard statistic to 0 AFTER I manipulate the value myself?

Cheers

Leaderboards and Statistics
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

·
Gosen Gao avatar image
Gosen Gao answered

I want to run a cloud function for every single player in the leader board when it's reset, regardless of rank. How do I go about this? Should I set the From To rank arguments as 1-10000000000?

The Prize Table only support to take action to top 1000 players in a Leaderboard, for more info about limits you can navigate to [Title Settings]->[Limits].

Also, is there anywhere I can see what fields the context object will have that will be sent to my cloud function?

You can create a test Leaderboard and reset it to trigger the Prize Table action which will execute a Cloud Script and has “Publish results as PlayStream Event” option selected. Then you can log the context in that Cloud Script and check the context in the Data Explorer.

Also, I want to set their statistic myself via the cloud function. Will I encounter a race condition where Playfab will set the leaderboard statistic to 0 AFTER I manipulate the value myself?

The action is triggered after the PlayFab has reset the statistic, so the situation won’t happen.

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.