From b0336a574d710ba48449d7330b332c18231df1c5 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Tue, 23 Mar 2021 14:00:25 +0100 Subject: [PATCH] Display the number of player instead of the names (because of a bug) --- backend/src/valheim_controller.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 = -- 2.45.2