aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/netTick.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/messages/types/netTick.go')
-rw-r--r--pkg/messages/types/netTick.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/messages/types/netTick.go b/pkg/messages/types/netTick.go
index 9ef1ce2..0bcbc05 100644
--- a/pkg/messages/types/netTick.go
+++ b/pkg/messages/types/netTick.go
@@ -2,23 +2,23 @@ package messages
2 2
3import ( 3import (
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
8type NetTick struct { 8type NetTick struct {
9 Tick uint32 9 Tick uint32 `json:"tick"`
10 HostFrameTime float32 10 HostFrameTime float32 `json:"host_frame_time"`
11 HostFrameTimeStdDeviation float32 11 HostFrameTimeStdDeviation float32 `json:"host_frame_time_std_deviation"`
12} 12}
13 13
14func ParseNetTick(reader *bitreader.Reader) NetTick { 14func ParseNetTick(reader *bitreader.Reader, demo *types.Demo) NetTick {
15 netTick := NetTick{ 15 netTick := NetTick{
16 Tick: reader.TryReadUInt32(), 16 Tick: reader.TryReadUInt32(),
17 HostFrameTime: float32(reader.TryReadUInt16()) / 1e5, 17 HostFrameTime: float32(reader.TryReadUInt16()) / 1e5,
18 HostFrameTimeStdDeviation: float32(reader.TryReadUInt16()) / 1e5, 18 HostFrameTimeStdDeviation: float32(reader.TryReadUInt16()) / 1e5,
19 } 19 }
20 writer.TempAppendLine("\t\tTick: %d", netTick.Tick) 20 demo.Writer.TempAppendLine("\t\tTick: %d", netTick.Tick)
21 writer.TempAppendLine("\t\tHost Frame Time: %f", netTick.HostFrameTime) 21 demo.Writer.TempAppendLine("\t\tHost Frame Time: %f", netTick.HostFrameTime)
22 writer.TempAppendLine("\t\tHost Frame Time Std Deviation: %f", netTick.HostFrameTimeStdDeviation) 22 demo.Writer.TempAppendLine("\t\tHost Frame Time Std Deviation: %f", netTick.HostFrameTimeStdDeviation)
23 return netTick 23 return netTick
24} 24}