1

I was investigating about how to make daily rewards in my Unity game. I have seen two ways: One, that uses the phone's date and another that uses a server's date.The first one is easy to implement, but can be cheated easily, and the second one needs to use a server. Is there an easy way to implement daily rewards without allowing players to cheat it and without using servers? Thanks.

Sebastián García
  • 103
  • 1
  • 3
  • 11

2 Answers2

1

You could do once a player has received his daily reward he won't be able to get another one for the next 24/16 hours (depending on his time, log his entrances and by that declare when he is eligible to receive his next daily reward). Or just use the server's time, it much more simple.

Ido H Levi
  • 181
  • 9
  • 1
    DateTime Subtraction. though it dosnt matter server side is the only way to ensure the time wont be manipulated. – Technivorous Oct 07 '18 at 20:53
  • But, do you have a code example or a reference link? – Sebastián García Oct 08 '18 at 01:49
  • @Vanethrane Great, who's tracking the date and time? The client or the server or another service? Hence the question: *`I have seen two ways: One, that uses the phone's date and another that uses a server's date.The first one is easy to implement, but can be cheated easily, and the second one needs to use a server`* – Draco18s no longer trusts SE Oct 08 '18 at 02:16
0

There are public apis that can give you the time. When first start you can save the current time that you get from an API. Then when you want to check if the user has to get a reward get the time again and check if new time minus old time is greater or equals the time interval.

Clock Apis

juliushuck
  • 1,398
  • 1
  • 11
  • 25