julian
julian

Reputation: 4714

Can I block the console in the browser?

I am making a multiplayer canvas game, It goes really well..
But it seems that if you'll type some commands in the console(like chrome's console) you can cheat the crap out of this game
So is it possible to block the console commands or something?

Any ideas?
Thanks in advance

Upvotes: 1

Views: 368

Answers (2)

Matt Harrison
Matt Harrison

Reputation: 13567

You should look at separating your game into a client-server model. The inner workings of the game should be hidden from the user on the server side and the client should handle only the user interaction and the visual elements of the game.

If you have already written all your game in Javascript you could look at using NodeJS for the server, this way you can reuse all your existing codebase.

Upvotes: 7

AKX
AKX

Reputation: 168903

No, it's not.

You can however obfuscate/compress your code before serving it to the clients (UglifyJS or Closure Compiler will do a good job at this), and additionally add some other sanity checks that (try to) make sure no variables have been unexpectedly tampered with through the console/debuggers.

Upvotes: 3

Related Questions