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