Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: docdolittle on April 15, 2015, 03:37:00 PM
-
What is the best way to add to an int from the amount of time the app has been turned off?
I've been looking at the 'Get System Date Time' part but I'd thought I'd ask first just incase I've missed something. Also, while setting this up is there a way to make sure people can't just set their system clock forward to cheat it?
-
Not sure on the time since off issue, you would need to somehow grab the time when the user closes or multitasks away from the app, store it, then compare with new time on re-launch. I'd be keen to hear solutions for this too though!
With regards to cheating, I believe the only way around it (and the most commonly used solution) is to grab the time from a server online rather than the device.
-
Hi,
you'll need to listen to the application pause event, using the action on this post
http://hutonggames.com/playmakerforum/index.php?topic=1591.msg14044#msg14044
then yes, record the time at the pause, save it in prefs ( safer than in memory if the user decides to kill the app while paused). and then when resuming compute the difference and adjust values.
bye,
Jean
-
Thats great Jean, thanks so much for the help! :D