diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-21 19:26:40 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-21 19:26:40 +0300 |
| commit | 44eefefe67a4a5f514faa4594370346fd1b54996 (patch) | |
| tree | a8853a8ecd49ddbb87c6cc19904ec6bb5419ee83 /pkg/classes/consoleCmd.go | |
| parent | add strings builder, customize ALL outputs (#6) (diff) | |
| download | sdp.go-44eefefe67a4a5f514faa4594370346fd1b54996.tar.gz sdp.go-44eefefe67a4a5f514faa4594370346fd1b54996.tar.bz2 sdp.go-44eefefe67a4a5f514faa4594370346fd1b54996.zip | |
organize packets and classes (#9)v1.1.1
Diffstat (limited to 'pkg/classes/consoleCmd.go')
| -rw-r--r-- | pkg/classes/consoleCmd.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/classes/consoleCmd.go b/pkg/classes/consoleCmd.go new file mode 100644 index 0000000..75a56eb --- /dev/null +++ b/pkg/classes/consoleCmd.go | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | package classes | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "strings" | ||
| 5 | |||
| 6 | "github.com/pektezol/bitreader" | ||
| 7 | "github.com/pektezol/demoparser/pkg/writer" | ||
| 8 | ) | ||
| 9 | |||
| 10 | type ConsoleCmd struct { | ||
| 11 | Size int32 | ||
| 12 | Data string | ||
| 13 | } | ||
| 14 | |||
| 15 | func (consoleCmd *ConsoleCmd) ParseConsoleCmd(reader *bitreader.Reader) { | ||
| 16 | consoleCmd.Size = reader.TryReadSInt32() | ||
| 17 | consoleCmd.Data = reader.TryReadStringLength(uint64(consoleCmd.Size)) | ||
| 18 | writer.AppendLine("\t%s", strings.TrimSpace(consoleCmd.Data)) | ||
| 19 | } | ||