diff options
Diffstat (limited to 'pkg/messages/types/svcUpdateStringTable.go')
| -rw-r--r-- | pkg/messages/types/svcUpdateStringTable.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/messages/types/svcUpdateStringTable.go b/pkg/messages/types/svcUpdateStringTable.go new file mode 100644 index 0000000..2840482 --- /dev/null +++ b/pkg/messages/types/svcUpdateStringTable.go | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | package messages | ||
| 2 | |||
| 3 | import "github.com/pektezol/bitreader" | ||
| 4 | |||
| 5 | type SvcUpdateStringTable struct { | ||
| 6 | TableId int8 | ||
| 7 | NumChangedEntries int16 | ||
| 8 | Length int32 | ||
| 9 | Data []byte | ||
| 10 | } | ||
| 11 | |||
| 12 | func ParseSvcUpdateStringTable(reader *bitreader.ReaderType) SvcUpdateStringTable { | ||
| 13 | svcUpdateStringTable := SvcUpdateStringTable{ | ||
| 14 | TableId: int8(reader.TryReadBits(5)), | ||
| 15 | } | ||
| 16 | if reader.TryReadBool() { | ||
| 17 | svcUpdateStringTable.NumChangedEntries = int16(reader.TryReadBits(16)) | ||
| 18 | } | ||
| 19 | svcUpdateStringTable.Length = int32(reader.TryReadBits(20)) | ||
| 20 | svcUpdateStringTable.Data = reader.TryReadBitsToSlice(int(svcUpdateStringTable.Length)) | ||
| 21 | return svcUpdateStringTable | ||
| 22 | } | ||