aboutsummaryrefslogtreecommitdiff
path: root/src/server/cmd/commands/action.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-04-26 13:30:51 +0000
committerFuwn <[email protected]>2021-04-26 13:30:51 +0000
commitaf68ae63e4b0f5f6237bbda4fed9fd2a6022357d (patch)
tree02bbd59bf0a54808e335c1d703d3dac4cdc0773b /src/server/cmd/commands/action.rs
parentfix: Actually remove legacy server module (diff)
downloadwhirl-af68ae63e4b0f5f6237bbda4fed9fd2a6022357d.tar.xz
whirl-af68ae63e4b0f5f6237bbda4fed9fd2a6022357d.zip
fmt: Rename re_server module to server
Diffstat (limited to 'src/server/cmd/commands/action.rs')
-rw-r--r--src/server/cmd/commands/action.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server/cmd/commands/action.rs b/src/server/cmd/commands/action.rs
new file mode 100644
index 0000000..99da54f
--- /dev/null
+++ b/src/server/cmd/commands/action.rs
@@ -0,0 +1,20 @@
+// Copyleft 2021-2021 Whirlsplash
+// SPDX-License-Identifier: GPL-3.0-only
+
+use bytes::{BufMut, BytesMut};
+
+pub fn create_action() -> Vec<u8> {
+ let mut command = BytesMut::new();
+
+ command.put_slice(&[
+ 0x01, 0x11, 0x00, 0x05, 0x54, 0x52, 0x41, 0x44, 0x45, 0x07, 0x26, 0x7c, 0x2b, 0x69, 0x6e, 0x76,
+ 0x3e,
+ ]);
+
+ // Convert to vector and insert the length
+ let mut command_as_vec = command.to_vec();
+ command_as_vec.insert(0, command.len() as u8 + 1);
+
+ // Return bytes
+ command_as_vec
+}