diff options
| author | Fuwn <[email protected]> | 2021-04-26 13:26:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-04-26 13:26:53 -0700 |
| commit | 7318396b45a64ed1336d50a5694303e849e0bfd4 (patch) | |
| tree | 362223bfc517989590918a1ff5b32e1f02ab4165 /src/server_dev/auto/cmd/session.rs | |
| parent | etc: Prepend license identifier to *most* files (diff) | |
| download | whirl-7318396b45a64ed1336d50a5694303e849e0bfd4.tar.xz whirl-7318396b45a64ed1336d50a5694303e849e0bfd4.zip | |
etc: Remove legacy server module
Diffstat (limited to 'src/server_dev/auto/cmd/session.rs')
| -rw-r--r-- | src/server_dev/auto/cmd/session.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/server_dev/auto/cmd/session.rs b/src/server_dev/auto/cmd/session.rs new file mode 100644 index 0000000..19969dc --- /dev/null +++ b/src/server_dev/auto/cmd/session.rs @@ -0,0 +1,36 @@ +use std::str::from_utf8; + +use bytes::BytesMut; + +use crate::server::cmd::session::SessionInitializationCommand; + +struct _SessionInitializationCommandServer { + pub error: usize, + pub app_name: String, + pub protocol: usize, + pub server_type: usize, + pub serial: String, + pub private: usize, + pub channel: String, +} + +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(21..(20 + command.get(20).unwrap().to_owned() as usize + 1)) + .unwrap(), + ) + .unwrap() + .to_string(), + // password: "".to_string() + } +} + +// pub fn create_session_initialization_command() -> +// SessionInitializationCommandServer { SessionInitializationCommandServer { +// +// } +// } |