mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added feature flag for client/server is common-state
This commit is contained in:
parent
026b61baee
commit
6a8ea80357
@ -16,7 +16,7 @@ default = ["simd"]
|
||||
[dependencies]
|
||||
common = { package = "veloren-common", path = "../common", features = ["no-assets"] }
|
||||
common-base = { package = "veloren-common-base", path = "../common/base" }
|
||||
common-state = { package = "veloren-common-state", path = "../common/state", default-features = false }
|
||||
common-state = { package = "veloren-common-state", path = "../common/state", default-features = false, features = ["client"] }
|
||||
common-systems = { package = "veloren-common-systems", path = "../common/systems", default-features = false }
|
||||
common-net = { package = "veloren-common-net", path = "../common/net" }
|
||||
network = { package = "veloren-network", path = "../network", features = ["compression","quic"], default-features = false }
|
||||
|
@ -7,6 +7,8 @@ version = "0.10.0"
|
||||
[features]
|
||||
simd = ["vek/platform_intrinsics"]
|
||||
plugins = ["toml", "tar", "wasmer", "wasmer-wasix-types", "bincode", "plugin-api", "serde"]
|
||||
server = []
|
||||
client = []
|
||||
|
||||
default = ["simd"]
|
||||
|
||||
|
@ -237,32 +237,36 @@ impl State {
|
||||
ecs.register::<comp::PosVelOriDefer>();
|
||||
|
||||
// Register client-local components
|
||||
// TODO: only register on the client
|
||||
ecs.register::<comp::LightAnimation>();
|
||||
ecs.register::<sync_interp::InterpBuffer<comp::Pos>>();
|
||||
ecs.register::<sync_interp::InterpBuffer<comp::Vel>>();
|
||||
ecs.register::<sync_interp::InterpBuffer<comp::Ori>>();
|
||||
#[cfg(feature = "client")]
|
||||
{
|
||||
ecs.register::<comp::LightAnimation>();
|
||||
ecs.register::<sync_interp::InterpBuffer<comp::Pos>>();
|
||||
ecs.register::<sync_interp::InterpBuffer<comp::Vel>>();
|
||||
ecs.register::<sync_interp::InterpBuffer<comp::Ori>>();
|
||||
}
|
||||
|
||||
// Register server-local components
|
||||
// TODO: only register on the server
|
||||
ecs.register::<comp::Last<comp::Pos>>();
|
||||
ecs.register::<comp::Last<comp::Vel>>();
|
||||
ecs.register::<comp::Last<comp::Ori>>();
|
||||
ecs.register::<comp::Agent>();
|
||||
ecs.register::<comp::WaypointArea>();
|
||||
ecs.register::<comp::ForceUpdate>();
|
||||
ecs.register::<comp::InventoryUpdate>();
|
||||
ecs.register::<comp::Waypoint>();
|
||||
ecs.register::<comp::MapMarker>();
|
||||
ecs.register::<comp::Projectile>();
|
||||
ecs.register::<comp::Melee>();
|
||||
ecs.register::<comp::ItemDrops>();
|
||||
ecs.register::<comp::ChatMode>();
|
||||
ecs.register::<comp::Faction>();
|
||||
ecs.register::<comp::invite::Invite>();
|
||||
ecs.register::<comp::invite::PendingInvites>();
|
||||
ecs.register::<comp::Beam>();
|
||||
ecs.register::<VolumeRiders>();
|
||||
#[cfg(feature = "server")]
|
||||
{
|
||||
ecs.register::<comp::Last<comp::Pos>>();
|
||||
ecs.register::<comp::Last<comp::Vel>>();
|
||||
ecs.register::<comp::Last<comp::Ori>>();
|
||||
ecs.register::<comp::Agent>();
|
||||
ecs.register::<comp::WaypointArea>();
|
||||
ecs.register::<comp::ForceUpdate>();
|
||||
ecs.register::<comp::InventoryUpdate>();
|
||||
ecs.register::<comp::Waypoint>();
|
||||
ecs.register::<comp::MapMarker>();
|
||||
ecs.register::<comp::Projectile>();
|
||||
ecs.register::<comp::Melee>();
|
||||
ecs.register::<comp::ItemDrops>();
|
||||
ecs.register::<comp::ChatMode>();
|
||||
ecs.register::<comp::Faction>();
|
||||
ecs.register::<comp::invite::Invite>();
|
||||
ecs.register::<comp::invite::PendingInvites>();
|
||||
ecs.register::<comp::Beam>();
|
||||
ecs.register::<VolumeRiders>();
|
||||
}
|
||||
|
||||
// Register synced resources used by the ECS.
|
||||
ecs.insert(TimeOfDay(0.0));
|
||||
@ -291,15 +295,17 @@ impl State {
|
||||
tracing::trace!(?slow_limit, "Slow Thread limit");
|
||||
ecs.insert(SlowJobPool::new(slow_limit, 10_000, thread_pool));
|
||||
|
||||
// TODO: only register on the server
|
||||
ecs.insert(EventBus::<ServerEvent>::default());
|
||||
ecs.insert(comp::group::GroupManager::default());
|
||||
ecs.insert(RegionMap::new());
|
||||
ecs.insert(SysMetrics::default());
|
||||
ecs.insert(PhysicsMetrics::default());
|
||||
ecs.insert(Trades::default());
|
||||
ecs.insert(PlayerPhysicsSettings::default());
|
||||
ecs.insert(VolumeRiders::default());
|
||||
#[cfg(feature = "server")]
|
||||
{
|
||||
ecs.insert(EventBus::<ServerEvent>::default());
|
||||
ecs.insert(comp::group::GroupManager::default());
|
||||
ecs.insert(RegionMap::new());
|
||||
ecs.insert(SysMetrics::default());
|
||||
ecs.insert(PhysicsMetrics::default());
|
||||
ecs.insert(Trades::default());
|
||||
ecs.insert(PlayerPhysicsSettings::default());
|
||||
ecs.insert(VolumeRiders::default());
|
||||
}
|
||||
|
||||
// Load plugins from asset directory
|
||||
#[cfg(feature = "plugins")]
|
||||
|
@ -35,4 +35,4 @@ specs = { workspace = true, features = ["serde", "storage-event-control", "deriv
|
||||
|
||||
[dev-dependencies]
|
||||
# Setup a State
|
||||
common-state = { package = "veloren-common-state", path = "../state" }
|
||||
common-state = { package = "veloren-common-state", path = "../state", features = ["server"] }
|
||||
|
@ -19,7 +19,7 @@ default = ["worldgen", "plugins", "persistent_world", "simd"]
|
||||
common = { package = "veloren-common", path = "../common" }
|
||||
common-base = { package = "veloren-common-base", path = "../common/base" }
|
||||
common-ecs = { package = "veloren-common-ecs", path = "../common/ecs" }
|
||||
common-state = { package = "veloren-common-state", path = "../common/state" }
|
||||
common-state = { package = "veloren-common-state", path = "../common/state", features = ["server"] }
|
||||
common-systems = { package = "veloren-common-systems", path = "../common/systems" }
|
||||
common-net = { package = "veloren-common-net", path = "../common/net" }
|
||||
world = { package = "veloren-world", path = "../world" }
|
||||
|
@ -47,7 +47,7 @@ common-base = {package = "veloren-common-base", path = "../common/base"}
|
||||
common-ecs = {package = "veloren-common-ecs", path = "../common/ecs"}
|
||||
common-frontend = {package = "veloren-common-frontend", path = "../common/frontend"}
|
||||
common-net = {package = "veloren-common-net", path = "../common/net"}
|
||||
common-state = {package = "veloren-common-state", path = "../common/state"}
|
||||
common-state = {package = "veloren-common-state", path = "../common/state", features = ["client"]}
|
||||
common-systems = {package = "veloren-common-systems", path = "../common/systems"}
|
||||
|
||||
anim = {package = "veloren-voxygen-anim", path = "anim"}
|
||||
|
Loading…
Reference in New Issue
Block a user