move common_state into common_sys

This commit is contained in:
Marcel Märtens 2020-12-01 13:13:07 +01:00
parent add7922653
commit e398cca53c
29 changed files with 32 additions and 79 deletions

22
Cargo.lock generated
View File

@ -5341,7 +5341,7 @@ dependencies = [
"uvth 3.1.1",
"vek 0.12.0",
"veloren-common",
"veloren_common_state",
"veloren_common_sys",
"veloren_network",
]
@ -5416,7 +5416,6 @@ dependencies = [
"vek 0.12.0",
"veloren-common",
"veloren-world",
"veloren_common_state",
"veloren_common_sys",
"veloren_network",
]
@ -5499,7 +5498,6 @@ dependencies = [
"veloren-server",
"veloren-voxygen-anim",
"veloren-world",
"veloren_common_state",
"veloren_common_sys",
"window_clipboard",
"winit",
@ -5550,29 +5548,15 @@ dependencies = [
]
[[package]]
name = "veloren_common_state"
name = "veloren_common_sys"
version = "0.8.0"
dependencies = [
"hashbrown 0.7.2",
"indexmap",
"rand 0.7.3",
"rayon",
"slab",
"specs",
"tracing",
"tracy-client",
"vek 0.12.0",
"veloren-common",
"veloren_common_sys",
]
[[package]]
name = "veloren_common_sys"
version = "0.8.0"
dependencies = [
"rand 0.7.3",
"rayon",
"serde",
"slab",
"specs",
"tracing",
"tracy-client",

View File

@ -3,8 +3,7 @@ cargo-features = ["named-profiles","profile-overrides"]
[workspace]
members = [
"common",
"common/state",
"common/sys",
"common/sys",
"client",
"chat-cli",
"server",

View File

@ -11,7 +11,7 @@ default = ["simd"]
[dependencies]
common = { package = "veloren-common", path = "../common", features = ["no-assets"] }
common_state = { package = "veloren_common_state", path = "../common/state", default-features = false }
common_sys = { package = "veloren_common_sys", path = "../common/sys", default-features = false }
network = { package = "veloren_network", path = "../network", features = ["compression"], default-features = false }
byteorder = "1.3.2"

View File

@ -37,7 +37,7 @@ use common::{
terrain::{block::Block, neighbors, BiomeKind, SitesKind, TerrainChunk, TerrainChunkSize},
vol::RectVolSize,
};
use common_state::State;
use common_sys::state::State;
use comp::BuffKind;
use futures_executor::block_on;
use futures_timer::Delay;

View File

@ -1,34 +0,0 @@
[package]
authors = ["Marcel Märtens <marcel.cochem@googlemail.com>"]
edition = "2018"
name = "veloren_common_state"
version = "0.8.0"
[lib]
name = "common_state"
[features]
tracy = ["tracy-client"]
simd = ["vek/platform_intrinsics"]
default = ["simd"]
[dependencies]
common = {package = "veloren-common", path = "../../common"}
common_sys = {package = "veloren_common_sys", path = "../../common/sys"}
rand = "0.7"
rayon = "1.3.0"
tracing = { version = "0.1", default-features = false }
vek = { version = "0.12.0", features = ["serde"] }
# Data structures
hashbrown = { version = "0.7.2", features = ["rayon", "serde", "nightly"] }
indexmap = "1.3.0"
slab = "0.4.2"
# ECS
specs = { git = "https://github.com/amethyst/specs.git", features = ["serde", "storage-event-control"], rev = "7a2e348ab2223818bad487695c66c43db88050a5" }
# Tracy
tracy-client = { version = "0.9.0", optional = true }

View File

@ -21,6 +21,11 @@ rayon = "1.3.0"
tracing = { version = "0.1", default-features = false }
vek = { version = "0.12.0", features = ["serde"] }
# Data structures
hashbrown = { version = "0.7.2", features = ["rayon", "serde", "nightly"] }
indexmap = "1.3.0"
slab = "0.4.2"
# ECS
specs = { git = "https://github.com/amethyst/specs.git", features = ["serde", "storage-event-control"], rev = "7a2e348ab2223818bad487695c66c43db88050a5" }

View File

@ -10,6 +10,7 @@ mod mount;
pub mod phys;
mod projectile;
mod shockwave;
pub mod state;
mod stats;
// External

View File

@ -367,7 +367,7 @@ impl State {
// Create and run a dispatcher for ecs systems.
let mut dispatch_builder =
DispatcherBuilder::new().with_pool(Arc::clone(&self.thread_pool));
common_sys::add_local_systems(&mut dispatch_builder);
crate::add_local_systems(&mut dispatch_builder);
// TODO: Consider alternative ways to do this
add_foreign_systems(&mut dispatch_builder);
// This dispatches all the systems in parallel.

View File

@ -12,7 +12,6 @@ default = ["worldgen", "simd"]
[dependencies]
common = { package = "veloren-common", path = "../common" }
common_state = { package = "veloren_common_state", path = "../common/state" }
common_sys = { package = "veloren_common_sys", path = "../common/sys" }
world = { package = "veloren-world", path = "../world" }
network = { package = "veloren_network", path = "../network", features = ["metrics", "compression"], default-features = false }

View File

@ -22,7 +22,7 @@ use common::{
vol::ReadVol,
Damage, DamageSource, Explosion, GroupTarget, RadiusEffect,
};
use common_state::BlockChange;
use common_sys::state::BlockChange;
use comp::item::Reagent;
use rand::prelude::*;
use specs::{join::Join, saveload::MarkerAllocator, Entity as EcsEntity, WorldExt};

View File

@ -11,7 +11,7 @@ use common::{
util::find_dist::{self, FindDist},
vol::ReadVol,
};
use common_state::State;
use common_sys::state::State;
use comp::LightEmitter;
use rand::Rng;
use specs::{join::Join, world::WorldExt, Builder, Entity as EcsEntity, WriteStorage};

View File

@ -10,7 +10,7 @@ use common::{
span,
sync::{Uid, UidAllocator},
};
use common_state::State;
use common_sys::state::State;
use futures_executor::block_on;
use specs::{saveload::MarkerAllocator, Builder, Entity as EcsEntity, WorldExt};
use tracing::{debug, error, trace, warn};

View File

@ -62,7 +62,7 @@ use common::{
terrain::TerrainChunkSize,
vol::{ReadVol, RectVolSize},
};
use common_state::State;
use common_sys::state::State;
use futures_executor::block_on;
use metrics::{PhysicsMetrics, ServerMetrics, StateTickMetrics, TickMetrics};
use network::{Network, Pid, ProtocolAddr};

View File

@ -13,7 +13,7 @@ use common::{
terrain::TerrainChunk,
vol::RectRasterableVol,
};
use common_state::State;
use common_sys::state::State;
use rand::prelude::*;
use slab::Slab;
use specs::{DispatcherBuilder, WorldExt};

View File

@ -10,7 +10,7 @@ use common::{
sync::{Uid, UidAllocator, WorldSyncExt},
util::Dir,
};
use common_state::State;
use common_sys::state::State;
use rand::prelude::*;
use specs::{
saveload::MarkerAllocator, Builder, Entity as EcsEntity, EntityBuilder as EcsEntityBuilder,

View File

@ -8,7 +8,7 @@ use common::{
terrain::{TerrainChunkSize, TerrainGrid},
vol::{ReadVol, RectVolSize},
};
use common_state::BlockChange;
use common_sys::state::BlockChange;
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, Write, WriteStorage};
use tracing::{debug, trace};

View File

@ -12,7 +12,7 @@ use common::{
terrain::TerrainGrid,
LoadoutBuilder,
};
use common_state::TerrainChanges;
use common_sys::state::TerrainChanges;
use rand::Rng;
use specs::{Join, Read, ReadExpect, ReadStorage, System, Write, WriteExpect};
use std::sync::Arc;

View File

@ -1,7 +1,7 @@
use super::SysTimer;
use crate::{client::Client, presence::Presence};
use common::{comp::Pos, msg::ServerGeneral, span, terrain::TerrainGrid};
use common_state::TerrainChanges;
use common_sys::state::TerrainChanges;
use specs::{Join, Read, ReadExpect, ReadStorage, System, Write};
/// This systems sends new chunks to clients as well as changes to existing

View File

@ -22,7 +22,6 @@ default = ["gl", "singleplayer", "native-dialog", "simd"]
client = {package = "veloren-client", path = "../client"}
common = {package = "veloren-common", path = "../common"}
common_sys = {package = "veloren_common_sys", path = "../common/sys"}
common_state = {package = "veloren_common_state", path = "../common/state"}
anim = {package = "veloren-voxygen-anim", path = "src/anim", default-features = false}

View File

@ -5,7 +5,7 @@ use crate::{
};
use client::Client;
use common::{assets, vol::ReadVol};
use common_state::State;
use common_sys::state::State;
use serde::Deserialize;
use std::time::Instant;
use tracing::warn;

View File

@ -48,7 +48,7 @@ use common::{
assets,
terrain::{BiomeKind, SitesKind},
};
use common_state::State;
use common_sys::state::State;
use rand::{prelude::SliceRandom, thread_rng, Rng};
use serde::Deserialize;
use std::time::Instant;

View File

@ -14,7 +14,7 @@ use common::{
terrain::TerrainChunk,
vol::{ReadVol, RectRasterableVol},
};
use common_state::State;
use common_sys::state::State;
use hashbrown::HashMap;
use rand::{thread_rng, Rng};
use std::time::Instant;

View File

@ -13,7 +13,7 @@ use common::{
terrain::TerrainChunk,
vol::ReadVol,
};
use common_state::State;
use common_sys::state::State;
use hashbrown::HashMap;
use specs::{Entity as EcsEntity, Join, WorldExt};
use std::time::{Duration, Instant};

View File

@ -14,7 +14,7 @@ use common::{
terrain::TerrainChunk,
vol::ReadVol,
};
use common_state::State;
use common_sys::state::State;
use hashbrown::HashMap;
use specs::{Entity as EcsEntity, Join, WorldExt};
use std::time::{Duration, Instant};

View File

@ -5,7 +5,7 @@ mod movement;
use client::Client;
use common::terrain::TerrainChunk;
use common_state::State;
use common_sys::state::State;
use block::BlockEventMapper;
use campfire::CampfireEventMapper;

View File

@ -13,7 +13,7 @@ use common::{
terrain::{BlockKind, TerrainChunk},
vol::ReadVol,
};
use common_state::State;
use common_sys::state::State;
use hashbrown::HashMap;
use specs::{Entity as EcsEntity, Join, WorldExt};
use std::time::{Duration, Instant};

View File

@ -97,7 +97,7 @@ use common::{
outcome::Outcome,
terrain::TerrainChunk,
};
use common_state::State;
use common_sys::state::State;
use event_mapper::SfxEventMapper;
use hashbrown::HashMap;
use rand::prelude::*;

View File

@ -37,7 +37,7 @@ use common::{
terrain::TerrainChunk,
vol::RectRasterableVol,
};
use common_state::State;
use common_sys::state::State;
use core::{
borrow::Borrow,
convert::TryFrom,

View File

@ -32,7 +32,7 @@ use common::{
terrain::{BlockKind, TerrainChunk},
vol::ReadVol,
};
use common_state::State;
use common_sys::state::State;
use comp::item::Reagent;
use num::traits::{Float, FloatConst};
use specs::{Entity as EcsEntity, Join, WorldExt};