Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

(HELP!) Internet time for Daily rewards feature.

Discussion in 'Scripting' started by AlexCarrington, Mar 21, 2019.

  1. AlexCarrington

    AlexCarrington

    Joined:
    Apr 9, 2015
    Posts:
    21
    Hello Unity Developers,

    I cant find anything straight forward about creating a daily rewards system with internet time.

    Is it even worth using internet time? Because if someones not using internet how would they get a reward?

    Is there any way to receive internet time with Unity? Without external servers? I have a website I could upload to but im not 100% familiar with the process.

    Please help! You guys are always useful! :)

    Thank you!
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,186
    Depending on how you plan to set it up, I would use something like Playfab which allows you to create cloud scripts. You can use these scripts to fetch a common time from Playfabs servers and use that to determine if you should give a reward or not. You could also save data to playfab to determine when they got their last reward. That way, everything dealing with rewards is stored server side and downloaded and checked when the game starts.

    But, that's just one way of dealing with this.
     
  3. AlexCarrington

    AlexCarrington

    Joined:
    Apr 9, 2015
    Posts:
    21
    Ahh i see.

    What about getting the time and date from online and storing it as a save/load on device? Then check to see if its ready or not? I just want both online and non online users to be able to use the feature.
     
  4. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,186
    I mean, you could save a datetime stamp from a server, but you'd have to maintain it to make sure they get their reward accurately. You could also just get the datetime from the device, but they could potentially change it. It just depends on how important it is for them not to be able to cheat the datetime.
     
  5. jasrei

    jasrei

    Joined:
    Apr 19, 2018
    Posts:
    15