aboutsummaryrefslogtreecommitdiff
path: root/packets/messages/types/NetTick.go
diff options
context:
space:
mode:
Diffstat (limited to 'packets/messages/types/NetTick.go')
-rw-r--r--packets/messages/types/NetTick.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/packets/messages/types/NetTick.go b/packets/messages/types/NetTick.go
new file mode 100644
index 0000000..9dae14b
--- /dev/null
+++ b/packets/messages/types/NetTick.go
@@ -0,0 +1,17 @@
1package types
2
3import "github.com/pektezol/bitreader"
4
5type NetTick struct {
6 Tick uint32
7 HostFrameTime float32
8 HostFrameTimeStdDeviation float32
9}
10
11func ParseNetTick(reader *bitreader.ReaderType) NetTick {
12 return NetTick{
13 Tick: reader.TryReadInt32(),
14 HostFrameTime: float32(reader.TryReadInt16()) / 1e5,
15 HostFrameTimeStdDeviation: float32(reader.TryReadInt16()) / 1e5,
16 }
17}