diff --git a/client/src/lib.rs b/client/src/lib.rs index a5ab702d33..c08cb3a0bc 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -943,7 +943,7 @@ impl Client { _ = ping_interval.tick() => ping_stream.send(PingMsg::Ping)?, } }; - let missing_plugins_set = missing_plugins.iter().collect(); + let missing_plugins_set = missing_plugins.iter().cloned().collect(); if !missing_plugins.is_empty() { stream.send(ClientGeneral::RequestPlugins(missing_plugins))?; } diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 09f23532fb..d2b8d52de1 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -279,22 +279,24 @@ impl PlayState for CharSelectionState { ))); }, client::Event::PluginDataReceived(data) => { - tracing::info!("plugin data {}", data.len()); - let mut client = self.client.borrow_mut(); #[cfg(feature = "plugins")] - match client - .state() - .ecs() - .write_resource::() - .cache_server_plugin(&global_state.config_dir, data) { - Ok(hash) => { - if client.plugin_received(hash) == 0 { - // now load characters (plugins might contain items) - client.load_character_list(); - } - }, - Err(e) => tracing::error!(?e, "cache_server_plugin"), + tracing::info!("plugin data {}", data.len()); + let mut client = self.client.borrow_mut(); + let hash = client + .state() + .ecs() + .write_resource::() + .cache_server_plugin(&global_state.config_dir, data); + match hash { + Ok(hash) => { + if client.plugin_received(hash) == 0 { + // now load characters (plugins might contain items) + client.load_character_list(); + } + }, + Err(e) => tracing::error!(?e, "cache_server_plugin"), + } } }, // TODO: See if we should handle StartSpectate here instead. diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 5b924692c7..42cb84f9d6 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -223,11 +223,14 @@ impl PlayState for MainMenuState { // load local plugins needed by the server #[cfg(feature = "plugins")] for path in client.take_local_plugins().drain(..) { - client + if let Err(e) = client .state_mut() .ecs_mut() .write_resource::() - .load_server_plugin(path); + .load_server_plugin(path) + { + tracing::error!(?e, "load local plugin"); + } } // Register voxygen components / resources crate::ecs::init(client.state_mut().ecs_mut()); @@ -281,22 +284,25 @@ impl PlayState for MainMenuState { self.init = InitState::None; }, client::Event::PluginDataReceived(data) => { - tracing::info!("plugin data {}", data.len()); - if let InitState::Pipeline(client) = &mut self.init { - #[cfg(feature = "plugins")] - match client - .state() - .ecs() - .write_resource::() - .cache_server_plugin(&global_state.config_dir, data) - { - Ok(hash) => { - if client.plugin_received(hash) == 0 { - // now load characters (plugins might contain items) - client.load_character_list(); - } - }, - Err(e) => tracing::error!(?e, "cache_server_plugin"), + #[cfg(feature = "plugins")] + { + tracing::info!("plugin data {}", data.len()); + if let InitState::Pipeline(client) = &mut self.init { + let hash = client + .state() + .ecs() + .write_resource::() + .cache_server_plugin(&global_state.config_dir, data); + match hash { + Ok(hash) => { + if client.plugin_received(hash) == 0 { + // now load characters (plugins might contain + // items) + client.load_character_list(); + } + }, + Err(e) => tracing::error!(?e, "cache_server_plugin"), + } } } },