aboutsummaryrefslogtreecommitdiff
path: root/packets/messages/types/SvcServerInfo.go
diff options
context:
space:
mode:
Diffstat (limited to 'packets/messages/types/SvcServerInfo.go')
-rw-r--r--packets/messages/types/SvcServerInfo.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/packets/messages/types/SvcServerInfo.go b/packets/messages/types/SvcServerInfo.go
new file mode 100644
index 0000000..9d2648b
--- /dev/null
+++ b/packets/messages/types/SvcServerInfo.go
@@ -0,0 +1,43 @@
1package types
2
3import "github.com/pektezol/bitreader"
4
5type SvcServerInfo struct {
6 Protocol uint16
7 ServerCount uint32
8 IsHltv bool
9 IsDedicated bool
10 ClientCrc int32
11 MaxClasses uint16
12 MapCrc uint32
13 PlayerSlot uint8
14 MaxClients uint8
15 Unk uint32
16 TickInterval float32
17 COs byte
18 GameDir string
19 MapName string
20 SkyName string
21 HostName string
22}
23
24func ParseSvcServerInfo(reader *bitreader.ReaderType) SvcServerInfo {
25 return SvcServerInfo{
26 Protocol: reader.TryReadInt16(),
27 ServerCount: reader.TryReadInt32(),
28 IsHltv: reader.TryReadBool(),
29 IsDedicated: reader.TryReadBool(),
30 ClientCrc: int32(reader.TryReadInt32()),
31 MaxClasses: reader.TryReadInt16(),
32 MapCrc: reader.TryReadInt32(),
33 PlayerSlot: reader.TryReadInt8(),
34 MaxClients: reader.TryReadInt8(),
35 Unk: reader.TryReadInt32(),
36 TickInterval: reader.TryReadFloat32(),
37 COs: reader.TryReadInt8(),
38 GameDir: reader.TryReadString(),
39 MapName: reader.TryReadString(),
40 SkyName: reader.TryReadString(),
41 HostName: reader.TryReadString(),
42 }
43}