From: Greg Burri Date: Tue, 23 Mar 2021 13:00:25 +0000 (+0100) Subject: Display the number of player instead of the names X-Git-Url: http://git.euphorik.ch/index.cgi?a=commitdiff_plain;h=b0336a574d710ba48449d7330b332c18231df1c5;p=valheim_web.git Display the number of player instead of the names (because of a bug) --- diff --git a/backend/src/valheim_controller.rs b/backend/src/valheim_controller.rs index 6fa6c7f..33c532f 100644 --- a/backend/src/valheim_controller.rs +++ b/backend/src/valheim_controller.rs @@ -38,11 +38,13 @@ impl ValheimExe { } pub fn format_active_players(&self) -> String { + /* Commented because the player list isn't correct (the number is). if self.active_players.len() == 0 { String::from("") } else { self.active_players.join(", ") - } + }*/ + self.active_players.len().to_string() } pub fn format_last_backup(&self) -> String { @@ -75,9 +77,14 @@ fn format_byte_size(bytes: u64, precision: usize) -> String { } const VALHEIM_PROCESS_NAME: &str = "valheim_server"; + +#[cfg(target_os = "linux")] const STRING_BEFORE_CHARACTER_NAME: &str = "Got character ZDOID from"; + +#[cfg(target_os = "linux")] const STRING_BEFORE_NB_OF_CONNECTIONS: &str = "Connections"; +// It doesn't work for the moment, it only scan the connection event and do not treat disconnections. #[cfg(target_os = "linux")] fn get_active_players() -> Vec { let mut journal =