diff options
Diffstat (limited to 'pkg/messages/types/svcServerInfo.go')
| -rw-r--r-- | pkg/messages/types/svcServerInfo.go | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/pkg/messages/types/svcServerInfo.go b/pkg/messages/types/svcServerInfo.go index 9e3113c..2aabccd 100644 --- a/pkg/messages/types/svcServerInfo.go +++ b/pkg/messages/types/svcServerInfo.go | |||
| @@ -2,29 +2,29 @@ package messages | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/pektezol/bitreader" | 4 | "github.com/pektezol/bitreader" |
| 5 | "github.com/pektezol/sdp.go/pkg/writer" | 5 | "github.com/pektezol/sdp.go/pkg/types" |
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | type SvcServerInfo struct { | 8 | type SvcServerInfo struct { |
| 9 | Protocol uint16 | 9 | Protocol uint16 `json:"protocol"` |
| 10 | ServerCount uint32 | 10 | ServerCount uint32 `json:"server_count"` |
| 11 | IsHltv bool | 11 | IsHltv bool `json:"is_hltv"` |
| 12 | IsDedicated bool | 12 | IsDedicated bool `json:"is_dedicated"` |
| 13 | ClientCrc int32 | 13 | ClientCrc int32 `json:"client_crc"` |
| 14 | StringTableCrc uint32 | 14 | StringTableCrc uint32 `json:"string_table_crc"` |
| 15 | MaxServerClasses uint16 | 15 | MaxServerClasses uint16 `json:"max_server_classes"` |
| 16 | MapCrc uint32 | 16 | MapCrc uint32 `json:"map_crc"` |
| 17 | PlayerCount uint8 | 17 | PlayerCount uint8 `json:"player_count"` |
| 18 | MaxClients uint8 | 18 | MaxClients uint8 `json:"max_clients"` |
| 19 | TickInterval float32 | 19 | TickInterval float32 `json:"tick_interval"` |
| 20 | Platform string | 20 | Platform string `json:"platform"` |
| 21 | GameDir string | 21 | GameDir string `json:"game_dir"` |
| 22 | MapName string | 22 | MapName string `json:"map_name"` |
| 23 | SkyName string | 23 | SkyName string `json:"sky_name"` |
| 24 | HostName string | 24 | HostName string `json:"host_name"` |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | func ParseSvcServerInfo(reader *bitreader.Reader) SvcServerInfo { | 27 | func ParseSvcServerInfo(reader *bitreader.Reader, demo *types.Demo) SvcServerInfo { |
| 28 | svcServerInfo := SvcServerInfo{ | 28 | svcServerInfo := SvcServerInfo{ |
| 29 | Protocol: reader.TryReadUInt16(), | 29 | Protocol: reader.TryReadUInt16(), |
| 30 | ServerCount: reader.TryReadUInt32(), | 30 | ServerCount: reader.TryReadUInt32(), |
| @@ -43,21 +43,21 @@ func ParseSvcServerInfo(reader *bitreader.Reader) SvcServerInfo { | |||
| 43 | SkyName: reader.TryReadString(), | 43 | SkyName: reader.TryReadString(), |
| 44 | HostName: reader.TryReadString(), | 44 | HostName: reader.TryReadString(), |
| 45 | } | 45 | } |
| 46 | writer.TempAppendLine("\t\tNetwork Protocol: %d", svcServerInfo.Protocol) | 46 | demo.Writer.TempAppendLine("\t\tNetwork Protocol: %d", svcServerInfo.Protocol) |
| 47 | writer.TempAppendLine("\t\tServer Count: %d", svcServerInfo.ServerCount) | 47 | demo.Writer.TempAppendLine("\t\tServer Count: %d", svcServerInfo.ServerCount) |
| 48 | writer.TempAppendLine("\t\tIs Hltv: %t", svcServerInfo.IsHltv) | 48 | demo.Writer.TempAppendLine("\t\tIs Hltv: %t", svcServerInfo.IsHltv) |
| 49 | writer.TempAppendLine("\t\tIs Dedicated: %t", svcServerInfo.IsDedicated) | 49 | demo.Writer.TempAppendLine("\t\tIs Dedicated: %t", svcServerInfo.IsDedicated) |
| 50 | writer.TempAppendLine("\t\tServer Client CRC: %d", svcServerInfo.ClientCrc) | 50 | demo.Writer.TempAppendLine("\t\tServer Client CRC: %d", svcServerInfo.ClientCrc) |
| 51 | writer.TempAppendLine("\t\tString Table CRC: %d", svcServerInfo.StringTableCrc) | 51 | demo.Writer.TempAppendLine("\t\tString Table CRC: %d", svcServerInfo.StringTableCrc) |
| 52 | writer.TempAppendLine("\t\tMax Server Classes: %d", svcServerInfo.MaxServerClasses) | 52 | demo.Writer.TempAppendLine("\t\tMax Server Classes: %d", svcServerInfo.MaxServerClasses) |
| 53 | writer.TempAppendLine("\t\tServer Map CRC: %d", svcServerInfo.MapCrc) | 53 | demo.Writer.TempAppendLine("\t\tServer Map CRC: %d", svcServerInfo.MapCrc) |
| 54 | writer.TempAppendLine("\t\tCurrent Player Count: %d", svcServerInfo.PlayerCount) | 54 | demo.Writer.TempAppendLine("\t\tCurrent Player Count: %d", svcServerInfo.PlayerCount) |
| 55 | writer.TempAppendLine("\t\tMax Player Count: %d", svcServerInfo.MaxClients) | 55 | demo.Writer.TempAppendLine("\t\tMax Player Count: %d", svcServerInfo.MaxClients) |
| 56 | writer.TempAppendLine("\t\tInterval Per Tick: %f", svcServerInfo.TickInterval) | 56 | demo.Writer.TempAppendLine("\t\tInterval Per Tick: %f", svcServerInfo.TickInterval) |
| 57 | writer.TempAppendLine("\t\tPlatform: %s", svcServerInfo.Platform) | 57 | demo.Writer.TempAppendLine("\t\tPlatform: %s", svcServerInfo.Platform) |
| 58 | writer.TempAppendLine("\t\tGame Directory: %s", svcServerInfo.GameDir) | 58 | demo.Writer.TempAppendLine("\t\tGame Directory: %s", svcServerInfo.GameDir) |
| 59 | writer.TempAppendLine("\t\tMap Name: %s", svcServerInfo.MapName) | 59 | demo.Writer.TempAppendLine("\t\tMap Name: %s", svcServerInfo.MapName) |
| 60 | writer.TempAppendLine("\t\tSky Name: %s", svcServerInfo.SkyName) | 60 | demo.Writer.TempAppendLine("\t\tSky Name: %s", svcServerInfo.SkyName) |
| 61 | writer.TempAppendLine("\t\tHost Name: %s", svcServerInfo.HostName) | 61 | demo.Writer.TempAppendLine("\t\tHost Name: %s", svcServerInfo.HostName) |
| 62 | return svcServerInfo | 62 | return svcServerInfo |
| 63 | } | 63 | } |