Add new messages
This commit is contained in:
@@ -15,6 +15,7 @@ pub struct Room {
|
||||
pub name: String,
|
||||
pub connections: HashMap<SocketAddr, usize>,
|
||||
pub players: Vec<Player>,
|
||||
pub active_player: usize,
|
||||
}
|
||||
|
||||
impl Room {
|
||||
@@ -60,6 +61,7 @@ impl Room {
|
||||
.iter()
|
||||
.map(|p| (p.name.clone(), p.score, p.ws.is_some()))
|
||||
.collect(),
|
||||
active_player: self.active_player,
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
@@ -71,6 +73,7 @@ impl Room {
|
||||
ClientMessage::CreateRoom(_) | ClientMessage::JoinRoom(_, _) => {
|
||||
eprintln!("[{}] Illegal client message {:?}", self.name, msg);
|
||||
}
|
||||
_ => todo!(),
|
||||
}
|
||||
!self.connections.is_empty()
|
||||
}
|
||||
|
Reference in New Issue
Block a user