The Match Function is the core of the decision. It's this service that creates game proposals. It makes its decisions from profile's configuration. In this service, you can code any logic that will generate your match proposals
- Front End tutorial
- Knowledge about Golang
- Install Golang on your computer
- Basic knowledge about Open Match
- Install Docker
- Access to a docker repository (like Edgegap's harbor)
- Having a Kubernetes ecosystem available (Docker Desktop includes a standalone Kubernetes server and client)
- Having Open Match Core and the default Evaluator installed
Every Open Match service should be in its own project. Create a new folder. In this folder, run the following command. (<MODULE_NAME> is the go module name you have chosen)
The first thing that we need for our Match Function is a gRPC server that will listen for a call from Open Match Core.
We will need two libraries for this step. You can install them with
Now, in your main.go file, you can add the following code. This will create the gPRC server.
You can try it by starting your app with
go run ./main.go. You should see
The strength of Open Match comes from the customization of Match Function and Director services. We will now create the Match Function. This one aims to fetch Open Match tickets based on profiles. Match Function can be very complicated, but we will keep it simple and implement a basic Match Function in this tutorial.
The Match Function will fetch all the tickets that match the profile received in the request. The tickets will be categorized by pool's name (Profiles contain pools). Then, we will go through each pool and create game proposals from the tickets in the pool. When the proposals are all created, we will send them back to Open Match Core via gRPC
Here is the code for the Match Function
You will have to change your dependencies. They should look like this
Also, you will have to update the main function to create the Open Match Query service connection and make the basicMatchFunction
It will be hard to test this service in a standalone context. We will see it in action when all the services (Front end, Director, and Match Function) will be ready.
Create a file named Dockerfile and write this inside.
You can now build your image using. (If you use Edgegap's harbor, <REPOSITORY_MAME> is harbor.edgegap.com/<YOUR_PROJECT>)
You can run it using
Now push your image on your Docker repository. (You may have to use Docker login)
You now have a basic Open Match Match Function service that can be called by Open Match Core using gRPC protocol. This is not production-ready, however you should be able to grasp the basic of Open Match Front End. You also created a Docker image and pushed it to your repository.