diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-21 01:53:59 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-21 01:53:59 +0300 |
| commit | 171e350e348afadb55967b9c13d5eadc7f7d2cf4 (patch) | |
| tree | 14ec93df8ccc1aca0cf453f826d46a402b09dc8f /pkg/messages/types/netSetConVar.go | |
| parent | define todos on packets (diff) | |
| download | sdp.go-171e350e348afadb55967b9c13d5eadc7f7d2cf4.tar.gz sdp.go-171e350e348afadb55967b9c13d5eadc7f7d2cf4.tar.bz2 sdp.go-171e350e348afadb55967b9c13d5eadc7f7d2cf4.zip | |
add strings builder, customize ALL outputs (#6)
Diffstat (limited to 'pkg/messages/types/netSetConVar.go')
| -rw-r--r-- | pkg/messages/types/netSetConVar.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/messages/types/netSetConVar.go b/pkg/messages/types/netSetConVar.go index 44b75b9..530cb6b 100644 --- a/pkg/messages/types/netSetConVar.go +++ b/pkg/messages/types/netSetConVar.go | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | package messages | 1 | package messages |
| 2 | 2 | ||
| 3 | import "github.com/pektezol/bitreader" | 3 | import ( |
| 4 | "github.com/pektezol/bitreader" | ||
| 5 | "github.com/pektezol/demoparser/pkg/writer" | ||
| 6 | ) | ||
| 4 | 7 | ||
| 5 | type NetSetConVar struct { | 8 | type NetSetConVar struct { |
| 6 | Length uint8 | 9 | Length uint8 |
| @@ -15,11 +18,13 @@ type conVar struct { | |||
| 15 | func ParseNetSetConVar(reader *bitreader.Reader) NetSetConVar { | 18 | func ParseNetSetConVar(reader *bitreader.Reader) NetSetConVar { |
| 16 | length := reader.TryReadUInt8() | 19 | length := reader.TryReadUInt8() |
| 17 | convars := []conVar{} | 20 | convars := []conVar{} |
| 21 | writer.TempAppendLine("\t\tLength: %d", length) | ||
| 18 | for count := 0; count < int(length); count++ { | 22 | for count := 0; count < int(length); count++ { |
| 19 | convar := conVar{ | 23 | convar := conVar{ |
| 20 | Name: reader.TryReadString(), | 24 | Name: reader.TryReadString(), |
| 21 | Value: reader.TryReadString(), | 25 | Value: reader.TryReadString(), |
| 22 | } | 26 | } |
| 27 | writer.TempAppendLine("\t\t[%d] %s: %s", count, convar.Name, convar.Value) | ||
| 23 | convars = append(convars, convar) | 28 | convars = append(convars, convar) |
| 24 | } | 29 | } |
| 25 | return NetSetConVar{ | 30 | return NetSetConVar{ |