Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
vijay700258y@Peekaboo .
Actually my problem any body can make change in browser console. One can change variable value in console and can send it through Ajax as it is easy make changes in JavaScript in console. So for that can we do something -
AllenII16178yOr you can wrap your score values in a closure with get/set methods. Maybe add anothere variable like canBeEdited, which would be true until you yourself set the score, then make it false. That way, it can't be rewritten maliciously.
-
@vijay7002 well, say the game is a 2d platformer. Keep track of player position rather than just sending when they get a coin. If a player moves too much between transmissions, then they are cheating. If their position is on a coin, accept the score server side. That's one way, but definitely not the only way.
How to encrypt JavaScript code for securely sending score to server. Any ideas?
undefined