diff options
| -rw-r--r-- | mumctl/src/main.rs | 6 | ||||
| -rw-r--r-- | mumd/src/state.rs | 4 | ||||
| -rw-r--r-- | mumlib/src/command.rs | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index f704b19..2f1063f 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -268,10 +268,10 @@ fn match_opt() -> Result<(), Error> { password: password.map(|x| x.to_string()), accept_invalid_cert: true, //TODO })??; - if let Some(CommandResponse::ServerConnect { welcome_message }) = response { - println!("Connected to {}", host); + if let Some(CommandResponse::ServerConnect { welcome_message, server_state }) = response { + parse_state(&server_state); if let Some(message) = welcome_message { - println!("Welcome: {}", message); + println!("\nWelcome: {}", message); } } } diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 2cfdfb1..37dd6a2 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -605,7 +605,8 @@ pub fn handle_command( accept_invalid_cert, ))) .unwrap(); - at!(TcpEvent::Connected, |res| { + let state = Arc::clone(&og_state); + at!(TcpEvent::Connected, move |res| { //runs the closure when the client is connected if let TcpEventData::Connected(res) = res { Box::new(iter::once(res.map(|msg| { @@ -615,6 +616,7 @@ pub fn handle_command( } else { None }, + server_state: state.read().unwrap().server.as_ref().unwrap().into(), }) }))) } else { diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index 48174fc..c5d4676 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -115,6 +115,7 @@ pub enum CommandResponse { Pong, ServerConnect { welcome_message: Option<String>, + server_state: Server, }, ServerStatus { version: u32, |
