Reputation: 8530
I'm working in a tile-based MMORPG and I have a problem.
Each user has a fixed position (one tile) all the time, so the rest of the users can see him there, and cannot move to that tile. So there is only one object or user in each tile.
If a user becomes invisible, the rest of the users can't see him, but they still unable to move to his tile.
My question is, should the client know the position of all users (even the invisible ones)? The problem with this approach is that some users managed to crack the client and see the invisible users.
One idea that I had is that the client shouldn't know about users' position, and before moving ask the server if the tile where hi wants to move into is available, but the problem is the delay we are having.
FYI, the client/server protocol is build with TCP/IP.
Upvotes: 4
Views: 1384
Reputation: 133619
You should definitely follow the second approach to have a safe MMORPG.
Actually the logic should be completely separated between client and server. While the client should be just
the server should take care of everything else..
So for example you should handle the movement in something like:
The more important thing about this approach is that: the client is not responsible of actually moving the player into the new position, it just receives a new map state.
Forget this:
Upvotes: 5