Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Kim Strasser · 3 days ago · Leaderboards and Statistics

How can I find out which leaderboards are currently active?

For example:

I have 10 levels in my game and I have one leaderboard for each of these 10 levels in my titles account. Reset frequency is manually. Now I want to create weekly tournaments/leaderboards for only 3 of these 10 levels so that the players can add their scores on those 3 active leaderboards. When the next leaderboard reset happens on these 3 leaderboards, then it shouldn't be possible for the players to add their score on these leaderboards. I want to change the active leaderboards every week. It should only be possible to add a score on an active leaderboard. Leaderboards should be active for one week, after that, they should be disabled until the next tournament starts.

In addition, I need to find out in the client or CloudScript which leaderboards are currently active and which leaderboards are not active. Because I need to know if the player can add his score to a certain leaderboard or not.

How can I find out in the client which leaderboards are currently active? Is it possible to use client API GetLeaderboard to get a list with the active leaderboards?

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by Sarah Zhang · 2 days ago

>> How can I find out in the client which leaderboards are currently active? Is it possible to use client API GetLeaderboard to get a list with the active leaderboards?

PlayFab Leaderboard doesn’t have the states like “active”, so you can’t use client API to get the leaderboard list you specified. Besides, for clarification, the API GetLeaderboard is designed to retrieve a list of ranked users for the given statistic, it can’t be used to get the leaderboard list.

You can use the CloudScript and TitleData to achieve the feature. You can store the active leaderboard’s name in the TitleData and let players only can update the statistics via CloudScript. To forbid the players to upload the statistics via Client API, please navigate to [Game Manager]->[Title Settings]->[API Features], uncheck the option [Allow clients to post player statistics]. The CloudScript function can find out the active Leaderboard via getting TitleData, and post the player statistics via calling server API UpdatePlayerStatistics.

In addition, if your active leaderboard is changed regularly, you can consider using Schedule Task to trigger a CloudScript Function to change the corresponding TitleData.

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kim Strasser · 2 days ago 0
Share

Is it possible to create a leaderboard in Azure Functions at a given time?

For example: I want to create a tournament that lasts 1 week and starts on Monday, January 18, 2021 at 00:00 and ends on Sunday, January 24, 2021.

I want to use Scheduled Tasks to execute an Azure function that creates a leaderboard with admin API CreatePlayerStatisticDefinition. I have already created the Azure function but I don't know how to use Scheduled Tasks so that the Azure function gets called at the correct date and time.

How can I use Scheduled Tasks so that the leaderboard starts on Monday, January 18, 2021 at 00:00? What Cron expression should I use for the date and time?

bildschirmfoto-2021-01-14-um-183440.png (204.3 kB)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    How to get player Leaderboard information 1 Answer

    Leaderboard get my Rank in all Global Players 1 Answer

    UpdatePlayerStatistics - any way to send doubles instead of ints?,Update Player Statistics - how to send doubles instead of ints? 1 Answer

    Is there a way to get a Leaderbord by a list of PlayerIds? 1 Answer

    Cloudscript update multiple statistics 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges