Move to event loop, prettify warps, add delay to warp with damage counter
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
11
rcon/rcon.go
11
rcon/rcon.go
@ -3,8 +3,8 @@ package rcon
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/tystuyfzand/mcgorcon"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -68,15 +68,16 @@ func (r *Session) openConnection() *mcgorcon.Client {
|
||||
<-time.After(10 * time.Second)
|
||||
}
|
||||
|
||||
log.Println("Connection opened")
|
||||
log.WithFields(log.Fields{
|
||||
"host": r.host,
|
||||
"port": r.port,
|
||||
}).Info("Connection opened")
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (r *Session) SendCommand(command string) (string, error) {
|
||||
if r.Debug {
|
||||
log.Println("Send command: " + command)
|
||||
}
|
||||
log.WithField("command", command).Debug("Sending command")
|
||||
|
||||
return r.connection().SendCommand(command)
|
||||
}
|
||||
|
Reference in New Issue
Block a user