ensure we're only logging rcon

(no query packets)
This commit is contained in:
onyx-and-iris 2024-03-08 21:42:39 +00:00
parent a01df2e905
commit 7138515904

View File

@ -64,8 +64,12 @@ func (s *Session) proxyTo(buf []byte) error {
log.Println(err) log.Println(err)
return err return err
} }
parts := strings.Split(string(buf), " ")
log.Info("From [", s.caddr.IP, "] To [", s.serverConn.RemoteAddr().String(), "] Command: ", strings.Join(parts[2:], " ")) cmd := string(buf)
if cmd[:8] == "\xff\xff\xff\xffrcon" {
parts := strings.Split(cmd, " ")
log.Info("From [", s.caddr.IP, "] To [", s.serverConn.RemoteAddr().String(), "] Command: ", strings.Join(parts[2:], " "))
}
return nil return nil
} }