|
|
@ -10,7 +10,7 @@ use crate::ship::location::{ClientLocation, ClientLocationError}; |
|
|
|
use crate::ship::items::ClientItemId;
|
|
|
|
use crate::ship::packet::builder;
|
|
|
|
use crate::ship::items::state::ItemState;
|
|
|
|
use crate::ship::items::tasks::{drop_item, drop_partial_item, drop_meseta, equip_item, unequip_item, sort_inventory, use_item, feed_mag, sell_item, take_meseta};
|
|
|
|
use crate::ship::items::tasks::{drop_item, drop_partial_item, drop_meseta, equip_item, unequip_item, sort_inventory, use_item, feed_mag, sell_item, take_meseta, floor_item_limit_reached};
|
|
|
|
|
|
|
|
pub async fn request_exp<EG>(id: ClientId,
|
|
|
|
request_exp: RequestExp,
|
|
|
@ -500,3 +500,28 @@ where |
|
|
|
})}).await??;
|
|
|
|
Ok(Vec::new()) // TODO: send the packet to other clients
|
|
|
|
}
|
|
|
|
|
|
|
|
pub async fn floor_item_limit_deletion<EG> (id: ClientId,
|
|
|
|
floor_item_limit_delete: FloorItemLimitItemDeletion,
|
|
|
|
entity_gateway: &mut EG,
|
|
|
|
client_location: &ClientLocation,
|
|
|
|
clients: &Clients,
|
|
|
|
rooms: &Rooms,
|
|
|
|
item_state: &mut ItemState)
|
|
|
|
-> Result<Vec<(ClientId, SendShipPacket)>, anyhow::Error>
|
|
|
|
where
|
|
|
|
EG: EntityGateway + Clone + 'static,
|
|
|
|
{
|
|
|
|
let room_id = client_location.get_room(id).await.map_err(|err| -> ClientLocationError { err.into() })?;
|
|
|
|
let map_area = rooms.with(room_id, |room| Box::pin(async move {
|
|
|
|
room.map_areas.get_area_map(floor_item_limit_delete.map_area)
|
|
|
|
})).await??;
|
|
|
|
|
|
|
|
clients.with(id, |client| {
|
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
let mut item_state = item_state.clone();
|
|
|
|
Box::pin(async move {
|
|
|
|
floor_item_limit_reached(&mut item_state, &mut entity_gateway, &client.character, &ClientItemId(floor_item_limit_delete.item_id), map_area).await
|
|
|
|
})}).await??;
|
|
|
|
Ok(Vec::new())
|
|
|
|
}
|