question

John Peterson avatar image
John Peterson asked

CustomTags on the player_ranked_on_leaderboard_version Event.

Dear PlayFab community,

I'm trying to synchronize some metadata whenever a player makes it on the Leaderboard, and one of my challenges was determining whether the new Value would result in a "winner" for a MAX-aggregate Leaderboard. (See this post.)

@Brendan suggested that maybe I could leverage the Event that gets fired whenever the Leaderboard is updated by a call that would result in a new winner. In doing a bit of digging around, I discovered the Event in question is the player_ranked_on_leaderboard_version Event.

This Event had the following payload in my testing:

{
    "EventName": "player_ranked_on_leaderboard_version",
    "Rank": 1,
    "Value": 51,
    "Version": 0,
    "VersionChangeBehavior": "ResetValues",
    "LeaderboardSource": {
        "Statistic": {
            "StatisticName": "Score_Infinite_3_Weekly",
            "StatisticId": 1305850938
        }
    },
    "EventNamespace": "com.playfab",
    "EntityType": "player",
    "Source": "PlayFab",
    "TitleId": "44B1",
    "EntityId": "7FCA1F1E8157A6D5",
    "EventId": "d8cd8e51251a44d2b0c342d609a07a68",
    "SourceType": "BackEnd",
    "Timestamp": "2018-04-23T00:02:07.8910772Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null
}

I noticed the CustomTags field, which would be *ideal* for me to add some context to the Event. However, I don't know how I would set this when invoking UpdateStatistics(). Is this possible to populate that CustomTags for the Event in some manner?

Thanks for any help anyone can provide!

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

·
brendan avatar image
brendan answered

So, to be clear, my recommendation was that since the profile is returned with the leaderboard, you could use elements of the profile (other stats, Tags, etc.) to get rich data for your leaderboard display. Now, while you can't use CustomTags (that's actually a generic property of the PlayStream events, and it's used for custom data from the event provider in cases where that's needed - like a third-party integration with additional data), if what you want to do is put some info into the player profile (again, using other stats, Tags, etc.) when the leaderboard resets (which is what generates the version event), you could use a Prize Table to trigger some Cloud Script logic for the top player or players.

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.