\r
const MINECRAFT_PROCESS_NAME: &str = "java";\r
\r
-#[cfg(target_os = "linux")]\r
-const STRING_BEFORE_CHARACTER_NAME: &str = "Got character ZDOID from";\r
-\r
-#[cfg(target_os = "linux")]\r
-const STRING_BEFORE_NB_OF_CONNECTIONS: &str = "Connections";\r
-\r
// It doesn't work for the moment, it only scan the connection event and do not treat disconnections.\r
fn get_active_players(rcon_password: &str) -> Vec<String> {\r
let mut client = minecraft_client_rs::Client::new("127.0.0.1:25575".to_string()).unwrap();\r
Ok(_) => {\r
match client.send_command("list".to_string()) {\r
Ok(resp) => {\r
- println!("{}", resp.body);\r
- Vec::new()\r
+ resp.body\r
+ .split('\n')\r
+ .skip(1)\r
+ .filter(|n| !n.is_empty())\r
+ .map(|n| n.to_string())\r
+ .collect()\r
},\r
Err(_e) => {\r
- println!("Error asking seed");\r
+ println!("Error from 'list' command");\r
Vec::new()\r
},\r
}\r