aboutsummaryrefslogtreecommitdiffstats
path: root/packet/command/updatestatlong/updatestatlong.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--packet/command/updatestatlong/updatestatlong.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/packet/command/updatestatlong/updatestatlong.go b/packet/command/updatestatlong/updatestatlong.go
new file mode 100644
index 0000000..f45a0d9
--- /dev/null
+++ b/packet/command/updatestatlong/updatestatlong.go
@@ -0,0 +1,37 @@
+package updatestatlong
+
+import (
+ "github.com/osm/quake/common/buffer"
+ "github.com/osm/quake/common/context"
+ "github.com/osm/quake/protocol"
+)
+
+type Command struct {
+ Stat byte
+ Value int32
+}
+
+func (cmd *Command) Bytes() []byte {
+ buf := buffer.New()
+
+ buf.PutByte(protocol.SVCUpdateStatLong)
+ buf.PutByte(cmd.Stat)
+ buf.PutInt32(cmd.Value)
+
+ return buf.Bytes()
+}
+
+func Parse(ctx *context.Context, buf *buffer.Buffer) (*Command, error) {
+ var err error
+ var cmd Command
+
+ if cmd.Stat, err = buf.ReadByte(); err != nil {
+ return nil, err
+ }
+
+ if cmd.Value, err = buf.GetInt32(); err != nil {
+ return nil, err
+ }
+
+ return &cmd, nil
+}
>added better clarification to help menuGravatar BanceDev 1-1/+2 2024-09-13improved installation instructionsGravatar BanceDev 1-3/+3 2024-09-12v0.1.1Gravatar BanceDev 1-1/+1 2024-09-12fixed bug in input buffer handling due to misplaced printGravatar BanceDev 2-5/+8 2024-09-12Update build.yml checkout v4Gravatar Lance Borden 1-1/+1 2024-09-12Update build.yml to artifact v4Gravatar Lance Borden 1-1/+1 2024-09-12fixed exit status issue with non interative modeGravatar BanceDev 1-1/+1 2024-09-12added non interative mode for running lua scriptsGravatar BanceDev 2-4/+28 2024-09-12temporary github action fix until non-interactive mode is implementedGravatar BanceDev 1-2/+2 2024-09-12attempt to update build script to accept input into lush shellGravatar BanceDev 2-4/+6 2024-09-12prevent lush workflow from getting stuck in testsGravatar Lance Borden 1-1/+4 2024-09-12removed chsh in workflowGravatar Lance Borden 1-4/+1