aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcPrint.go
blob: 0db7ffd8a877bd4fd583d5763aa06a5e7eb57398 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package messages

import (
	"strings"

	"github.com/pektezol/bitreader"
	"github.com/pektezol/sdp.go/pkg/types"
)

type SvcPrint struct {
	Message string `json:"message"`
}

func ParseSvcPrint(reader *bitreader.Reader, demo *types.Demo) SvcPrint {
	svcPrint := SvcPrint{
		Message: reader.TryReadString(),
	}
	// common psycopath behaviour
	demo.Writer.TempAppendLine("\t\t%s", strings.Replace(strings.ReplaceAll(strings.ReplaceAll(svcPrint.Message, "\n", "\n\t\t"), "\n\t\t\n\t\t", ""), "\n\t\t", "", 1))
	return svcPrint
}