diff --git a/Cargo.toml b/Cargo.toml index 391e99a..e746d70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,4 +33,3 @@ sqlx = { version = "0.5.10", features = ["runtime-async-std-native-tls", "postgr strum = "0.19.5" strum_macros = "0.19" anyhow = { version = "1.0.47", features = ["backtrace"] } -fix-hidden-lifetime-bug = "0.2.4" diff --git a/src/lib.rs b/src/lib.rs index 068f6e9..176a9fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,8 +7,6 @@ #![feature(test)] extern crate test; -extern crate fix_hidden_lifetime_bug; - pub mod common; pub mod entity; diff --git a/src/ship/location.rs b/src/ship/location.rs index 037df94..f58a6f9 100644 --- a/src/ship/location.rs +++ b/src/ship/location.rs @@ -153,13 +153,9 @@ pub struct ClientLocation { impl Default for ClientLocation { fn default() -> ClientLocation { - //const RNONE: Option>> = None; - //const LINIT: Arc> = Arc::new(RwLock::new(Lobby([None; 12]))); ClientLocation { - //lobbies: [LINIT; 15], lobbies: core::array::from_fn(|_| Arc::new(RwLock::new(Lobby([None; 12])))), rooms: core::array::from_fn(|_| None), - //rooms: [RNONE; MAX_ROOMS], client_location: Arc::new(RwLock::new(HashMap::new())), } } diff --git a/src/ship/ship.rs b/src/ship/ship.rs index 4dcd8c7..50ddcad 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -744,7 +744,6 @@ impl ServerState for ShipServerState { } async fn on_disconnect(&mut self, id: ClientId) -> Result, 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 ServerState for ShipServerState { } }; - /* - 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;