Sign In Register

How can we help you today?

Start a new topic

Get leaderboard entries by Team Type through Cloud Code


I've made a cloud code script to fetch leaderboard entries, and have recreated pretty much all functionality from the regular leaderboard request API calls, except for filtering based on Team Types (i.e. get a social leaderboard with entries from players that belong to one or more of the specified team types).

There is the function Spark.getLeaderboards().getTeamLeaderboard(shortCode, teamIds), but this allows only to specify team *ids*, not team *types*.

Practical use case: In my system, each player has two teams, Guilds and Friends. I want to be able to show the player how their friends are ranked, while excluding members of their Guild, which are shown separately. 

I realize I can filter by the relevant Friends team id explicitly, but this means I have to fetch/cache it first, while the regular requests API seem to allow to blanket filter by team *type*...

So my question is: is there any way to filter leaderboard entries by team type using cloud code?

Also, side question: is having a custom cloud script going to significantly negatively impact performance over using the standard API requests?

Login to post a comment