Javascript | Avoiding Date.now () Manipulation

So, I have an application for hybrid games, and I have a reward system in my game:

if(Date.now() - lastFreeCoinsTime > 3600000){ //lastFreeCoinsTime is also Date.now()
  giveCoins();
  lastFreeCoinsTime = Date.now();
}

Every hour you can get X number of coins. what I learned can be easily manipulated by following these steps: Phone settings: change date (for example, 18/03 → 23/03) Now you can get the reward again. How can I avoid this?

+4
source share
2 answers

I don’t think you can avoid certain behaviors, but you can stop someone from abusing them again and again by reducing their coins again if the current time has ever been before lastFreeCoinsTime. If the makers of Candy Crush weren't able to get around this, it should be pretty tricky.

0

, , , . , , ( ) . , , , . , , (, ), .

, "" . - , - "freemium", , , , . , , ? , . , ? , - , .

0

Source: https://habr.com/ru/post/1672608/


All Articles