Sign in to follow this  

Networking With The Server

This topic is 4350 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

Currently, me and my team would like to network the client side and the server, so that when the character somehow gets logged out, updates of the characters status and position are automatically sent. But we can't figure out how to do this, does anyone know how? We can get the server and client networked so that the client can play the game, but not so that updates of the characters status is automattically sent.

Share this post


Link to post
Share on other sites
"Automatically" based on what? When it changes? When someone connects?

Automatically "sent" where? To all connected clients? To the disconnected client?

I'm afraid you have to specify your question using slightly less ambiguous language before we can start helping you with your question.

Share this post


Link to post
Share on other sites
If the client is logged out, it can't send to the server. So it has to send before it logs out. I would recommend calling the send function when the user chooses "log out" in the UI, but also once every (say) 10 minutes, to make sure there's a "backup" frequently enough.

Also, if you keep the state on the client and trust the state when the client logs out, someone will hack it in memory and make it send character state that's not actually true (like make themselves level 100).

Share this post


Link to post
Share on other sites
the data is checked with the last sendage. Plus, where the stuff is being put, it can't be hacked. Cause u can't hack the core of windows without having windows fail.

Share this post


Link to post
Share on other sites
seriously, have u ever been able to place a file in the core of windows? I'm not talking that stupid file that it makes. I'm talking where if you bypass the security system, your computer basically gets formatted. But can anyone help me do this? I'm trying to make a multiplayer game in which the server is needed, but it isn't needed. I'm using WinSock, so any help would be appreciated.

Share this post


Link to post
Share on other sites
Quote:
Original post by PNT
I'm trying to make a multiplayer game in which the server is needed, but it isn't needed.


This really doesn't make sense, and just contradicts itself. You can't have a multiplayer game where the server is used in that fashion. Otherwise, you would be doing like hplus described, and that would leave the system wide open for game hacks. What you proposed with checking the values from the client against the values on the server would just be a waste of cycles on the server that could be better used elsewhere.

Ideally, in an online game, no "important" information is stored on the client's computer. This is done in this manner to prevent anyone from hacking the information and changing it to cheat with. Even if you were to use the highest possible encryption, there will always be someone that could break it. It would be better to stick with keeping character data on the server, and only give the client the information it requests for displaying that data; never to modify it.

Share this post


Link to post
Share on other sites
I'm trying to help. However, what I'm saying is: if you have data that you want to send, then send it. If you don't have a process running, then how could you have data to send? I don't understand what the problem is.

You're perfectly free to write an insecure system if you want, that's not the problem. The problem is that you haven't told us what you actually want to accomplish.

Given this flow of data, which I believe is what you are proposing:

1) server starts up
2) client starts up
3) client logs into server
4) server sends character and world data to client
5) client mutates the character data
receiving world updates from server
occasionally sending client data back to server
6) client receives user log-off command
7) client sends character data to server for storage
8) client process exits

What's the problem you're having?

Share this post


Link to post
Share on other sites
Quote:
Original post by PNT
seriously, have u ever been able to place a file in the core of windows? I'm not talking that stupid file that it makes. I'm talking where if you bypass the security system, your computer basically gets formatted. But can anyone help me do this? I'm trying to make a multiplayer game in which the server is needed, but it isn't needed. I'm using WinSock, so any help would be appreciated.


If you can get there , they can too, don't kid yourself. The only thing from the client you should get is the username, password and the keys they hit (like "MY_FORWARD" and even that limit it to so many messages per second to elimate speed hacks. You should send back what the client should do. Basically make it a dumb client.

Using this method you'll only need to send a "CLIENT_DISCONNECTING" message and record that players info on the server side and send a message back like "SAFE_TO_DISCONNECT". If you don't get the message, have it wait x number of seconds for a response then continue shutting down.

Trust nothing from the client.

Share this post


Link to post
Share on other sites
From what I have worked on, I agree with Mike. In pretty much any client/server you you only want the client making "requests" to the server.

The server should then verify that the requests are valid, and once verified, update the current game data with it.

After that, this should be sent out as an update to all clients that need it.

In a smaller action type game I think you can go at it a little "fast-and-loose" for the sake of speed, but in a persistent world the clients should only make requests for changes, and the server should be the only one actually forcing updates of any kind.

Share this post


Link to post
Share on other sites
Simple answer is to mask the network transition time with an animation sequence. A 500ms animation sequence is nothing and will mask just about any normal network latency.

More complicated answer is to start the movement client-side in anticipation of the server verifing that this is correct. This will involve more overhead if the request is invalid for some reason as you correct what the client went ahead and did with what the server says should happen.

However, based on your questions, I suggest you read the Forum FAQ first. These are pretty basic issues you are tackling and you'll need to your network concepts solidified before you do anything more complicated than walk and talk in your game.

Share this post


Link to post
Share on other sites

This topic is 4350 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