const MINECRAFT_PROCESS_NAME: &str = "java";\r
\r
struct StatusFromRcon {\r
- players: Vec<String>,\r
- version: String,\r
+ players: Vec<String>\r
}\r
\r
fn get_status_from_rcon(rcon_password: &str) -> StatusFromRcon {\r
println!("Error from 'list' command");\r
Vec::new()\r
},\r
- },\r
- version:\r
- match client.send_command("version".to_string()) {\r
- Ok(resp) => resp.body,\r
- Err(_e) => {\r
- println!("Error from 'version' command");\r
- String::new()\r
- }\r
}\r
}\r
},\r
Err(_e) => {\r
println!("Authentication error");\r
- StatusFromRcon { players: Vec::new(), version: String::new() }\r
+ StatusFromRcon { players: Vec::new() }\r
},\r
};\r
\r
uptime: std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs() - process.start_time(),\r
world_size,\r
active_players: status_from_rcon.players,\r
- version: status_from_rcon.version,\r
+ version: process.cmd()[process.cmd().len() - 2].clone(), // TODO: Extract the version from the .jar filename.\r
last_backup: get_last_backup_datetime(backup_path)\r
}\r
)\r