From 6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:24:18 +0300 Subject: decide what message types are left --- pkg/messages/types/svcVoiceData.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'pkg/messages/types/svcVoiceData.go') diff --git a/pkg/messages/types/svcVoiceData.go b/pkg/messages/types/svcVoiceData.go index 9609d80..efcae85 100644 --- a/pkg/messages/types/svcVoiceData.go +++ b/pkg/messages/types/svcVoiceData.go @@ -3,17 +3,19 @@ package messages import "github.com/pektezol/bitreader" type SvcVoiceData struct { - Client int8 - Proximity int8 - Length int16 - Data []byte + FromClient uint8 + Proximity bool + Length int16 + Data []byte } func ParseSvcVoiceData(reader *bitreader.Reader) SvcVoiceData { svcVoiceData := SvcVoiceData{ - Client: int8(reader.TryReadBits(8)), - Proximity: int8(reader.TryReadBits(8)), - Length: int16(reader.TryReadBits(16)), + FromClient: reader.TryReadUInt8(), + } + proximity := reader.TryReadUInt8() + if proximity != 0 { + svcVoiceData.Proximity = true } svcVoiceData.Data = reader.TryReadBitsToSlice(uint64(svcVoiceData.Length)) return svcVoiceData -- cgit v1.2.3