
Client – server

Upgrade for more content
True or false? The server and the clients use the same program to play the game.
Leon and Selma are playing a multiplayer game. Leon is sitting with his tablet... ..and Selma is sitting at home with her computer. Selma is playing a cat catcher who wants to catch cats. Leon is a cat trying to avoid being caught. How can they play the same game together when they are so far away from each other?
They are both connected to a computer that collects information - swipe - from Leon's tablet, and click - from Selma's computer. Then this computer sends back to Leon and Selma the information that they need to play the game. A computer which serves other computers and devices in this way is called a server. The devices that receive information from a server like this are called the server's clients. To play the game, Leon and Selma have installed an application, a kind of software, on the tablet and the computer.
It is the application that sends the information that the server is asking for. On the server, another application is installed. This receives all this information. The game software is divided into two parts. The client part is installed on Leon and Selma's devices, and the server part on the server computer.
When a computer is functioning as a game server it’s called a host because it is hosting the game. This server has only one special task: to ensure that this game works. This computer is a dedicated game server. But how does this multiplayer game actually work? Selma tries to move the cat catcher closer to Leon's cat.
Selma's computer, one of the clients, sends a packet with the cat catcher's new position to the server. Information about the new position is sent in two packets from the server, to two different clients, Leon's tablet and Selma's computer. The cat catcher's new position is updated on the client screens. Oh, Leon’s mind has wandered. He hasn’t noticed that his cat is now very close to being caught!
Selma clicks the button that moves the net to catch Leon's cat. And Selma's client computer sends a packet with the click to the server. The server application contains a section which lists all possible actions, and keeps track of everything that is happening in each game, an event manager. The server application checks with the event manager to see if the cat has been caught: If the distance between the cat catcher and the cat is longer than the length of the landing net: The cat escapes. Else: The cat is captured.
And in this case, because Leon is dozing, the cat is captured. The server now sends new packets to Leon's tablet and Selma's computer: The cat is captured. New points. Leon’s cat has lost a life. And sound effects.
Now Leon is wide awake. Selma is happy. And the server is still keeping track of all the events in the game.