diff --git a/server/src/app/session.rs b/server/src/app/session.rs index 548c46f..8e921ff 100644 --- a/server/src/app/session.rs +++ b/server/src/app/session.rs @@ -77,6 +77,10 @@ impl Session { pub fn spectators(&self) -> usize { + println!("{}", self.connections.len()); + for conn in &self.connections { + print!("{} ", *conn); + } println!(""); self.connections.len() } } diff --git a/server/src/manager/data.rs b/server/src/manager/data.rs index e5e0b49..275862e 100644 --- a/server/src/manager/data.rs +++ b/server/src/manager/data.rs @@ -1032,7 +1032,7 @@ fn generate_game_state(app:&App, session:&Session) -> protocol::PacketGameStateR response.dawn_online = session.p_dawn.connections.len() > 0; response.dusk_online = session.p_dusk.connections.len() > 0; - response.spectators = session.connections.len() as u32; + response.spectators = session.spectators() as u32; // Get history response.history = session.game.history.clone();