|
|
@ -744,7 +744,6 @@ impl<EG: EntityGateway + Clone> ServerState for ShipServerState<EG> { |
|
|
|
}
|
|
|
|
|
|
|
|
async fn on_disconnect(&mut self, id: ClientId) -> Result<Vec<(ClientId, SendShipPacket)>, anyhow::Error> {
|
|
|
|
//let client = self.clients.get(&id).ok_or(ShipError::ClientNotFound(id))?;
|
|
|
|
let block = self.blocks.get_from_client(id, &self.clients).await?;
|
|
|
|
let area_client = block.client_location.get_local_client(id).await?;
|
|
|
|
let neighbors = block.client_location.get_client_neighbors(id).await?;
|
|
|
@ -763,17 +762,6 @@ impl<EG: EntityGateway + Clone> ServerState for ShipServerState<EG> { |
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
if let Some(shipgate_sender) = self.shipgate_sender.as_ref() {
|
|
|
|
shipgate_sender.send(ShipMessage::RemoveUser(client.user.id)).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
block.client_location.remove_client_from_area(id).await;
|
|
|
|
self.clients.with(id, |client| Box::pin(async move {
|
|
|
|
self.item_state.remove_character_from_room(&client.character).await
|
|
|
|
})).await?;
|
|
|
|
*/
|
|
|
|
|
|
|
|
if let Some(mut client) = self.clients.remove(&id).await {
|
|
|
|
client.user.at_ship = false;
|
|
|
|
self.entity_gateway.save_user(&client.user).await;
|
|
|
|