|
@ -571,8 +571,16 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> { |
|
|
RecvShipPacket::MenuSelect(menuselect) => {
|
|
|
RecvShipPacket::MenuSelect(menuselect) => {
|
|
|
let block = self.blocks.with_client(id, &self.clients)?;
|
|
|
let block = self.blocks.with_client(id, &self.clients)?;
|
|
|
match menuselect.menu {
|
|
|
match menuselect.menu {
|
|
|
SHIP_MENU_ID => handler::ship::selected_ship(id, menuselect, &self.ship_list)?,
|
|
|
|
|
|
BLOCK_MENU_ID => Box::new(handler::lobby::block_selected(id, menuselect, &mut self.clients, &self.item_manager, &self.level_table)?.into_iter().map(move |pkt| (id, pkt))),
|
|
|
|
|
|
|
|
|
SHIP_MENU_ID => {
|
|
|
|
|
|
let leave_lobby = handler::lobby::remove_from_lobby(id, &mut block.client_location).into_iter().into_iter().flatten();
|
|
|
|
|
|
let select_ship = handler::ship::selected_ship(id, menuselect, &self.ship_list)?;
|
|
|
|
|
|
Box::new(leave_lobby.chain(select_ship))
|
|
|
|
|
|
}
|
|
|
|
|
|
BLOCK_MENU_ID => {
|
|
|
|
|
|
let leave_lobby = handler::lobby::remove_from_lobby(id, &mut block.client_location).into_iter().into_iter().flatten();
|
|
|
|
|
|
let select_block = handler::lobby::block_selected(id, menuselect, &mut self.clients, &self.item_manager, &self.level_table)?.into_iter();
|
|
|
|
|
|
Box::new(leave_lobby.chain(select_block))
|
|
|
|
|
|
}
|
|
|
ROOM_MENU_ID => handler::room::join_room(id, menuselect, &mut block.client_location, &mut self.clients, &mut self.item_manager, &self.level_table, &mut block.rooms)?,
|
|
|
ROOM_MENU_ID => handler::room::join_room(id, menuselect, &mut block.client_location, &mut self.clients, &mut self.item_manager, &self.level_table, &mut block.rooms)?,
|
|
|
QUEST_CATEGORY_MENU_ID => handler::quest::select_quest_category(id, menuselect, &self.quests)?,
|
|
|
QUEST_CATEGORY_MENU_ID => handler::quest::select_quest_category(id, menuselect, &self.quests)?,
|
|
|
_ => unreachable!(),
|
|
|
_ => unreachable!(),
|
|
@ -680,7 +688,7 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> { |
|
|
handler::ship::ship_list(id, &self.ship_list)
|
|
|
handler::ship::ship_list(id, &self.ship_list)
|
|
|
},
|
|
|
},
|
|
|
RecvShipPacket::RequestShipBlockList(_) => {
|
|
|
RecvShipPacket::RequestShipBlockList(_) => {
|
|
|
handler::ship::block_list(id, &self.name, 1)
|
|
|
|
|
|
|
|
|
handler::ship::block_list(id, &self.name, self.blocks.0.len())
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|