From 77e4b066cb8d506b4bc944ab4eb2d6e4679e2202 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sat, 15 Jun 2024 13:58:30 +0300 Subject: enable multithreading with goroutines (#20) --- pkg/messages/types/netTick.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pkg/messages/types/netTick.go') 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 import ( "github.com/pektezol/bitreader" - "github.com/pektezol/sdp.go/pkg/writer" + "github.com/pektezol/sdp.go/pkg/types" ) type NetTick struct { - Tick uint32 - HostFrameTime float32 - HostFrameTimeStdDeviation float32 + Tick uint32 `json:"tick"` + HostFrameTime float32 `json:"host_frame_time"` + HostFrameTimeStdDeviation float32 `json:"host_frame_time_std_deviation"` } -func ParseNetTick(reader *bitreader.Reader) NetTick { +func ParseNetTick(reader *bitreader.Reader, demo *types.Demo) NetTick { netTick := NetTick{ Tick: reader.TryReadUInt32(), HostFrameTime: float32(reader.TryReadUInt16()) / 1e5, HostFrameTimeStdDeviation: float32(reader.TryReadUInt16()) / 1e5, } - writer.TempAppendLine("\t\tTick: %d", netTick.Tick) - writer.TempAppendLine("\t\tHost Frame Time: %f", netTick.HostFrameTime) - writer.TempAppendLine("\t\tHost Frame Time Std Deviation: %f", netTick.HostFrameTimeStdDeviation) + demo.Writer.TempAppendLine("\t\tTick: %d", netTick.Tick) + demo.Writer.TempAppendLine("\t\tHost Frame Time: %f", netTick.HostFrameTime) + demo.Writer.TempAppendLine("\t\tHost Frame Time Std Deviation: %f", netTick.HostFrameTimeStdDeviation) return netTick } -- cgit v1.2.3