Merge branch 'xvar/fix-plugin-build-warnings' into 'master'

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

See merge request veloren/veloren!2506
This commit is contained in:
Ben Wallis 2021-06-26 21:35:54 +00:00
commit 9865b354f9
4 changed files with 21 additions and 21 deletions

View File

@ -21,7 +21,7 @@ tracy = ["common-frontend/tracy"]
plugins = ["server/plugins"] plugins = ["server/plugins"]
[dependencies] [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 = { package = "veloren-common", path = "../common" }
common-base = { package = "veloren-common-base", path = "../common/base" } common-base = { package = "veloren-common-base", path = "../common/base" }
common-net = { package = "veloren-common-net", path = "../common/net" } common-net = { package = "veloren-common-net", path = "../common/net" }

View File

@ -68,7 +68,6 @@ use common::{
rtsim::RtSimEntity, rtsim::RtSimEntity,
slowjob::SlowJobPool, slowjob::SlowJobPool,
terrain::{TerrainChunk, TerrainChunkSize}, terrain::{TerrainChunk, TerrainChunkSize},
uid::UidAllocator,
vol::RectRasterableVol, vol::RectRasterableVol,
}; };
use common_ecs::run_now; use common_ecs::run_now;
@ -78,10 +77,6 @@ use common_net::{
}, },
sync::WorldSyncExt, 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_state::{BuildAreas, State};
use common_systems::add_local_systems; use common_systems::add_local_systems;
use metrics::{EcsSystemMetrics, PhysicsMetrics, TickMetrics}; use metrics::{EcsSystemMetrics, PhysicsMetrics, TickMetrics};
@ -110,6 +105,13 @@ use crate::{
sys::terrain, sys::terrain,
}; };
use std::sync::RwLock; use std::sync::RwLock;
#[cfg(feature = "plugins")]
use {
common::uid::UidAllocator,
common_state::plugin::{memory_manager::EcsWorld, PluginMgr},
};
#[cfg(feature = "worldgen")] #[cfg(feature = "worldgen")]
use world::{ use world::{
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP},

View File

@ -3,18 +3,19 @@ use authc::{AuthClient, AuthClientError, AuthToken, Uuid};
use chrono::Utc; use chrono::Utc;
use common::comp::AdminRole; use common::comp::AdminRole;
use common_net::msg::RegisterError; 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 hashbrown::HashMap;
use plugin_api::event::{PlayerJoinEvent, PlayerJoinResult};
use specs::Component; use specs::Component;
use specs_idvs::IdvStorage; use specs_idvs::IdvStorage;
use std::{str::FromStr, sync::Arc}; use std::{str::FromStr, sync::Arc};
use tokio::{runtime::Runtime, sync::oneshot}; use tokio::{runtime::Runtime, sync::oneshot};
use tracing::{error, info}; 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 { fn derive_uuid(username: &str) -> Uuid {
let mut state = 144066263297769815596495629667062367629; let mut state = 144066263297769815596495629667062367629;

View File

@ -22,10 +22,7 @@ use specs::{
use tracing::trace; use tracing::trace;
#[cfg(feature = "plugins")] #[cfg(feature = "plugins")]
use common_state::plugin::memory_manager::EcsWorld; use {common_state::plugin::memory_manager::EcsWorld, common_state::plugin::PluginMgr};
#[cfg(feature = "plugins")]
use common_state::plugin::PluginMgr;
#[cfg(feature = "plugins")] #[cfg(feature = "plugins")]
type ReadPlugin<'a> = Read<'a, PluginMgr>; type ReadPlugin<'a> = Read<'a, PluginMgr>;
@ -63,13 +60,13 @@ impl<'a> System<'a> for Sys {
( (
entities, entities,
player_metrics, player_metrics,
health_comp, _health_comp, // used by plugin feature
uids, uids,
clients, clients,
mut players, mut players,
mut pending_logins, mut pending_logins,
uid_allocator, _uid_allocator, // used by plugin feature
plugin_mgr, _plugin_mgr, // used by plugin feature
stats, stats,
mut login_provider, mut login_provider,
mut admins, mut admins,
@ -111,10 +108,10 @@ impl<'a> System<'a> for Sys {
#[cfg(feature = "plugins")] #[cfg(feature = "plugins")]
let ecs_world = EcsWorld { let ecs_world = EcsWorld {
entities: &entities, entities: &entities,
health: (&health_comp).into(), health: (&_health_comp).into(),
uid: (&uids).into(), uid: (&uids).into(),
player: (&players).into(), player: (&players).into(),
uid_allocator: &uid_allocator, uid_allocator: &_uid_allocator,
}; };
let (username, uuid) = match login_provider.login( let (username, uuid) = match login_provider.login(
@ -122,7 +119,7 @@ impl<'a> System<'a> for Sys {
#[cfg(feature = "plugins")] #[cfg(feature = "plugins")]
&ecs_world, &ecs_world,
#[cfg(feature = "plugins")] #[cfg(feature = "plugins")]
&plugin_mgr, &_plugin_mgr,
&*editable_settings.admins, &*editable_settings.admins,
&*editable_settings.whitelist, &*editable_settings.whitelist,
&*editable_settings.banlist, &*editable_settings.banlist,