How to make a secure game in javascript?

后端 未结 5 1719
挽巷
挽巷 2020-12-17 18:54

I\'m working on games using javascript some html and css, and I was wondering if there was any way to secure the game so that the user can\'t just call game.php?result=victo

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-17 19:38

    You could do some stuff to thwart the naive user, but probably not everybody. It all depends on how motivated the person is to "attack" your game. At the end of the day, the user could use a javascript debugger to see exactly what your code is doing, and replicate it. Even if you send back every game action, the user could still replicate that. If you aren't careful about what actions the user can do, they may be able to send back actions that would be impossible if they were controlling the game with the default control scheme.

提交回复
热议问题