Set Up MatchMaker Module on Server

Overview

The MatchMaker module must define matchmaking on an HTTP server. This is necessary because the 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 clients, you can set up using the diarkisexec package.

Add the following to the main function of the server. Below is a sample setup for a UDP server. The setup function of diarkisexec needs to be executed before calling diarkisexec.StartDiarkis().

For more details, please refer to the 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()
}

It is recommended to first utilize the server template for easily launching a server. Please consider using this: Diarkis Server Template

Last updated

Was this helpful?