- match client.send_command("list".to_string()) {\r
- Ok(resp) => {\r
- println!("{}", resp.body);\r
- Vec::new()\r
- },\r
- Err(_e) => {\r
- println!("Error asking seed");\r
- Vec::new()\r
- },\r
+ StatusFromRcon {\r
+ players:\r
+ match client.send_command("list".to_string()) {\r
+ Ok(resp) =>\r
+ match resp.body.find(':') {\r
+ Some(i) => resp.body[i + 1..resp.body.len() - 1].split(',').map(|nick| nick.trim().to_string()).collect(),\r
+ None => Vec::new()\r
+ },\r
+ Err(_e) => {\r
+ println!("Error from 'list' command");\r
+ Vec::new()\r
+ },\r
+ }\r