I want to make regen hp. By time between user close app or pause app.
I make timestamp (get server time) when user pause or user quit app.
I want to know perfect condition about timer.
(Internet connection, Time Stamp)
Start Game > Check Network and Load TimeStamp > Calculate (Latest Time - TIme Stamp)
When Pause Game > Save TimeStamp but if user network fail it’s can’t load server time. (How to fix this ?) How to make like hayday or clash of clan ?
When Unpause > Check Network and Load TimeStamp > Calculate (Latest Time - TIme Stamp)