mirror of
https://github.com/onyx-and-iris/q3rcon.git
synced 2026-02-16 02:07:53 +00:00
make the example implementation a little more useful with a timeouts map.
This commit is contained in:
parent
89dd2d2eb1
commit
c3e8013c4f
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user