aboutsummaryrefslogtreecommitdiff
path: root/src/server_dev/room/cmd/session.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-04-26 13:26:53 +0000
committerFuwn <[email protected]>2021-04-26 13:26:53 +0000
commit6bf261e243b11b376a0cbfbe9ab6f9d6cb398aed (patch)
tree326e64552b6223d21feb3cc5b525f792e252ccc1 /src/server_dev/room/cmd/session.rs
parentetc: Prepend license identifier to *most* files (diff)
downloadwhirl-6bf261e243b11b376a0cbfbe9ab6f9d6cb398aed.tar.xz
whirl-6bf261e243b11b376a0cbfbe9ab6f9d6cb398aed.zip
etc: Remove legacy server module
Diffstat (limited to 'src/server_dev/room/cmd/session.rs')
-rw-r--r--src/server_dev/room/cmd/session.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server_dev/room/cmd/session.rs b/src/server_dev/room/cmd/session.rs
new file mode 100644
index 0000000..dee3931
--- /dev/null
+++ b/src/server_dev/room/cmd/session.rs
@@ -0,0 +1,20 @@
+use std::str::from_utf8;
+
+use bytes::BytesMut;
+
+use crate::server::cmd::session::SessionInitializationCommand;
+
+pub fn parse_session_initialization_command(command: BytesMut) -> SessionInitializationCommand {
+ SessionInitializationCommand {
+ // protocol: command.get(4..4 + command.get(4)).unwrap().to_owned() as usize,
+ // client: "".to_string(),
+ username: from_utf8(
+ command
+ .get(25..(24 + command.get(24).unwrap().to_owned() as usize + 1))
+ .unwrap(),
+ )
+ .unwrap()
+ .to_string(),
+ // password: "".to_string()
+ }
+}