Matchmaking
Elements supports simple one vs one matchmaking for connected games. Players create Match requests, monitor the state of that Match, and finally enter a game based on the logic of the Match. This ties directly in to the scripting engine, becuase the Match system will execute a single Cloud function upon completion of the Match.
Matchmaking Process
The detailed process for handling a Match is as follows:
- Create a Matchhmaking Scheme under the Application Configuration section for your Application
- Deploy the Cloud Function code to service the match
- From the client application, POST the match request.
- Poll, using GET, on the specific Match identifier. Elements will delay the response until the Match is completed, or a timeout occurs.
- Upon finding a matching Profile, Elements will execute the matchmaking Cloud Function and supply the result via the Match object.
- The Cloud function may perform any operation and return a string indicating the result of the operation. The result should be something like a game ID, or IP address of a game server where the player may join.
For more information on configuring Matchmaking, see the Matchmaking document on the console.