diff options
Diffstat (limited to 'packets/messages/types/SvcVoiceData.go')
| -rw-r--r-- | packets/messages/types/SvcVoiceData.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packets/messages/types/SvcVoiceData.go b/packets/messages/types/SvcVoiceData.go new file mode 100644 index 0000000..f99db38 --- /dev/null +++ b/packets/messages/types/SvcVoiceData.go | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | package types | ||
| 2 | |||
| 3 | import "github.com/pektezol/bitreader" | ||
| 4 | |||
| 5 | type SvcVoiceData struct { | ||
| 6 | Client int8 | ||
| 7 | Proximity int8 | ||
| 8 | Data []byte | ||
| 9 | } | ||
| 10 | |||
| 11 | func ParseSvcVoiceData(reader *bitreader.ReaderType) SvcVoiceData { | ||
| 12 | svcvoicedata := SvcVoiceData{ | ||
| 13 | Client: int8(reader.TryReadInt8()), | ||
| 14 | Proximity: int8(reader.TryReadInt8()), | ||
| 15 | } | ||
| 16 | length := reader.TryReadInt16() | ||
| 17 | svcvoicedata.Data = reader.TryReadBytesToSlice(int(length / 8)) | ||
| 18 | return svcvoicedata | ||
| 19 | } | ||