Server load vers client load
I've been writing an small on-line RPG for a while now and I'm getting into learning to do the server/client coding.
I was deciding what the server or client processed, and it turns out that to keep the characters safe from being hacked, I stuffed all the fighting and items and everything process-wise over on sever,and the client does the command input and all the preaty stuff (graphics & sound) based on the out come from the server.
Is this bad design?
No, this is the way i would do it.
Assume the client is evil.
If they can exploit something, they will, unfortunately. Don't give them the chance.
The client requests an action, if they CAN perform the action, the server processes and updates the entity/actor on the other clients, with the appropriate action.
Assume the client is evil.
If they can exploit something, they will, unfortunately. Don't give them the chance.
The client requests an action, if they CAN perform the action, the server processes and updates the entity/actor on the other clients, with the appropriate action.
I would do the same logic on the client as on the server, but let the latter be authorative.
The server should do everything that affects the game (i.e. not purely graphical particle effects and animations). You can have the client do them as well, to hide the round trip latency, but the server always 'wins' if there's a disagreement about what happened.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement