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/SvcServerInfo.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/SvcServerInfo.go')
| -rw-r--r-- | packets/messages/types/SvcServerInfo.go | 43 |
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 @@ | |||
| 1 | package types | ||
| 2 | |||
| 3 | import "github.com/pektezol/bitreader" | ||
| 4 | |||
| 5 | type 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 | |||
| 24 | func 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 | } | ||