mirror of
https://github.com/onyx-and-iris/q3rcon.git
synced 2026-03-02 17:09:19 +00:00
22 lines
388 B
Go
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):])
|
|
}
|