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

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

type SvcSplitScreen struct {
	RemoveUser bool   `json:"remove_user"`
	Length     uint16 `json:"length"`
	Data       []byte `json:"data"`
}

func ParseSvcSplitScreen(reader *bitreader.Reader, demo *types.Demo) SvcSplitScreen {
	svcSplitScreen := SvcSplitScreen{
		RemoveUser: reader.TryReadBool(),
		Length:     uint16(reader.TryReadBits(11)),
	}
	svcSplitScreen.Data = reader.TryReadBitsToSlice(uint64(svcSplitScreen.Length))
	demo.Writer.TempAppendLine("\t\tRemove User: %t", svcSplitScreen.RemoveUser)
	demo.Writer.TempAppendLine("\t\tData: %v", svcSplitScreen.Data)
	return svcSplitScreen
}