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 joeypc6 · Feb 14, 2018 at 12:41 PM · apisPlayer Datagame managerPlayStream

Repeat Every period of time

I want My Game To Give Every Player Amount of items every X Time (2 Types)

- When They Login Today Next Day They Get 64 Wood Or Currency

- When They Don't Login They Get Daily Gift

(The Reset Time Will Be 0:00)

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 pfnathan · Feb 14, 2018 at 09:48 PM

Use of Scheduled tasks and segmentation can accomplish your need.

You could make a "lapsed Players" segment that has a login time above a certain amount. There can be a cloud trigger to do an action or run a cloud script every time they enter that segment.Also, scheduled tasks could run every day for an active players segment to give an item to everybody in that segment. However, it's probably better to have every player run a cloud script every time they log in, which checks the duration since their last login, rather than a daily scheduled task.

Please take a look at forum question about similar topic as well.

https://community.playfab.com/questions/78/205460028-Cloudscript-for-daily-reward.html

and here for the daily reward that uses regenerating currency.

https://community.playfab.com/idea/14304/add-ability-to-reset-virtual-currency-timer.html

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 Brendan ♦♦ · Feb 15, 2018 at 12:14 AM 0
Share

Yes, I'll second that and add a bit more context. Bear in mind that Scheduled Tasks don't run at infinite speed. So the more players you're processing, the longer it's going to take. That can mean a significant lag between the first and the last, if you have a large player base. Also, taking actions for players that aren't coming back anymore isn't particularly useful. Taking the action when the player logs in will make sure that the gift is always there when they sign in, if enough time has passed.

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

    Saving data in Unity on Pause/Quit/Lose Focus 1 Answer

    Simple inventory for a card game 1 Answer

    Azure Functions in Unity 1 Answer

    Referral system by code in the game. 1 Answer

    PurchaseItem - ServiceUnavailable/BadRequest 1 Answer

    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