I want to allow a user to redeem a token every X time (i.e. 24 hours). Once they redeem it, they must wait X time again before redeeming the next item. This ensures that users must visit the app daily to continue gaining tokens.
I'm not sure how to work with clock differences between machines. What if
Server B: 9:03:41 User A tablet: 9:03.59 Server C: 9:05:23
(assume they all have the same date and all are AM)
User A's tablet makes a request and server B response with "Token available". The user then tries to immediately redeem the token, but server C responses with "Sorry, token not yet available." This would obviously be annoying to the user.
I could potentially handle this on the server. If the server says a token is available, then set a flag that actually guarantees that it is available.
But what if I want to actually let the user know how much time is left before they receive their next token. If all the servers have a different clock time, then all requests for time left would return a slightly different time.
I don't think I could rely on client time, since the user may play with different devices.
How could I handle this?