Search code examples
javatiled

How to prevent map hacking in MMO


I'm making a java 2D online game. I use a tiledmap and I've been thinking about a way to prevent map hack.

My idea is to send the player's map file (compressed) which contains all cells and collision cells to the server and to compare it with the original one (on the server).

If they are equals, the player can connect.

This way, the player can't remove collisions cells on their map.

Is it a good idea ? Is there better alternatives ?


Solution

  • This kind of approach to preventing cheating is as common as it is naive. How would your idea prevent a map hack? A hacked client could send the original map data but use the compromised map data. In general, a hacked client can fake any data you request from it, and there's nothing you can do about it.

    If you want to validate player actions, you have to do it on the server side. If you want to limit player knowledge, you have to keep the information on the server and transmit only what the player should know. If this won't meet your performance requirements, then you have to make compromises and accept that there could be some cheating.