aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcServerInfo.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-17 14:40:02 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-20 11:10:18 +0300
commit021c674e94f600d38f05f91bd3fe76dc7231082c (patch)
treef9298b113a1d67fc1aaae50824e4674a92305cbb /pkg/messages/types/svcServerInfo.go
parentparse signOnState as string (diff)
downloadsdp.go-021c674e94f600d38f05f91bd3fe76dc7231082c.tar.gz
sdp.go-021c674e94f600d38f05f91bd3fe76dc7231082c.tar.bz2
sdp.go-021c674e94f600d38f05f91bd3fe76dc7231082c.zip
proper svcServerInfo parsing
Diffstat (limited to 'pkg/messages/types/svcServerInfo.go')
-rw-r--r--pkg/messages/types/svcServerInfo.go64
1 files changed, 32 insertions, 32 deletions
diff --git a/pkg/messages/types/svcServerInfo.go b/pkg/messages/types/svcServerInfo.go
index c699eca..7d44569 100644
--- a/pkg/messages/types/svcServerInfo.go
+++ b/pkg/messages/types/svcServerInfo.go
@@ -3,41 +3,41 @@ package messages
3import "github.com/pektezol/bitreader" 3import "github.com/pektezol/bitreader"
4 4
5type SvcServerInfo struct { 5type SvcServerInfo struct {
6 Protocol int16 6 Protocol uint16
7 ServerCount int32 7 ServerCount uint32
8 IsHltv bool 8 IsHltv bool
9 IsDedicated bool 9 IsDedicated bool
10 ClientCrc int32 10 ClientCrc int32
11 MaxClasses int16 11 StringTableCrc uint32
12 MapCrc int32 12 MaxServerClasses uint16
13 PlayerSlot int8 13 MapCrc uint32
14 MaxClients int8 14 PlayerCount uint8
15 Unk int32 15 MaxClients uint8
16 TickInterval int32 16 TickInterval float32
17 COs int8 17 Platform string
18 GameDir string 18 GameDir string
19 MapName string 19 MapName string
20 SkyName string 20 SkyName string
21 HostName string 21 HostName string
22} 22}
23 23
24func ParseSvcServerInfo(reader *bitreader.Reader) SvcServerInfo { 24func ParseSvcServerInfo(reader *bitreader.Reader) SvcServerInfo {
25 return SvcServerInfo{ 25 return SvcServerInfo{
26 Protocol: int16(reader.TryReadBits(16)), 26 Protocol: reader.TryReadUInt16(),
27 ServerCount: int32(reader.TryReadBits(32)), 27 ServerCount: reader.TryReadUInt32(),
28 IsHltv: reader.TryReadBool(), 28 IsHltv: reader.TryReadBool(),
29 IsDedicated: reader.TryReadBool(), 29 IsDedicated: reader.TryReadBool(),
30 ClientCrc: int32(reader.TryReadBits(32)), 30 ClientCrc: reader.TryReadSInt32(),
31 MaxClasses: int16(reader.TryReadBits(16)), 31 StringTableCrc: reader.TryReadUInt32(),
32 MapCrc: int32(reader.TryReadBits(32)), 32 MaxServerClasses: reader.TryReadUInt16(),
33 PlayerSlot: int8(reader.TryReadBits(8)), 33 MapCrc: reader.TryReadUInt32(),
34 MaxClients: int8(reader.TryReadBits(8)), 34 PlayerCount: reader.TryReadUInt8(),
35 Unk: int32(reader.TryReadBits(32)), 35 MaxClients: reader.TryReadUInt8(),
36 TickInterval: int32(reader.TryReadBits(32)), 36 TickInterval: reader.TryReadFloat32(),
37 COs: int8(reader.TryReadBits(8)), 37 Platform: reader.TryReadStringLength(1),
38 GameDir: reader.TryReadString(), 38 GameDir: reader.TryReadString(),
39 MapName: reader.TryReadString(), 39 MapName: reader.TryReadString(),
40 SkyName: reader.TryReadString(), 40 SkyName: reader.TryReadString(),
41 HostName: reader.TryReadString(), 41 HostName: reader.TryReadString(),
42 } 42 }
43} 43}