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 kesyas · Jan 27 at 09:51 AM ·

​default statistic??

My game is using statistic based matching.

So, when I reset a specific leaderboard, I need to reset the statistic to 1000(not delete) to get the user when i call getAroundLeaderBoard.

When I reset the leaderboard,

1. is there a way to make the statistic of all players in the leaderboard to 1000 (not delete)?

It doesn't seem like a good way to set it like the rank of the prize table from 1 to 99999.

that is, a method of initializing the statistic of all players to a specific non-null number by catching the leaderboard reset timing of a specific "statistic".

2.In the leaderboard that resets every week, players within a certain range must be rewarded

(not rank 1~xx)

That is, 1000~1250 (bronze) 1250~1500(silver) etc.. A certain reward must be granted for each segment.

but prize table seems to give a reward as a rank number.

How do I put players in a certain section, and how do I bring in all the players in that section and grant them a reward?

scenario:

When the leaderboard is reset, rewards are granted to players in each section, rewarded once when entering each section, and then set back to the default stat value (1000)

thanks!

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
Best Answer

Answer by Sarah Zhang · Jan 28 at 10:22 AM

>> Is there a way to make the statistic of all players in the leaderboard to 1000 (not delete)?

Yes, you can use CloudScript and Scheduled Tasks to achieve it. Scheduled tasks are a way to automate common game operation routines. Automated tasks can take predefined actions or execute CloudScript, which enables any custom server-side functionality you want to implement. To implement your requirement, you can create a CloudScript function that calls server API UpdatePlayerStatistics, then execute it for the “All Player” segment in the Scheduled Tasks. You can use this scheduled task as your custom “reset” plan. Please check this documentation for the details about how to create the Scheduled Tasks.

handlers.updateStatistics = function (args, context) {

    var request = {
        PlayFabId: currentPlayerId,
        Statistics: [{
            StatisticName: "Your statistic name",
            Value: 1000
        }]
    };

    var result = server.UpdatePlayerStatistics(request);
    return result;
};

>> How do I put players in a certain section?

As this section said, segment filtering allows you to define what players are included in the segment. You can define the “Statistic Value” filter to put player in the specific segment.

>> How do I bring in all the players in that section and grant them a reward?

As the first answer said, you can achieve it using Scheduled Task. You can add the reward methods in the CloudScript function and execute it for the corresponding segments in the Scheduled Task.

Comment

People who like this

0 Show 2 · 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 kesyas · Feb 04 at 03:35 PM 0
Share

Thank you for a detailed description.!

If so, should the leaderboard reset period and the scheduled task reccurring value be synchronized?

Is it not connected but, should I set each value separately and set it as occurring at the same time?

avatar image Sarah Zhang ♦ kesyas · Feb 09 at 09:50 AM 0
Share

Yes, they should be synchronized. You can execute the scheduled task after you reset the leaderboard. Since the execution of the scheduled task would take some time, we would suggest you design the settlement time for your leaderboard. For example, you can close the current leaderboard at 2:00 a.m., then start the next leaderboard at 4:00 a.m. In the settlement time, you can disable updates of statistics.

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

    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