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
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