Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Setting Clock Back Kills Timers and ENTER_FRAME — Gideros Forum

Setting Clock Back Kills Timers and ENTER_FRAME

troysandaltroysandal Member
edited May 2014 in Bugs and issues
We've been getting bug reports from users that their livers timer in our game stop working. Digging into it we've found out they are getting around our energy mechanic by setting their clocks forward, something we were aware would happen and didn't test deeply. This morning I found some strange behavior where any Gideros Timer or Event.ENTER_FRAME stops firing if you set your time backwards.

Steps
1. Run the code below
stage:addEventListener(Event.ENTER_FRAME, function()
	print(math.random())
end)
2. Set your computer clock forward one day.
3. Set your clock back to present.

Expected : math.random() to continue printing out.
Actual : console output stops

If I set the clock back to the future the app starts responding again. Any timers or event handlers created after this are ok but older ones stop working. Same thing happens with this code.
local t = Timer.new(1000, 0)
 
t:addEventListener(Event.TIMER, function()
	print(math.random())
end)
 
t:start()

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited May 2014
    Interesting, just tried out on windows PC and it does not stop and works an expected
    Will export an app and check on the devices

    although, it is an awesome way to stop cheaters :)

    I could imagine Timer class chocking up, as it is definitely need to use internal clock to sync, but currently don't understand what the problem could be with enterframe event
  • I'm running on an OSX Desktop in the simulator, not on a device at the moment. I'm noticing that Event.FRAME_ENTER does still work in some instances in my app but Timers are definitely dying.
Sign In or Register to comment.