Set Up Room Module on Server
Overview
The Room module can be set up on both TCP and UDP servers.
Setup
To publish built-in commands to the client, you can set up using the diarkisexec
package.
Add the following to your server's main function. Below is a sample setup for a UDP server. Note that the diarkisexec
setup function must 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{
Room: &diarkisexec.Options{ExposeCommands: true},
})
diarkisexec.SetupDiarkisUDPServer("/configs/udp/main.json")
diarkisexec.StartDiarkis()
}
It's recommended to first utilize the server template for easily starting up a server. Diarkis Server Template
Last updated
Was this helpful?