make the example implementation a little more useful with a timeouts map.

This commit is contained in:
onyx-and-iris 2026-02-15 18:29:14 +00:00
parent 89dd2d2eb1
commit c3e8013c4f

View File

@ -7,6 +7,7 @@ import (
"io"
"os"
"strings"
"time"
log "github.com/sirupsen/logrus"
@ -105,7 +106,11 @@ func run() (func(), error) {
}
func connectRcon(host string, port int, password string) (*q3rcon.Rcon, error) {
rcon, err := q3rcon.New(host, port, password)
rcon, err := q3rcon.New(host, port, password, q3rcon.WithTimeouts(map[string]time.Duration{
"map": time.Second,
"map_rotate": time.Second,
"map_restart": time.Second,
}))
if err != nil {
return nil, err
}