aboutsummaryrefslogtreecommitdiff
path: root/packets/messages/types/NetSetConVar.go
blob: eca05e0f95c0c04551f2861d5b14b29245831927 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package types

import "github.com/pektezol/bitreader"

type NetSetConVar struct {
	ConVars []ConVar
}

type ConVar struct {
	Name  string
	Value string
}

func ParseNetSetConVar(reader *bitreader.ReaderType) NetSetConVar {
	length := reader.TryReadInt8()
	convars := make([]ConVar, length)
	for i := 0; i < int(length); i++ {
		convars[i] = ConVar{
			Name:  reader.TryReadString(),
			Value: reader.TryReadString(),
		}
	}
	return NetSetConVar{
		ConVars: convars,
	}
}