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.
Asked
Active
Viewed 6,123 times
1
-
Well there are many API's out there that allow you to get the current UTC time. That would be the best option for you! – Twenty Oct 07 '18 at 19:41
-
Check this site out https://timezonedb.com/api – Twenty Oct 07 '18 at 19:43
-
@Twenty but this API doesn't allow comercial uses, and that's what I need :/ – Sebastián García Oct 08 '18 at 01:50
2 Answers
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
-
1DateTime 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
-
-
@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.

juliushuck
- 1,398
- 1
- 11
- 25
-
Like which APIS? Also, it will need internet to load the rewards, right? – Sebastián García Oct 08 '18 at 01:46
-
You can do it without apis when you use the time of the device. But then the user can change the clock in the settings and then he will get the reward... – juliushuck Oct 08 '18 at 02:08