diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-23 10:06:39 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-23 10:06:39 +0300 |
| commit | 9991801e4037d8dc530876584f21c1674c9e3bba (patch) | |
| tree | efa20cd6aa6556cfdea81f4c99251e0688847ca6 /pkg/classes/customData.go | |
| parent | organize packets and classes (#9) (diff) | |
| download | sdp.go-verification.tar.gz sdp.go-verification.tar.bz2 sdp.go-verification.zip | |
init: will look at this laterverification
Diffstat (limited to 'pkg/classes/customData.go')
| -rw-r--r-- | pkg/classes/customData.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/classes/customData.go b/pkg/classes/customData.go index 2dadde4..1fc8a1e 100644 --- a/pkg/classes/customData.go +++ b/pkg/classes/customData.go | |||
| @@ -2,7 +2,6 @@ package classes | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/pektezol/bitreader" | 4 | "github.com/pektezol/bitreader" |
| 5 | "github.com/pektezol/demoparser/pkg/writer" | ||
| 6 | ) | 5 | ) |
| 7 | 6 | ||
| 8 | type CustomData struct { | 7 | type CustomData struct { |
| @@ -16,13 +15,13 @@ func (customData *CustomData) ParseCustomData(reader *bitreader.Reader, tickNumb | |||
| 16 | customData.Size = reader.TryReadSInt32() | 15 | customData.Size = reader.TryReadSInt32() |
| 17 | if customData.Type != 0 || customData.Size == 8 { | 16 | if customData.Type != 0 || customData.Size == 8 { |
| 18 | // Not SAR data | 17 | // Not SAR data |
| 19 | writer.AppendLine("[%d] %s (%d):", tickNumber, "CUSTOMDATA", packetType) | 18 | |
| 20 | customData.Data = string(reader.TryReadBytesToSlice(uint64(customData.Size))) | 19 | customData.Data = string(reader.TryReadBytesToSlice(uint64(customData.Size))) |
| 21 | writer.AppendLine("\t%s", customData.Data) | 20 | |
| 22 | return | 21 | return |
| 23 | } | 22 | } |
| 24 | // SAR data | 23 | // SAR data |
| 25 | writer.AppendLine("[%d] %s (%d):", tickNumber, "SARDATA", packetType) | 24 | |
| 26 | sarData := SarData{} | 25 | sarData := SarData{} |
| 27 | data := reader.TryReadBytesToSlice(uint64(customData.Size)) | 26 | data := reader.TryReadBytesToSlice(uint64(customData.Size)) |
| 28 | sarReader := bitreader.NewReaderFromBytes(data, true) | 27 | sarReader := bitreader.NewReaderFromBytes(data, true) |