|
@ -108,43 +108,22 @@ pub fn done_bursting(id: ClientId, |
|
|
-> Box<dyn Iterator<Item = (ClientId, SendShipPacket)> + Send> {
|
|
|
-> Box<dyn Iterator<Item = (ClientId, SendShipPacket)> + Send> {
|
|
|
let area = client_location.get_area(id).unwrap();
|
|
|
let area = client_location.get_area(id).unwrap();
|
|
|
if let RoomLobby::Room(room_id) = area {
|
|
|
if let RoomLobby::Room(room_id) = area {
|
|
|
let room = rooms.get_mut(room_id.0).unwrap().as_mut().unwrap();
|
|
|
|
|
|
|
|
|
rooms.get_mut(room_id.0).unwrap().as_mut().map(|room| {
|
|
|
room.bursting = false;
|
|
|
room.bursting = false;
|
|
|
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
Box::new(client_location.get_client_neighbors(id).unwrap().into_iter()
|
|
|
|
|
|
|
|
|
let area_client = client_location.get_local_client(id).unwrap(); // TODO: unwrap
|
|
|
|
|
|
Box::new(client_location.get_client_neighbors(id).unwrap().into_iter() // TODO: unwrap
|
|
|
.map(move |client| {
|
|
|
.map(move |client| {
|
|
|
vec![
|
|
|
vec![
|
|
|
//(client.client, SendShipPacket::BurstDone72(BurstDone72::new())),
|
|
|
|
|
|
(client.client, SendShipPacket::Message(Message::new(GameMessage::BurstDone(BurstDone {
|
|
|
(client.client, SendShipPacket::Message(Message::new(GameMessage::BurstDone(BurstDone {
|
|
|
client: 0,
|
|
|
|
|
|
|
|
|
client: area_client.local_client.id(),
|
|
|
target: 0
|
|
|
target: 0
|
|
|
})))),
|
|
|
})))),
|
|
|
]
|
|
|
]
|
|
|
}).flatten())
|
|
|
}).flatten())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub fn done_bursting2(id: ClientId,
|
|
|
|
|
|
client_location: &ClientLocation,
|
|
|
|
|
|
rooms: &mut Rooms)
|
|
|
|
|
|
-> Box<dyn Iterator<Item = (ClientId, SendShipPacket)> + Send> {
|
|
|
|
|
|
let area = client_location.get_area(id).unwrap();
|
|
|
|
|
|
if let RoomLobby::Room(room_id) = area {
|
|
|
|
|
|
let room = rooms.get_mut(room_id.0).unwrap().as_mut().unwrap();
|
|
|
|
|
|
room.bursting = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
Box::new(client_location.get_client_neighbors(id).unwrap().into_iter()
|
|
|
|
|
|
.map(move |client| {
|
|
|
|
|
|
vec![
|
|
|
|
|
|
(client.client, SendShipPacket::BurstDone72(BurstDone72::new())),
|
|
|
|
|
|
/*(client.client, SendShipPacket::Message(Message::new(GameMessage::BurstDone(BurstDone {
|
|
|
|
|
|
client: 1,
|
|
|
|
|
|
target: 0
|
|
|
|
|
|
})))),*/
|
|
|
|
|
|
]
|
|
|
|
|
|
}).flatten())
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn request_room_list(id: ClientId,
|
|
|
pub fn request_room_list(id: ClientId,
|
|
|
client_location: &ClientLocation,
|
|
|
client_location: &ClientLocation,
|
|
|
rooms: &Rooms)
|
|
|
rooms: &Rooms)
|
|
|