List active tournaments
-
In the context of https://help.getbraincloud.com/en/articles/3248895-introduction-to-braincloud-global-tournaments and especially in the situation "If you implement concurrent tournaments, offer a means to cycle between them", how can I programatically query the current active tournaments?
-
Hi @richard,
Thats a good question. Often devs set up a set schedule for their tournaments - so the list of tournaments that could be active at any time is just "known".
[And to clarify - I assume that you are asking how you would know the active tournaments across all leaderboards. To get the state of tournaments on a specific leaderbord, you would use the GetTournamentStatus() call].
For more dynamic games - where the tournaments may be created dynamically (and programmatically) for liveops-related events - I don't think we have an API that easily lists them right now.
That said, we are looking into the best way to do this - because we'd actually like to add that sort of information to the new Calendar View (as introduced in 5.8). And of course, the use case you suggest is important too.
So we're actively looking at the best way to represent and query this - and will ensure there is API support for this as well.
So - rest assured - direct support for this use case is coming soon. We'll keep you posted!
Paul.
-
If runtime discovery is difficult, then I could use a fixed leaderboardId such as "monthly_event"
I experimented with that, and when a tournament is over I can call:
TournamentService.ViewReward("monthly_event", -1) and in the response see that tClaimedAt is 0but to actually claim the reward with ClaimTournamentReward I have to pass a specific versionId - how can I figure out which versions of the leaderboard the user has unclaimed rewards for? That's particularly difficult if a new iteration of the monthly event has already started.
More generally, we're evaluating switching from Firebase for a music game with thousands of songs. In the Firestore database it's easy to have leaderboards with secondary indexes for player country/region. I don't think Braincloud supports that so we're going to need tens of thousands of leaderboards with IDs such as "song_456_US" and "song_1234_CA". For that reason, I need to avoid any situation where I have to list and filter all leaderboards because it will be (I expect) too expensive ($) and/or too slow.
-
A little more progress - although passing a version ID of -1 to GetTournamentStatus() produces an error if a no tournament is running, I can instead call GetGlobalLeaderboardVersions() and then call GetTournamentStatus() individually for each returned version.
-
I'd also like to take advantage of the tournament's Custom JSON to store the file ID of a JPG image to be displayed in the game UI to promote the tournament (example: in December we'd ask users to play a Christmas-themed tournament and the image would be snowy) but I don't see how to edit the Custom JSON through the portal - is that only possible through with Cloud Code?
-