diff options
Diffstat (limited to 'pkg/messages/types/netTick.go')
| -rw-r--r-- | pkg/messages/types/netTick.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/messages/types/netTick.go b/pkg/messages/types/netTick.go new file mode 100644 index 0000000..e14f259 --- /dev/null +++ b/pkg/messages/types/netTick.go | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | package messages | ||
| 2 | |||
| 3 | import "github.com/pektezol/bitreader" | ||
| 4 | |||
| 5 | type NetTick struct { | ||
| 6 | Tick int32 | ||
| 7 | HostFrameTime int16 | ||
| 8 | HostFrameTimeStdDeviation int16 | ||
| 9 | } | ||
| 10 | |||
| 11 | func ParseNetTick(reader *bitreader.ReaderType) NetTick { | ||
| 12 | return NetTick{ | ||
| 13 | Tick: int32(reader.TryReadBits(32)), | ||
| 14 | HostFrameTime: int16(reader.TryReadBits(16) / 10e5), | ||
| 15 | HostFrameTimeStdDeviation: int16(reader.TryReadBits(16) / 10e5), | ||
| 16 | } | ||
| 17 | } | ||