diff --git a/server-cli/Cargo.toml b/server-cli/Cargo.toml index 10636a8ad0..a48ff53cf2 100644 --- a/server-cli/Cargo.toml +++ b/server-cli/Cargo.toml @@ -21,7 +21,7 @@ tracy = ["common-frontend/tracy"] plugins = ["server/plugins"] [dependencies] -server = { package = "veloren-server", path = "../server", default-features = false } +server = { package = "veloren-server", path = "../server", default-features = false, features = ["simd"] } common = { package = "veloren-common", path = "../common" } common-base = { package = "veloren-common-base", path = "../common/base" } common-net = { package = "veloren-common-net", path = "../common/net" } diff --git a/server/src/lib.rs b/server/src/lib.rs index f1620b6680..8d80442c41 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -68,7 +68,6 @@ use common::{ rtsim::RtSimEntity, slowjob::SlowJobPool, terrain::{TerrainChunk, TerrainChunkSize}, - uid::UidAllocator, vol::RectRasterableVol, }; use common_ecs::run_now; @@ -78,10 +77,6 @@ use common_net::{ }, sync::WorldSyncExt, }; -#[cfg(feature = "plugins")] -use common_state::plugin::memory_manager::EcsWorld; -#[cfg(feature = "plugins")] -use common_state::plugin::PluginMgr; use common_state::{BuildAreas, State}; use common_systems::add_local_systems; use metrics::{EcsSystemMetrics, PhysicsMetrics, TickMetrics}; @@ -110,6 +105,13 @@ use crate::{ sys::terrain, }; use std::sync::RwLock; + +#[cfg(feature = "plugins")] +use { + common::uid::UidAllocator, + common_state::plugin::{memory_manager::EcsWorld, PluginMgr}, +}; + #[cfg(feature = "worldgen")] use world::{ sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, diff --git a/server/src/login_provider.rs b/server/src/login_provider.rs index 90eac64fa6..0bf99f1043 100644 --- a/server/src/login_provider.rs +++ b/server/src/login_provider.rs @@ -3,18 +3,19 @@ use authc::{AuthClient, AuthClientError, AuthToken, Uuid}; use chrono::Utc; use common::comp::AdminRole; use common_net::msg::RegisterError; -#[cfg(feature = "plugins")] -use common_state::plugin::memory_manager::EcsWorld; -#[cfg(feature = "plugins")] -use common_state::plugin::PluginMgr; use hashbrown::HashMap; -use plugin_api::event::{PlayerJoinEvent, PlayerJoinResult}; use specs::Component; use specs_idvs::IdvStorage; use std::{str::FromStr, sync::Arc}; use tokio::{runtime::Runtime, sync::oneshot}; use tracing::{error, info}; +#[cfg(feature = "plugins")] +use { + common_state::plugin::{memory_manager::EcsWorld, PluginMgr}, + plugin_api::event::{PlayerJoinEvent, PlayerJoinResult}, +}; + fn derive_uuid(username: &str) -> Uuid { let mut state = 144066263297769815596495629667062367629; diff --git a/server/src/sys/msg/register.rs b/server/src/sys/msg/register.rs index 99dda57b95..0d7ff30ade 100644 --- a/server/src/sys/msg/register.rs +++ b/server/src/sys/msg/register.rs @@ -22,10 +22,7 @@ use specs::{ use tracing::trace; #[cfg(feature = "plugins")] -use common_state::plugin::memory_manager::EcsWorld; - -#[cfg(feature = "plugins")] -use common_state::plugin::PluginMgr; +use {common_state::plugin::memory_manager::EcsWorld, common_state::plugin::PluginMgr}; #[cfg(feature = "plugins")] type ReadPlugin<'a> = Read<'a, PluginMgr>; @@ -63,13 +60,13 @@ impl<'a> System<'a> for Sys { ( entities, player_metrics, - health_comp, + _health_comp, // used by plugin feature uids, clients, mut players, mut pending_logins, - uid_allocator, - plugin_mgr, + _uid_allocator, // used by plugin feature + _plugin_mgr, // used by plugin feature stats, mut login_provider, mut admins, @@ -111,10 +108,10 @@ impl<'a> System<'a> for Sys { #[cfg(feature = "plugins")] let ecs_world = EcsWorld { entities: &entities, - health: (&health_comp).into(), + health: (&_health_comp).into(), uid: (&uids).into(), player: (&players).into(), - uid_allocator: &uid_allocator, + uid_allocator: &_uid_allocator, }; let (username, uuid) = match login_provider.login( @@ -122,7 +119,7 @@ impl<'a> System<'a> for Sys { #[cfg(feature = "plugins")] &ecs_world, #[cfg(feature = "plugins")] - &plugin_mgr, + &_plugin_mgr, &*editable_settings.admins, &*editable_settings.whitelist, &*editable_settings.banlist,