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/classes/consoleCmd.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/classes/consoleCmd.go') diff --git a/pkg/classes/consoleCmd.go b/pkg/classes/consoleCmd.go index 47a44e0..83f7333 100644 --- a/pkg/classes/consoleCmd.go +++ b/pkg/classes/consoleCmd.go @@ -4,16 +4,16 @@ import ( "strings" "github.com/pektezol/bitreader" - "github.com/pektezol/sdp.go/pkg/writer" + "github.com/pektezol/sdp.go/pkg/types" ) type ConsoleCmd struct { - Size int32 - Data string + Size int32 `json:"size"` + Data string `json:"data"` } -func (consoleCmd *ConsoleCmd) ParseConsoleCmd(reader *bitreader.Reader) { +func (consoleCmd *ConsoleCmd) ParseConsoleCmd(reader *bitreader.Reader, demo *types.Demo) { consoleCmd.Size = reader.TryReadSInt32() consoleCmd.Data = reader.TryReadStringLength(uint64(consoleCmd.Size)) - writer.AppendLine("\t%s", strings.TrimSpace(consoleCmd.Data)) + demo.Writer.AppendLine("\t%s", strings.TrimSpace(consoleCmd.Data)) } -- cgit v1.2.3