diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-23 17:46:12 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-23 17:46:12 +0300 |
| commit | 7745f2dcaa2c409c19c6e79bf1eaa2bc41444be0 (patch) | |
| tree | 0c57a12442ec0b8e90089eddf44af78a01e8882a /pkg/classes/stringTables.go | |
| parent | feat: TONS of user message parsing (#10) (diff) | |
| download | sdp.go-7745f2dcaa2c409c19c6e79bf1eaa2bc41444be0.tar.gz sdp.go-7745f2dcaa2c409c19c6e79bf1eaa2bc41444be0.tar.bz2 sdp.go-7745f2dcaa2c409c19c6e79bf1eaa2bc41444be0.zip | |
lp parser: only get portal count and cm ticks
Diffstat (limited to 'pkg/classes/stringTables.go')
| -rw-r--r-- | pkg/classes/stringTables.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/pkg/classes/stringTables.go b/pkg/classes/stringTables.go index 01939b2..45954be 100644 --- a/pkg/classes/stringTables.go +++ b/pkg/classes/stringTables.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 StringTables struct { | 7 | type StringTables struct { |
| @@ -46,7 +45,6 @@ func (stringTables *StringTables) ParseStringTables(reader *bitreader.Reader) { | |||
| 46 | func (stringTable *StringTable) ParseStream(reader *bitreader.Reader) { | 45 | func (stringTable *StringTable) ParseStream(reader *bitreader.Reader) { |
| 47 | stringTable.Name = reader.TryReadString() | 46 | stringTable.Name = reader.TryReadString() |
| 48 | entryCount := reader.TryReadBits(16) | 47 | entryCount := reader.TryReadBits(16) |
| 49 | writer.AppendLine("\tTable Name: %s", stringTable.Name) | ||
| 50 | stringTable.TableEntries = make([]StringTableEntry, entryCount) | 48 | stringTable.TableEntries = make([]StringTableEntry, entryCount) |
| 51 | 49 | ||
| 52 | for i := 0; i < int(entryCount); i++ { | 50 | for i := 0; i < int(entryCount); i++ { |
| @@ -54,12 +52,6 @@ func (stringTable *StringTable) ParseStream(reader *bitreader.Reader) { | |||
| 54 | entry.Parse(reader) | 52 | entry.Parse(reader) |
| 55 | stringTable.TableEntries[i] = entry | 53 | stringTable.TableEntries[i] = entry |
| 56 | } | 54 | } |
| 57 | if entryCount != 0 { | ||
| 58 | writer.AppendLine("\t\t%d Table Entries:", entryCount) | ||
| 59 | writer.AppendOutputFromTemp() | ||
| 60 | } else { | ||
| 61 | writer.AppendLine("\t\tNo Table Entries") | ||
| 62 | } | ||
| 63 | if reader.TryReadBool() { | 55 | if reader.TryReadBool() { |
| 64 | classCount := reader.TryReadBits(16) | 56 | classCount := reader.TryReadBits(16) |
| 65 | stringTable.Classes = make([]StringTableClass, classCount) | 57 | stringTable.Classes = make([]StringTableClass, classCount) |
| @@ -69,10 +61,6 @@ func (stringTable *StringTable) ParseStream(reader *bitreader.Reader) { | |||
| 69 | class.Parse(reader) | 61 | class.Parse(reader) |
| 70 | stringTable.Classes[i] = class | 62 | stringTable.Classes[i] = class |
| 71 | } | 63 | } |
| 72 | writer.AppendLine("\t\t%d Classes:", classCount) | ||
| 73 | writer.AppendOutputFromTemp() | ||
| 74 | } else { | ||
| 75 | writer.AppendLine("\t\tNo Class Entries") | ||
| 76 | } | 64 | } |
| 77 | } | 65 | } |
| 78 | 66 | ||
| @@ -91,10 +79,8 @@ func (stringTableEntry *StringTableEntry) Parse(reader *bitreader.Reader) { | |||
| 91 | 79 | ||
| 92 | func (stringTableClass *StringTableClass) Parse(reader *bitreader.Reader) { | 80 | func (stringTableClass *StringTableClass) Parse(reader *bitreader.Reader) { |
| 93 | stringTableClass.Name = reader.TryReadString() | 81 | stringTableClass.Name = reader.TryReadString() |
| 94 | writer.TempAppendLine("\t\t\tName: %s", stringTableClass.Name) | ||
| 95 | if reader.TryReadBool() { | 82 | if reader.TryReadBool() { |
| 96 | dataLen := reader.TryReadBits(16) | 83 | dataLen := reader.TryReadBits(16) |
| 97 | stringTableClass.Data = reader.TryReadStringLength(dataLen) | 84 | stringTableClass.Data = reader.TryReadStringLength(dataLen) |
| 98 | writer.TempAppendLine("\t\t\tData: %s", stringTableClass.Data) | ||
| 99 | } | 85 | } |
| 100 | } | 86 | } |