aboutsummaryrefslogtreecommitdiff
path: root/packets/messages/types/NetTick.go
blob: 9dae14bfeaaabbbcf2b488754540abd8161c73a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package types

import "github.com/pektezol/bitreader"

type NetTick struct {
	Tick                      uint32
	HostFrameTime             float32
	HostFrameTimeStdDeviation float32
}

func ParseNetTick(reader *bitreader.ReaderType) NetTick {
	return NetTick{
		Tick:                      reader.TryReadInt32(),
		HostFrameTime:             float32(reader.TryReadInt16()) / 1e5,
		HostFrameTimeStdDeviation: float32(reader.TryReadInt16()) / 1e5,
	}
}