split 3 times, log last part

This commit is contained in:
onyx-and-iris 2024-04-03 23:58:58 +01:00
parent 0935fc1190
commit 2c8ae43303

View File

@ -89,8 +89,8 @@ func (s *session) proxyTo(buf []byte) error {
}
if s.isRconRequestPacket(buf) {
parts := strings.Split(string(buf), " ")
log.Infof("From [%s] To [%s] Command: %s", s.caddr.IP, s.serverConn.RemoteAddr(), strings.Join(parts[2:], " "))
parts := strings.SplitN(string(buf), " ", 3)
log.Infof("From [%s] To [%s] Command: %s", s.caddr.IP, s.serverConn.RemoteAddr(), parts[len(parts)-1])
}
return nil