From 0a5f926bbdb9350b3ba94da4744c0ef0aeb4caa4 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Mon, 22 Mar 2021 22:39:59 +0100 Subject: [PATCH] Fix an issue where too few player was displayed --- backend/src/valheim_controller.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/valheim_controller.rs b/backend/src/valheim_controller.rs index aaf82f0..29f30f1 100644 --- a/backend/src/valheim_controller.rs +++ b/backend/src/valheim_controller.rs @@ -109,7 +109,9 @@ fn get_active_players() -> Vec { let nb_of_connections_str = mess.get(pos+STRING_BEFORE_NB_OF_CONNECTIONS.len()+1..).unwrap(); if let Some(pos_end) = nb_of_connections_str.find(' ') { if let Ok(n) = nb_of_connections_str.get(0..pos_end).unwrap().parse() { - number_of_connections = n; + if n > number_of_connections { + number_of_connections = n; + } if players.len() >= number_of_connections { return players; } -- 2.45.2