blob: a95a33a4858a398d5792f6a0b192dc80a556987b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package svc
import (
"github.com/osm/quake/common/buffer"
"github.com/osm/quake/common/context"
"github.com/osm/quake/packet"
)
func Parse(ctx *context.Context, data []byte) (packet.Packet, error) {
buf := buffer.New(buffer.WithData(data))
header, _ := buf.PeekInt32()
if header == -1 {
return parseConnectionless(ctx, buf)
}
return parseGameData(ctx, buf)
}
|