Fixed build warnings for server-cli related to non-default plugin feature

This commit is contained in:
Ben Wallis 2021-06-26 21:06:20 +01:00
parent d479b6d202
commit a50ed6b50a
4 changed files with 21 additions and 21 deletions

View File

@ -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" }

View File

@ -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},

View File

@ -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;

View File

@ -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,