aboutsummaryrefslogtreecommitdiffstats
path: root/packet/command/qtvstringcmd/qtvstringcmd.go
blob: c8cd49e9a697c3286198db59862863716858471d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package qtvstringcmd

import (
	"github.com/osm/quake/common/buffer"
	"github.com/osm/quake/protocol/qtv"
)

type Command struct {
	String string
}

func (cmd *Command) Bytes() []byte {
	buf := buffer.New()

	buf.PutUint16(uint16(1+2+len(cmd.String)) + 1)
	buf.PutByte(byte(qtv.CLCStringCmd))
	buf.PutString(cmd.String)

	return buf.Bytes()
}