Creating the Matchmaking Service
We’ll use Java in conjunction with Google App Engine to create our matchmaking service. If you’re unfamiliar with GAE and Java, you can get started here.
In order to match players with one another, the service needs to keep track of active matches being played and whether they have open slots for players. To notify the service of their status, Hosts need to periodically “ping” the matchmaking server letting them know that the match is still active and how many players are in it. A peer-to-peer game won’t have a “Host” in the client-server sense, but there should still be an authority reporting the status of the match. We’ll create a class called “Heartbeat” to represent this “ping” data. This is the central datatype of the service.