}\r
\r
pub fn format_active_players(&self) -> String {\r
- self.active_players.join(", ")\r
+ if self.active_players.len() == 0 {\r
+ String::from("<none>")\r
+ } else {\r
+ self.active_players.join(", ")\r
+ }\r
}\r
\r
pub fn format_last_backup(&self) -> String {\r
\r
journal.seek_tail().unwrap();\r
\r
- let mut number_of_connections = -1;\r
+ let mut number_of_connections = 0;\r
let mut players : Vec<String> = Vec::new();\r
\r
loop {\r
if let Some(pos) = mess.find("Got character ZDOID from") {\r
let character_str = mess.get(pos+25..).unwrap();\r
if let Some(pos_end) = character_str.find(" : ") {\r
- let player_name = String::from(character_str.get(0..pos_end));\r
- if !players.contains(player_name) {\r
+ let player_name = String::from(character_str.get(0..pos_end).unwrap());\r
+ if !players.contains(&player_name) {\r
players.push(player_name);\r
if players.len() == number_of_connections {\r
return players;\r