Add debug information for spectator count.

This commit is contained in:
yukirij 2024-10-05 14:10:32 -07:00
parent 285987210b
commit d8a33d1c10
2 changed files with 5 additions and 1 deletions

View File

@ -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()
}
}

View File

@ -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();