Setting Up the MatchMaker Module on the Server

Overview

The MatchMaker module must be defined on an HTTP server because data is managed in the memory of the HTTP server.

The publication of built-in commands can be set up on UDP and TCP servers.

Setup

To publish built-in commands to the client, you can use the diarkisexec package for setup.

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

For more details, refer to diarkisexec API reference.

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()
}

Since it is easy to launch a server using the server template, we recommend using it first. Diarkis Server Template

Last updated