mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
point to github specs to access PairedStorage type, fix Loadout sync spam
This commit is contained in:
parent
3c1fddfb0b
commit
c2d6d00b00
63
Cargo.lock
generated
63
Cargo.lock
generated
@ -995,17 +995,6 @@ dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c6d883546668a3e2011b6a716a7330b82eabb0151b138217f632c8243e17135"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.30",
|
||||
"quote 0.6.13",
|
||||
"syn 0.15.44",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deunicode"
|
||||
version = "1.1.1"
|
||||
@ -1856,6 +1845,16 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf"
|
||||
dependencies = [
|
||||
"ahash 0.3.8",
|
||||
"autocfg 1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.13"
|
||||
@ -3698,16 +3697,17 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
|
||||
|
||||
[[package]]
|
||||
name = "shred"
|
||||
version = "0.9.4"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc"
|
||||
checksum = "c5f08237e667ac94ad20f8878b5943d91a93ccb231428446c57c21c57779016d"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.12",
|
||||
"hashbrown",
|
||||
"arrayvec 0.5.1",
|
||||
"hashbrown 0.7.2",
|
||||
"mopa",
|
||||
"rayon",
|
||||
"shred-derive",
|
||||
"smallvec 0.6.13",
|
||||
"smallvec 1.4.0",
|
||||
"tynm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3793,13 +3793,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "specs"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4943fde8c5d3d14c3d19d2a4c7abbd7b626c270a19e6cd35252294a48feb698c"
|
||||
version = "0.16.1"
|
||||
source = "git+https://github.com/amethyst/specs.git?rev=7a2e348ab2223818bad487695c66c43db88050a5#7a2e348ab2223818bad487695c66c43db88050a5"
|
||||
dependencies = [
|
||||
"crossbeam-queue 0.1.2",
|
||||
"derivative",
|
||||
"hashbrown",
|
||||
"crossbeam-queue 0.2.3",
|
||||
"hashbrown 0.7.2",
|
||||
"hibitset",
|
||||
"log",
|
||||
"rayon",
|
||||
@ -3812,7 +3810,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "specs-idvs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://gitlab.com/veloren/specs-idvs.git#111548cf44e9bb4c43feb12aa3fc253953ac6e4a"
|
||||
source = "git+https://gitlab.com/veloren/specs-idvs.git?branch=specs-16#349153d18c19d238523e4eddd5bec179d38c59c5"
|
||||
dependencies = [
|
||||
"specs",
|
||||
]
|
||||
@ -4300,6 +4298,15 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1"
|
||||
|
||||
[[package]]
|
||||
name = "tynm"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "367fb781963961b4a90a3362c54b1871caaecb081f011005778242230f39d34e"
|
||||
dependencies = [
|
||||
"nom 5.1.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-bidi"
|
||||
version = "0.3.4"
|
||||
@ -4457,7 +4464,7 @@ dependencies = [
|
||||
"futures-executor",
|
||||
"futures-timer 3.0.2",
|
||||
"futures-util",
|
||||
"hashbrown",
|
||||
"hashbrown 0.6.3",
|
||||
"image",
|
||||
"num_cpus",
|
||||
"specs",
|
||||
@ -4478,7 +4485,7 @@ dependencies = [
|
||||
"crossbeam",
|
||||
"dot_vox",
|
||||
"find_folder",
|
||||
"hashbrown",
|
||||
"hashbrown 0.6.3",
|
||||
"image",
|
||||
"indexmap",
|
||||
"lazy_static",
|
||||
@ -4512,7 +4519,7 @@ dependencies = [
|
||||
"futures-executor",
|
||||
"futures-timer 3.0.2",
|
||||
"futures-util",
|
||||
"hashbrown",
|
||||
"hashbrown 0.6.3",
|
||||
"lazy_static",
|
||||
"libsqlite3-sys",
|
||||
"portpicker",
|
||||
@ -4573,7 +4580,7 @@ dependencies = [
|
||||
"glsl-include",
|
||||
"glutin",
|
||||
"guillotiere",
|
||||
"hashbrown",
|
||||
"hashbrown 0.6.3",
|
||||
"image",
|
||||
"msgbox",
|
||||
"num 0.2.1",
|
||||
@ -4621,7 +4628,7 @@ dependencies = [
|
||||
"bincode",
|
||||
"bitvec",
|
||||
"fxhash",
|
||||
"hashbrown",
|
||||
"hashbrown 0.6.3",
|
||||
"image",
|
||||
"itertools 0.8.2",
|
||||
"lazy_static",
|
||||
|
@ -72,3 +72,7 @@ debug = false
|
||||
[profile.releasedebuginfo]
|
||||
inherits = 'release'
|
||||
debug = 1
|
||||
|
||||
# living on the edge
|
||||
[patch.crates-io]
|
||||
specs = { git = "https://github.com/amethyst/specs.git", rev = "7a2e348ab2223818bad487695c66c43db88050a5" }
|
||||
|
@ -16,7 +16,7 @@ futures-timer = "3.0"
|
||||
image = { version = "0.22.3", default-features = false, features = ["png"] }
|
||||
num_cpus = "1.10.1"
|
||||
tracing = { version = "0.1", default-features = false }
|
||||
specs = "0.15.1"
|
||||
specs = "0.16.1"
|
||||
vek = { version = "0.11.0", features = ["serde"] }
|
||||
hashbrown = { version = "0.6", features = ["rayon", "serde", "nightly"] }
|
||||
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "223a4097f7ebc8d451936dccb5e6517194bbf086" }
|
||||
|
@ -8,9 +8,9 @@ edition = "2018"
|
||||
no-assets = []
|
||||
|
||||
[dependencies]
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git", branch = "specs-16" }
|
||||
|
||||
specs = { version = "0.15.1", features = ["serde", "nightly", "storage-event-control"] }
|
||||
specs = { version = "0.16.1", features = ["serde", "storage-event-control"] }
|
||||
vek = { version = "0.11.0", features = ["serde"] }
|
||||
dot_vox = "4.0"
|
||||
image = { version = "0.22.3", default-features = false, features = ["png"] }
|
||||
|
@ -7,7 +7,7 @@ use crate::{
|
||||
sys::character_behavior::JoinData,
|
||||
};
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::time::Duration;
|
||||
|
||||
#[derive(Copy, Clone, Hash, Eq, PartialEq, Debug, Serialize, Deserialize)]
|
||||
@ -243,5 +243,5 @@ impl From<&CharacterAbility> for CharacterState {
|
||||
}
|
||||
|
||||
impl Component for Loadout {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::path::Chaser;
|
||||
use specs::{Component, Entity as EcsEntity};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use vek::*;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
@ -43,7 +43,7 @@ impl Alignment {
|
||||
}
|
||||
|
||||
impl Component for Alignment {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
@ -72,7 +72,7 @@ impl Agent {
|
||||
}
|
||||
|
||||
impl Component for Agent {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
@ -17,7 +17,7 @@ use crate::{
|
||||
npc::NpcKind,
|
||||
};
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::{fs::File, io::BufReader};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
@ -132,5 +132,5 @@ impl Body {
|
||||
}
|
||||
|
||||
impl Component for Body {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
use crate::{
|
||||
comp::{Energy, Loadout, Ori, Pos, Vel},
|
||||
comp::{Energy, Ori, Pos, Vel},
|
||||
event::{LocalEvent, ServerEvent},
|
||||
states::*,
|
||||
sys::character_behavior::JoinData,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specs::{Component, FlaggedStorage, HashMapStorage, VecStorage};
|
||||
use specs::{Component, FlaggedStorage, VecStorage};
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
/// Data returned from character behavior fn's to Character Behavior System.
|
||||
@ -15,7 +16,7 @@ pub struct StateUpdate {
|
||||
pub vel: Vel,
|
||||
pub ori: Ori,
|
||||
pub energy: Energy,
|
||||
pub loadout: Loadout,
|
||||
pub swap_loadout: bool,
|
||||
pub local_events: VecDeque<LocalEvent>,
|
||||
pub server_events: VecDeque<ServerEvent>,
|
||||
}
|
||||
@ -27,7 +28,7 @@ impl From<&JoinData<'_>> for StateUpdate {
|
||||
vel: *data.vel,
|
||||
ori: *data.ori,
|
||||
energy: *data.energy,
|
||||
loadout: data.loadout.clone(),
|
||||
swap_loadout: false,
|
||||
character: data.character.clone(),
|
||||
local_events: VecDeque::new(),
|
||||
server_events: VecDeque::new(),
|
||||
@ -128,7 +129,7 @@ impl Default for CharacterState {
|
||||
}
|
||||
|
||||
impl Component for CharacterState {
|
||||
type Storage = FlaggedStorage<Self, HashMapStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{msg::ServerMsg, sync::Uid};
|
||||
use specs::Component;
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// A player's current chat mode. These are chat types that can only be sent by
|
||||
@ -22,7 +22,7 @@ pub enum ChatMode {
|
||||
}
|
||||
|
||||
impl Component for ChatMode {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
impl ChatMode {
|
||||
@ -180,7 +180,7 @@ impl ChatMsg {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Group(pub String);
|
||||
impl Component for Group {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
impl From<String> for Group {
|
||||
fn from(s: String) -> Self { Group(s) }
|
||||
@ -193,7 +193,7 @@ impl From<String> for Group {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Faction(pub String);
|
||||
impl Component for Faction {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
impl From<String> for Faction {
|
||||
fn from(s: String) -> Self { Faction(s) }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{comp::inventory::slot::Slot, sync::Uid, util::Dir};
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::time::Duration;
|
||||
use vek::*;
|
||||
|
||||
@ -227,7 +227,7 @@ impl Controller {
|
||||
}
|
||||
|
||||
impl Component for Controller {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@ -237,12 +237,12 @@ pub enum MountState {
|
||||
}
|
||||
|
||||
impl Component for MountState {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Mounting(pub Uid);
|
||||
|
||||
impl Component for Mounting {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Energy {
|
||||
current: u32,
|
||||
maximum: u32,
|
||||
@ -9,7 +9,7 @@ pub struct Energy {
|
||||
pub last_change: Option<(i32, f64, EnergySource)>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum EnergySource {
|
||||
Ability,
|
||||
Climb,
|
||||
@ -73,5 +73,5 @@ impl Energy {
|
||||
}
|
||||
|
||||
impl Component for Energy {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ use crate::{
|
||||
terrain::{Block, BlockKind},
|
||||
};
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::{fs::File, io::BufReader};
|
||||
use vek::Rgb;
|
||||
|
||||
@ -197,12 +197,12 @@ impl Item {
|
||||
}
|
||||
|
||||
impl Component for Item {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct ItemDrop(pub Item);
|
||||
|
||||
impl Component for ItemDrop {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ pub mod slot;
|
||||
use crate::assets;
|
||||
use item::{Consumable, Item, ItemKind};
|
||||
use specs::{Component, FlaggedStorage, HashMapStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::ops::Not;
|
||||
|
||||
// The limit on distance between the entity and a collectible (squared)
|
||||
@ -388,7 +388,7 @@ impl InventoryUpdate {
|
||||
}
|
||||
|
||||
impl Component for InventoryUpdate {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[cfg(test)] mod test;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::state::Time;
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use vek::*;
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
||||
@ -19,7 +19,7 @@ impl Waypoint {
|
||||
}
|
||||
|
||||
impl Component for Waypoint {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
@ -30,7 +30,7 @@ impl WaypointArea {
|
||||
}
|
||||
|
||||
impl Component for WaypointArea {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
impl Default for WaypointArea {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::sync::Uid;
|
||||
use specs::Component;
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum Object {
|
||||
@ -8,5 +8,5 @@ pub enum Object {
|
||||
}
|
||||
|
||||
impl Component for Object {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{sync::Uid, util::Dir};
|
||||
use specs::{Component, FlaggedStorage, NullStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use vek::*;
|
||||
|
||||
// Position
|
||||
@ -8,7 +8,7 @@ use vek::*;
|
||||
pub struct Pos(pub Vec3<f32>);
|
||||
|
||||
impl Component for Pos {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
// Velocity
|
||||
@ -16,7 +16,7 @@ impl Component for Pos {
|
||||
pub struct Vel(pub Vec3<f32>);
|
||||
|
||||
impl Component for Vel {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
// Orientation
|
||||
@ -24,7 +24,7 @@ impl Component for Vel {
|
||||
pub struct Ori(pub Dir);
|
||||
|
||||
impl Component for Ori {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
// Scale
|
||||
@ -32,7 +32,7 @@ impl Component for Ori {
|
||||
pub struct Scale(pub f32);
|
||||
|
||||
impl Component for Scale {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
// Mass
|
||||
@ -40,7 +40,7 @@ impl Component for Scale {
|
||||
pub struct Mass(pub f32);
|
||||
|
||||
impl Component for Mass {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
// Mass
|
||||
@ -51,14 +51,14 @@ pub enum Collider {
|
||||
}
|
||||
|
||||
impl Component for Collider {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Gravity(pub f32);
|
||||
|
||||
impl Component for Gravity {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@ -88,7 +88,7 @@ impl PhysicsState {
|
||||
}
|
||||
|
||||
impl Component for PhysicsState {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
// ForceUpdate
|
||||
|
@ -1,6 +1,6 @@
|
||||
use authc::Uuid;
|
||||
use specs::{Component, FlaggedStorage, NullStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
|
||||
const MAX_ALIAS_LEN: usize = 32;
|
||||
|
||||
@ -38,7 +38,7 @@ impl Player {
|
||||
}
|
||||
|
||||
impl Component for Player {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{comp, sync::Uid};
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::time::Duration;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@ -40,5 +40,5 @@ impl Projectile {
|
||||
}
|
||||
|
||||
impl Component for Projectile {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ use crate::{
|
||||
sync::Uid,
|
||||
};
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use std::{error::Error, fmt};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
||||
@ -204,7 +204,7 @@ impl Stats {
|
||||
}
|
||||
|
||||
impl Component for Stats {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
||||
@ -213,5 +213,5 @@ pub struct Dying {
|
||||
}
|
||||
|
||||
impl Component for Dying {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use vek::*;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@ -22,7 +22,7 @@ impl Default for LightEmitter {
|
||||
}
|
||||
|
||||
impl Component for LightEmitter {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@ -43,5 +43,5 @@ impl Default for LightAnimation {
|
||||
}
|
||||
|
||||
impl Component for LightAnimation {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -155,12 +155,9 @@ pub fn handle_climb(data: &JoinData, update: &mut StateUpdate) {
|
||||
}
|
||||
|
||||
/// Checks that player can Swap Weapons and updates `Loadout` if so
|
||||
pub fn attempt_swap_loadout(_data: &JoinData, update: &mut StateUpdate) {
|
||||
if update.loadout.second_item.is_some() {
|
||||
std::mem::swap(
|
||||
&mut update.loadout.active_item,
|
||||
&mut update.loadout.second_item,
|
||||
);
|
||||
pub fn attempt_swap_loadout(data: &JoinData, update: &mut StateUpdate) {
|
||||
if data.loadout.second_item.is_some() {
|
||||
update.swap_loadout = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,12 @@ use crate::{
|
||||
sync::{Uid, UidAllocator},
|
||||
};
|
||||
|
||||
use specs::{Entities, Entity, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage};
|
||||
use specs::{
|
||||
hibitset,
|
||||
storage::{PairedStorage, SequentialRestriction},
|
||||
Entities, Entity, FlaggedStorage, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage,
|
||||
};
|
||||
use specs_idvs::IdvStorage;
|
||||
|
||||
// use std::collections::VecDeque;
|
||||
|
||||
@ -37,7 +42,7 @@ pub trait CharacterBehavior {
|
||||
// fn init(data: &JoinData) -> CharacterState;
|
||||
}
|
||||
|
||||
/// Read-Only Data sent from Character Behavior System to bahvior fn's
|
||||
/// Read-Only Data sent from Character Behavior System to behavior fn's
|
||||
pub struct JoinData<'a> {
|
||||
pub entity: Entity,
|
||||
pub uid: &'a Uid,
|
||||
@ -57,15 +62,23 @@ pub struct JoinData<'a> {
|
||||
pub updater: &'a LazyUpdate,
|
||||
}
|
||||
|
||||
type RestrictedMut<'a, C> = PairedStorage<
|
||||
'a,
|
||||
'a,
|
||||
C,
|
||||
&'a mut FlaggedStorage<C, IdvStorage<C>>,
|
||||
&'a hibitset::BitSet,
|
||||
SequentialRestriction,
|
||||
>;
|
||||
pub type JoinTuple<'a> = (
|
||||
Entity,
|
||||
&'a Uid,
|
||||
&'a mut CharacterState,
|
||||
RestrictedMut<'a, CharacterState>,
|
||||
&'a mut Pos,
|
||||
&'a mut Vel,
|
||||
&'a mut Ori,
|
||||
&'a mut Energy,
|
||||
&'a mut Loadout,
|
||||
RestrictedMut<'a, Energy>,
|
||||
RestrictedMut<'a, Loadout>,
|
||||
&'a mut Controller,
|
||||
&'a Stats,
|
||||
&'a Body,
|
||||
@ -74,12 +87,21 @@ pub type JoinTuple<'a> = (
|
||||
);
|
||||
|
||||
fn incorporate_update(tuple: &mut JoinTuple, state_update: StateUpdate) {
|
||||
*tuple.2 = state_update.character;
|
||||
// TODO: if checking equality is expensive use optional field in StateUpdate
|
||||
if tuple.2.get_unchecked() != &state_update.character {
|
||||
*tuple.2.get_mut_unchecked() = state_update.character
|
||||
};
|
||||
*tuple.3 = state_update.pos;
|
||||
*tuple.4 = state_update.vel;
|
||||
*tuple.5 = state_update.ori;
|
||||
*tuple.6 = state_update.energy;
|
||||
*tuple.7 = state_update.loadout;
|
||||
// Note: might be changed every tick by timer anyway
|
||||
if tuple.6.get_unchecked() != &state_update.energy {
|
||||
*tuple.6.get_mut_unchecked() = state_update.energy
|
||||
};
|
||||
if state_update.swap_loadout {
|
||||
let loadout = tuple.7.get_mut_unchecked();
|
||||
std::mem::swap(&mut loadout.active_item, &mut loadout.second_item);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> JoinData<'a> {
|
||||
@ -87,12 +109,12 @@ impl<'a> JoinData<'a> {
|
||||
Self {
|
||||
entity: j.0,
|
||||
uid: j.1,
|
||||
character: j.2,
|
||||
character: j.2.get_unchecked(),
|
||||
pos: j.3,
|
||||
vel: j.4,
|
||||
ori: j.5,
|
||||
energy: j.6,
|
||||
loadout: j.7,
|
||||
energy: j.6.get_unchecked(),
|
||||
loadout: j.7.get_unchecked(),
|
||||
controller: j.8,
|
||||
inputs: &j.8.inputs,
|
||||
stats: j.9,
|
||||
@ -162,24 +184,23 @@ impl<'a> System<'a> for Sys {
|
||||
let mut server_emitter = server_bus.emitter();
|
||||
let mut local_emitter = local_bus.emitter();
|
||||
|
||||
let mut join_iter = (
|
||||
for mut tuple in (
|
||||
&entities,
|
||||
&uids,
|
||||
&mut character_states,
|
||||
&mut character_states.restrict_mut(),
|
||||
&mut positions,
|
||||
&mut velocities,
|
||||
&mut orientations,
|
||||
&mut energies,
|
||||
&mut loadouts,
|
||||
&mut energies.restrict_mut(),
|
||||
&mut loadouts.restrict_mut(),
|
||||
&mut controllers,
|
||||
&stats,
|
||||
&bodies,
|
||||
&physics_states,
|
||||
attacking_storage.maybe(),
|
||||
)
|
||||
.join();
|
||||
|
||||
while let Some(mut tuple) = join_iter.next() {
|
||||
.join()
|
||||
{
|
||||
// Being dead overrides all other states
|
||||
if tuple.9.is_dead {
|
||||
// Do nothing
|
||||
@ -188,7 +209,10 @@ impl<'a> System<'a> for Sys {
|
||||
// If mounted, character state is controlled by mount
|
||||
// TODO: Make mounting a state
|
||||
if let Some(Mounting(_)) = mountings.get(tuple.0) {
|
||||
*tuple.2 = CharacterState::Sit {};
|
||||
let sit_state = CharacterState::Sit {};
|
||||
if tuple.2.get_unchecked() != &sit_state {
|
||||
*tuple.2.get_mut_unchecked() = sit_state;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,10 @@ common = { package = "veloren-common", path = "../common" }
|
||||
world = { package = "veloren-world", path = "../world" }
|
||||
network = { package = "veloren_network", path = "../network", default-features = false }
|
||||
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git", branch = "specs-16" }
|
||||
|
||||
tracing = "0.1"
|
||||
specs = { version = "0.15.1", features = ["shred-derive"] }
|
||||
specs = { version = "0.16.1", features = ["shred-derive"] }
|
||||
vek = "0.11.0"
|
||||
uvth = "3.1.1"
|
||||
futures-util = "0.3"
|
||||
|
@ -2,7 +2,7 @@ use common::msg::{ClientState, RequestStateError, ServerMsg};
|
||||
use hashbrown::HashSet;
|
||||
use network::Stream;
|
||||
use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use vek::*;
|
||||
|
||||
pub struct Client {
|
||||
@ -13,7 +13,7 @@ pub struct Client {
|
||||
}
|
||||
|
||||
impl Component for Client {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
||||
impl Client {
|
||||
@ -59,5 +59,5 @@ pub struct RegionSubscription {
|
||||
}
|
||||
|
||||
impl Component for RegionSubscription {
|
||||
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||
type Storage = FlaggedStorage<Self, IdvStorage<Self>>;
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "pre-wi
|
||||
euc = { git = "https://github.com/zesterer/euc.git" }
|
||||
|
||||
# ECS
|
||||
specs = "0.15.1"
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
|
||||
specs = "0.16.1"
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git", branch = "specs-16" }
|
||||
|
||||
# Mathematics
|
||||
vek = { version = "0.11.0", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use common::util::Dir;
|
||||
use specs::Component;
|
||||
use specs_idvs::IDVStorage;
|
||||
use specs_idvs::IdvStorage;
|
||||
use vek::*;
|
||||
|
||||
// Floats over entity that has had a health change, rising up over time until it
|
||||
@ -25,7 +25,7 @@ pub struct HpFloaterList {
|
||||
pub time_since_last_dmg_by_me: Option<f32>,
|
||||
}
|
||||
impl Component for HpFloaterList {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
||||
// Used for smooth interpolation of visual elements that are tied to entity
|
||||
@ -36,5 +36,5 @@ pub struct Interpolated {
|
||||
pub ori: Dir,
|
||||
}
|
||||
impl Component for Interpolated {
|
||||
type Storage = IDVStorage<Self>;
|
||||
type Storage = IdvStorage<Self>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user