aboutsummaryrefslogtreecommitdiffstats
path: root/packet/command/qtvstringcmd/qtvstringcmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'packet/command/qtvstringcmd/qtvstringcmd.go')
-rw-r--r--packet/command/qtvstringcmd/qtvstringcmd.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/packet/command/qtvstringcmd/qtvstringcmd.go b/packet/command/qtvstringcmd/qtvstringcmd.go
new file mode 100644
index 0000000..c8cd49e
--- /dev/null
+++ b/packet/command/qtvstringcmd/qtvstringcmd.go
@@ -0,0 +1,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()
+}