question

grahamwatson avatar image
grahamwatson asked

Getting all characters for all users

Hi,

Our game has a feature whereby a user can mark their characters as 'published' or 'unpublished'. It needs to be possible for a user to retrieve a list of all ''published' characters in the world (paged). How can I do this?

One thought was to use a character stat that is either 0 or 1, then use a 'last' aggregated leaderboard to retrieve the list. Is there a better way or would this work? Can I filter a leaderboard request to only return characters whose stat is '1'?

Thanks

Graham

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

·
Hernando avatar image
Hernando answered

Characters Leaderboard does not support Segments and Filtering.

But you only need to modify one thing in the solution to implement this function -- only update the statistics of the "published" characters, in other words, only the characters with "published" can be recorded in the leaderboard, because there are no statistics records for characters that have not yet called UpdateCharacterStatistics and the character will not appear in the leaderboard.

But what needs attention is the downside of this solution is that once the character is marked as "published", it can't be modified back.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]