q3rcon/response.go
onyx-and-iris 3f45588afb remove internal packages, move everything into q3rcon
{request}.buf initialised with 0 length.

encoder, decoder interfaces added.
2026-02-19 00:22:32 +00:00

22 lines
388 B
Go

package q3rcon
import "bytes"
const (
responseHeader = "\xff\xff\xff\xffprint\n"
)
type response struct{}
func newResponse() response {
return response{}
}
func (r response) IsValid(buf []byte) bool {
return len(buf) > len(responseHeader) && bytes.HasPrefix(buf, []byte(responseHeader))
}
func (r response) Decode(buf []byte) string {
return string(buf[len(responseHeader):])
}