I remember reading an article about some javascript games and how to find the balance for game state server-side check.
source : http://fugiman.com/blog/2013/08/17/on-click-fueled-javascrip...