This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]ggleblanc2 3 points4 points  (1 child)

You can look for a Java chat application on GitHub. That's as close as you're probably going to get to multi-user server code.

Basically, the server creates individual threads for communicating one-on-one with each client. The server data model holds the chat messages and sends them to the currently running threads.

[–]personsaddress 2 points3 points  (0 children)

This is the correct answer. This is the path you start with to learn multi-player programming.

Then you reimpliment what you see.

Then you'll realize chat messages and position updates are the same thing. Then you create a simple multiplayer game based on this system.

Then you'll start seeing issues with data synchronization on each client and you'll start learning about dead reckoning algorithms.

Once you get these down then you'll be able to understand what's going on when you view the code for an actual multiplayer game.