remove internal packages, move everything into q3rcon

{request}.buf initialised with 0 length.

encoder, decoder interfaces added.
This commit is contained in:
2026-02-19 00:22:32 +00:00
parent caffd65cb3
commit 3f45588afb
6 changed files with 105 additions and 80 deletions

21
response.go Normal file
View File

@@ -0,0 +1,21 @@
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):])
}