aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcPacketEntities.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/messages/types/svcPacketEntities.go')
-rw-r--r--pkg/messages/types/svcPacketEntities.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/pkg/messages/types/svcPacketEntities.go b/pkg/messages/types/svcPacketEntities.go
index 54e4a2a..2d86bf2 100644
--- a/pkg/messages/types/svcPacketEntities.go
+++ b/pkg/messages/types/svcPacketEntities.go
@@ -5,33 +5,30 @@ import (
5) 5)
6 6
7type SvcPacketEntities struct { 7type SvcPacketEntities struct {
8 MaxEntries int16 8 MaxEntries uint16
9 IsDelta bool 9 IsDelta bool
10 DeltaFrom int32 10 DeltaFrom int32
11 BaseLine bool 11 BaseLine bool
12 UpdatedEntries int16 12 UpdatedEntries uint16
13 Length int32 13 Length uint32
14 UpdatedBaseline bool 14 UpdatedBaseline bool
15 Data []byte 15 Data []byte
16} 16}
17 17
18func ParseSvcPacketEntities(reader *bitreader.Reader) SvcPacketEntities { 18func ParseSvcPacketEntities(reader *bitreader.Reader) SvcPacketEntities {
19 svcPacketEntities := SvcPacketEntities{ 19 svcPacketEntities := SvcPacketEntities{
20 MaxEntries: int16(reader.TryReadBits(11)), 20 MaxEntries: uint16(reader.TryReadBits(11)),
21 IsDelta: reader.TryReadBool(), 21 IsDelta: reader.TryReadBool(),
22 } 22 }
23 if svcPacketEntities.IsDelta { 23 if svcPacketEntities.IsDelta {
24 svcPacketEntities.DeltaFrom = int32(reader.TryReadBits(32)) 24 svcPacketEntities.DeltaFrom = reader.TryReadSInt32()
25 } else { 25 } else {
26 svcPacketEntities.DeltaFrom = -1 26 svcPacketEntities.DeltaFrom = -1
27 } 27 }
28 svcPacketEntities.BaseLine = reader.TryReadBool() 28 svcPacketEntities.BaseLine = reader.TryReadBool()
29 svcPacketEntities.UpdatedEntries = int16(reader.TryReadBits(11)) 29 svcPacketEntities.UpdatedEntries = uint16(reader.TryReadBits(11))
30 svcPacketEntities.Length = int32(reader.TryReadBits(20)) 30 svcPacketEntities.Length = uint32(reader.TryReadBits(20))
31 svcPacketEntities.UpdatedBaseline = reader.TryReadBool() 31 svcPacketEntities.UpdatedBaseline = reader.TryReadBool()
32 svcPacketEntities.Data = reader.TryReadBitsToSlice(uint64(svcPacketEntities.Length)) //, dataReader = reader.ForkAndSkip(int(svcPacketEntities.Length)) 32 svcPacketEntities.Data = reader.TryReadBitsToSlice(uint64(svcPacketEntities.Length))
33 // for count := 0; count < int(svcPacketEntities.UpdatedEntries); count++ {
34 // dataReader.TryReadBool()
35 // }
36 return svcPacketEntities 33 return svcPacketEntities
37} 34}