Setup MatchMaker Module on Server

Overview

The MatchMaker module requires matchmaking definitions to be executed on an HTTP server. This is because the data is managed in the memory of the HTTP server.

Publishing built-in commands can be set up on UDP and TCP servers.

Setup

To publish built-in commands to clients, you can set up using the diarkisexec package.

Add the following to the main function of the server as shown below. This is an example of setting up on a UDP server. The setup function of diarkisexec needs to be executed before calling diarkisexec.StartDiarkis().

For more details, please refer to the API reference for diarkisexec.

package main

import "github.com/Diarkis/diarkis/diarkisexec"

func main() {
	logConfigPath := "/configs/shared/log.json"
	meshConfigPath := ""

	diarkisexec.SetupDiarkis(logConfigPath, meshConfigPath, &diarkisexec.Modules{
		MatchMaker: &diarkisexec.Options{ConfigPath: "/configs/shared/matching.json", ExposeCommands: true},
	})
	diarkisexec.SetupDiarkisUDPServer("/configs/udp/main.json")
	diarkisexec.StartDiarkis()
}

It's recommended to first use the server template as it allows you to easily launch the server. Diarkis Server Template

Last updated