diff --git a/src/ship/packet/handler/room.rs b/src/ship/packet/handler/room.rs index da26b35..6bef6b9 100644 --- a/src/ship/packet/handler/room.rs +++ b/src/ship/packet/handler/room.rs @@ -108,43 +108,22 @@ pub fn done_bursting(id: ClientId, -> Box + 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; + rooms.get_mut(room_id.0).unwrap().as_mut().map(|room| { + 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| { vec![ - //(client.client, SendShipPacket::BurstDone72(BurstDone72::new())), (client.client, SendShipPacket::Message(Message::new(GameMessage::BurstDone(BurstDone { - client: 0, + client: area_client.local_client.id(), target: 0 })))), ] }).flatten()) } -pub fn done_bursting2(id: ClientId, - client_location: &ClientLocation, - rooms: &mut Rooms) - -> Box + 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, client_location: &ClientLocation, rooms: &Rooms) diff --git a/src/ship/ship.rs b/src/ship/ship.rs index 0d3ad6f..4e91f6c 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -412,8 +412,7 @@ impl ServerState for ShipServerState { handler::room::done_bursting(id, &self.client_location, &mut self.rooms) }, RecvShipPacket::DoneBursting2(_) => { - Box::new(None.into_iter()) - //handler::room::done_bursting2(id, &self.client_location, &mut self.rooms) + handler::room::done_bursting(id, &self.client_location, &mut self.rooms) }, RecvShipPacket::LobbySelect(pkt) => { Box::new(handler::lobby::change_lobby(id, pkt.lobby, &mut self.client_location, &self.clients, &mut self.item_manager, &self.level_table, &mut self.rooms, &mut self.entity_gateway)?.into_iter())