aboutsummaryrefslogtreecommitdiff
path: root/packets/messages/types/SvcSounds.go
blob: 4d858bf95b41f8c73285bef35721214076dbe6d1 (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
24
25
26
27
28
29
30
31
32
package types

import "github.com/pektezol/bitreader"

type SvcSounds struct {
	ReliableSound bool
	Size          int8
	Data          []byte
}

func ParseSvcSounds(reader *bitreader.ReaderType) SvcSounds {
	reliablesound := reader.TryReadBool()
	var size int8
	var length int16
	if reliablesound {
		size = 1
	} else {
		size = int8(reader.TryReadInt8())
	}
	if reliablesound {
		length = int16(reader.TryReadInt8())
	} else {
		length = int16(reader.TryReadInt16())
	}
	reader.SkipBits(int(length)) // TODO: Read data properly
	//data := reader.TryReadBytesToSlice(int(length / 8))
	return SvcSounds{
		ReliableSound: reliablesound,
		Size:          size,
		//Data:          data,
	}
}