aboutsummaryrefslogtreecommitdiff
path: root/packets/messages/types/NetTick.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2022-11-08 22:48:20 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-16 21:39:39 +0300
commit833a46544df2ed2a7afdba08ebfe02ed7741d86a (patch)
tree2432f14b449761086d773fb8cd072797d23006f1 /packets/messages/types/NetTick.go
parentput class type into individual files (diff)
downloadsdp.go-833a46544df2ed2a7afdba08ebfe02ed7741d86a.tar.gz
sdp.go-833a46544df2ed2a7afdba08ebfe02ed7741d86a.tar.bz2
sdp.go-833a46544df2ed2a7afdba08ebfe02ed7741d86a.zip
net/svc messages
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}