mirror of
https://github.com/onyx-and-iris/q3rcon.git
synced 2026-04-18 07:43:31 +00:00
replace logrus with charm/log
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/charmbracelet/log"
|
||||
)
|
||||
|
||||
type UDPConn struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/charmbracelet/log"
|
||||
)
|
||||
|
||||
const bufSz = 512
|
||||
@@ -24,13 +24,13 @@ func NewRequest(password string) Request {
|
||||
}
|
||||
|
||||
func (r Request) Header() []byte {
|
||||
return append(r.magic, []byte("rcon")...)
|
||||
return append(r.magic, "rcon"...)
|
||||
}
|
||||
|
||||
func (r Request) Encode(cmd string) []byte {
|
||||
r.buf.Reset()
|
||||
r.buf.Write(r.Header())
|
||||
r.buf.WriteString(fmt.Sprintf(" %s %s", r.password, cmd))
|
||||
log.Tracef("Encoded request: %s", r.buf.String())
|
||||
log.Debugf("Encoded request: %s", r.buf.String())
|
||||
return r.buf.Bytes()
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ func NewResponse() Response {
|
||||
}
|
||||
|
||||
func (r Response) Header() []byte {
|
||||
return append(r.magic, []byte("print\n")...)
|
||||
return append(r.magic, "print\n"...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user