aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcCmdKeyValues.go
blob: 6ab9c99af169fe51938dac2cfdc099d6340c96fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package messages

import (
	"github.com/pektezol/bitreader"
	"github.com/pektezol/sdp.go/pkg/types"
)

type SvcCmdKeyValues struct {
	Length uint32 `json:"length"`
	Data   []byte `json:"data"`
}

func ParseSvcCmdKeyValues(reader *bitreader.Reader, demo *types.Demo) SvcCmdKeyValues {
	svcCmdKeyValues := SvcCmdKeyValues{
		Length: reader.TryReadUInt32(),
	}
	svcCmdKeyValues.Data = reader.TryReadBytesToSlice(uint64(svcCmdKeyValues.Length))
	demo.Writer.TempAppendLine("\t\tData: %v", svcCmdKeyValues.Data)
	return svcCmdKeyValues
}