From: Greg Burri Date: Mon, 22 Mar 2021 21:39:59 +0000 (+0100) Subject: Fix an issue where too few player was displayed X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=0a5f926bbdb9350b3ba94da4744c0ef0aeb4caa4;p=valheim_web.git Fix an issue where too few player was displayed --- 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; }