diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-11-08 22:48:20 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-16 21:39:39 +0300 |
| commit | 833a46544df2ed2a7afdba08ebfe02ed7741d86a (patch) | |
| tree | 2432f14b449761086d773fb8cd072797d23006f1 /packets/messages/types/NetSetConVar.go | |
| parent | put class type into individual files (diff) | |
| download | sdp.go-833a46544df2ed2a7afdba08ebfe02ed7741d86a.tar.gz sdp.go-833a46544df2ed2a7afdba08ebfe02ed7741d86a.tar.bz2 sdp.go-833a46544df2ed2a7afdba08ebfe02ed7741d86a.zip | |
net/svc messages
Diffstat (limited to 'packets/messages/types/NetSetConVar.go')
| -rw-r--r-- | packets/messages/types/NetSetConVar.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packets/messages/types/NetSetConVar.go b/packets/messages/types/NetSetConVar.go new file mode 100644 index 0000000..b502953 --- /dev/null +++ b/packets/messages/types/NetSetConVar.go | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | package types | ||
| 2 | |||
| 3 | import "github.com/pektezol/bitreader" | ||
| 4 | |||
| 5 | type NetSetConVar struct { | ||
| 6 | Length uint8 | ||
| 7 | ConVars []ConVar | ||
| 8 | } | ||
| 9 | |||
| 10 | type ConVar struct { | ||
| 11 | Name string | ||
| 12 | Value string | ||
| 13 | } | ||
| 14 | |||
| 15 | func ParseNetSetConVar(reader *bitreader.ReaderType) NetSetConVar { | ||
| 16 | var convars []ConVar | ||
| 17 | netsetconvar := NetSetConVar{ | ||
| 18 | Length: reader.TryReadInt8(), | ||
| 19 | } | ||
| 20 | for i := 0; i < int(netsetconvar.Length); i++ { | ||
| 21 | convars = append(convars, ConVar{ | ||
| 22 | Name: reader.TryReadString(), | ||
| 23 | Value: reader.TryReadString(), | ||
| 24 | }) | ||
| 25 | } | ||
| 26 | netsetconvar.ConVars = convars | ||
| 27 | return netsetconvar | ||
| 28 | } | ||