|
|
@ -192,7 +192,7 @@ impl ClientLocation { |
|
|
|
let in_lobby = self.lobbies.iter()
|
|
|
|
.any(|k| k.contains(id));
|
|
|
|
let in_room = self.rooms.iter()
|
|
|
|
.filter(|k| k.is_none())
|
|
|
|
.filter(|k| k.is_some())
|
|
|
|
.map(|k| k.unwrap())
|
|
|
|
.any(|k| k.contains(id));
|
|
|
|
|
|
|
@ -216,7 +216,7 @@ impl ClientLocation { |
|
|
|
self.err_if_client_is_in_area(id, CreateRoomError::ClientInAreaAlready)?;
|
|
|
|
let (room_id, empty_room) = self.rooms.iter_mut()
|
|
|
|
.enumerate()
|
|
|
|
.filter(|(_, k)| k.is_none())
|
|
|
|
.filter(|(_, k)| k.is_some())
|
|
|
|
.nth(0)
|
|
|
|
.ok_or(CreateRoomError::NoOpenSlots)?;
|
|
|
|
|
|
|
@ -265,7 +265,7 @@ impl ClientLocation { |
|
|
|
}
|
|
|
|
|
|
|
|
self.rooms.iter_mut()
|
|
|
|
.filter(|lobby| lobby.is_none())
|
|
|
|
.filter(|lobby| lobby.is_some())
|
|
|
|
.map(|lobby| lobby.unwrap())
|
|
|
|
.map(|mut lobby| lobby.remove(id))
|
|
|
|
.any(|k| k);
|
|
|
|