Understanding the server
The server is the most critical part of the architecture since it’s responsible for handling most of the work and making important decisions.
Here is an overview of the main responsibilities of a server:
- Creating and managing the shared world instance: The server runs its instance of the game in a specific level and game mode (this will be covered in Chapter 18, Using Gameplay Framework Classes in Multiplayer), which will serve as the shared world between all of the connected clients. The level being used can be changed at any point in time and, if applicable, the server can bring along all of the connected clients with it automatically.
- Handling client join and leave requests: If a client wants to connect to a server, it needs to ask for permission. To do this, the client sends a join request to the server, through a direct IP connection (explained in the next section) or an online subsystem such as Steam. Once the join request reaches...