diff options
| author | Fuwn <[email protected]> | 2021-04-26 13:26:53 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-04-26 13:26:53 +0000 |
| commit | 6bf261e243b11b376a0cbfbe9ab6f9d6cb398aed (patch) | |
| tree | 326e64552b6223d21feb3cc5b525f792e252ccc1 /src/server_dev/auto/cmd/session.rs | |
| parent | etc: Prepend license identifier to *most* files (diff) | |
| download | whirl-6bf261e243b11b376a0cbfbe9ab6f9d6cb398aed.tar.xz whirl-6bf261e243b11b376a0cbfbe9ab6f9d6cb398aed.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 { +// +// } +// } |