Sign in to follow this  

Server/Client code sharing and security

This topic is 4109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I wonder how I should deal with sharing code between server and client. There are a lots of components (singleton, factories, different other patterns, priority queue, special property class etc) that can be shared amongst the two. However that seems to expose quite some security risk. Once somebody found a way to hack its own client's code, the same attack could be played on the server. What to do in this situation? -Matthias

Share this post


Link to post
Share on other sites
It's not a security risk at all if you validate the data when it reaches the server. Always assume someone will work out the format of whatever data is being sent, and they don't always do this from the code anyway.

Share this post


Link to post
Share on other sites
The moderator's right. As long as you don't trust anything the client says, there's no risk (exceptin' the normal risks you always get with server/client communications of any sort). Don't let the client report where he is, make him report what he'd like to do (Client say "I'm moving forwards, and I'm holding the fire lasers key"). The server, in turn, says "Ok".

Also, if your game is going to be a fairly small release, you may consider not worrying about cheaters. It takes a lot of effort to set up a game for cheating, and for a small indie game, why would they bother, and what would it cost you? Still, if you want to do it the "right way," then yeah, don't trust anything the client says.

Share this post


Link to post
Share on other sites

This topic is 4109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this