From e074c7ce1d782011975997ce8667776c82fea05a Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Fri, 20 Dec 2019 05:30:37 -0800 Subject: [PATCH 001/387] begin impl state handle traits --- common/src/comp/character_state.rs | 136 +++++- common/src/comp/controller.rs | 15 - common/src/sys/character_state.rs | 401 ++++++++++++++++++ common/src/sys/controller.rs | 657 +---------------------------- common/src/sys/mod.rs | 5 +- common/src/sys/movement.rs | 4 + 6 files changed, 556 insertions(+), 662 deletions(-) create mode 100644 common/src/sys/character_state.rs diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 1ac19ae950..86588381ce 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,12 +1,142 @@ +use crate::comp::{Body, CharacterState, Controller, ControllerInputs, PhysicsState}; use specs::{Component, FlaggedStorage, HashMapStorage}; +use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System}; +use sphynx::{Uid, UidAllocator}; //use specs_idvs::IDVStorage; +use self::{ActionState::*, MovementState::*}; use std::time::Duration; +pub trait State { + fn handle( + &self, + character: &CharacterState, + inputs: &ControllerInputs, + body: &Body, + physics: &PhysicsState, + ) -> CharacterState; +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct RunData; +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct StandData; + +impl State for StandData { + fn handle( + &self, + character: &CharacterState, + inputs: &ControllerInputs, + body: &Body, + physics: &PhysicsState, + ) -> CharacterState { + let mut new_move: MovementState = if inputs.move_dir.magnitude_squared() > 0.0 { + MovementState::Run(RunData) + } else { + MovementState::Stand(StandData) + }; + + // Try to sit + if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { + return CharacterState { + movement: Sit, + action: Idle, + }; + } + + // Try to climb + if let (true, Some(_wall_dir)) = ( + inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), + physics.on_wall, + ) { + return CharacterState { + movement: Climb, + action: Idle, + }; + } + + // Try to swim + if !physics.on_ground && physics.in_fluid { + return CharacterState { + action: character.action, + movement: Swim, + }; + } + + // While on ground ... + if physics.on_ground { + // Try to jump + if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { + return CharacterState { + action: character.action, + movement: Jump, + }; + } + + // Try to charge + if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { + return CharacterState { + action: Charge { + time_left: Duration::from_millis(250), + }, + movement: Run(RunData), + }; + } + + // Try to roll + if inputs.roll.is_pressed() && body.is_humanoid() { + return CharacterState { + action: Roll { + time_left: Duration::from_millis(600), + was_wielding: character.action.is_wield(), + }, + movement: Run(RunData), + }; + } + } + // While not on ground ... + else { + // Try to glide + if physics.on_wall == None + && inputs.glide.is_pressed() + && !inputs.glide.is_held_down() + && body.is_humanoid() + { + character.movement = Glide; + continue; + } + character.movement = Fall; + } + + // Tool Actions + if inputs.toggle_wield.is_just_pressed() { + match action_state { + Wield { .. } | Attack { .. } => { + // Prevent instantaneous reequipping by checking + // for done wielding + if character.action.is_action_finished() { + character.action = Idle; + } + continue; + } + Idle => { + character.action = try_wield(stats); + continue; + } + Charge { .. } | Roll { .. } | Block { .. } => {} + } + } + if inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + } +} #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum MovementState { - Stand, + Stand(Stand), Sit, - Run, + Run(Run), Jump, Fall, Glide, @@ -35,7 +165,7 @@ pub enum ActionState { Charge { time_left: Duration, }, - //Carry, + // Handle(CharacterAction), } impl ActionState { diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index 34ac6859bc..1bfc01dcad 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -154,21 +154,6 @@ impl ControllerInputs { self.toggle_wield.tick(dt); self.charge.tick(dt); } - /// Updates `inputs.move_dir`. - pub fn update_move_dir(&mut self) { - self.move_dir = if self.move_dir.magnitude_squared() > 1.0 { - // Cap move_dir to 1 - self.move_dir.normalized() - } else { - self.move_dir - }; - } - /// Updates `inputs.look_dir` - pub fn update_look_dir(&mut self) { - self.look_dir - .try_normalized() - .unwrap_or(self.move_dir.into()); - } } impl Controller { diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs new file mode 100644 index 0000000000..d5373c4390 --- /dev/null +++ b/common/src/sys/character_state.rs @@ -0,0 +1,401 @@ +use super::movement::ROLL_DURATION; +use crate::{ + comp::{ + self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ControlEvent, + Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, + MovementState, MovementState::*, PhysicsState, Projectile, Stats, Vel, + }, + event::{Emitter, EventBus, LocalEvent, ServerEvent}, + state::DeltaTime, +}; +use specs::{ + saveload::{Marker, MarkerAllocator}, + Entities, Entity, Join, Read, ReadStorage, System, WriteStorage, +}; +use sphynx::{Uid, UidAllocator}; +use std::time::Duration; +use vek::*; + +/// # Character State System +/// #### Updates then detemrines next Character States based on ControllerInputs +pub struct Sys; + +impl<'a> System<'a> for Sys { + type SystemData = ( + Entities<'a>, + Read<'a, UidAllocator>, + Read<'a, EventBus>, + Read<'a, EventBus>, + Read<'a, DeltaTime>, + WriteStorage<'a, CharacterState>, + ReadStorage<'a, Controller>, + ReadStorage<'a, Stats>, + ReadStorage<'a, Body>, + ReadStorage<'a, Vel>, + ReadStorage<'a, PhysicsState>, + ReadStorage<'a, Uid>, + ReadStorage<'a, Mounting>, + ); + fn run( + &mut self, + ( + entities, + uid_allocator, + server_bus, + local_bus, + dt, + mut character_states, + controllers, + stats, + bodies, + velocities, + physics_states, + uids, + mountings, + ): Self::SystemData, + ) { + let mut server_emitter = server_bus.emitter(); + let mut local_emitter = local_bus.emitter(); + for (entity, uid, mut character, controller, stats, body, vel, physics, mount) in ( + &entities, + &uids, + &mut character_states, + &controllers, + &stats, + &bodies, + &velocities, + &physics_states, + mountings.maybe(), + ) + .join() + { + let inputs = &controller.inputs; + + // Returns a Wield action, or Idle if nothing to wield + let try_wield = |stats: &Stats| -> ActionState { + // Get weapon to wield + if let Some(ItemKind::Tool { kind, .. }) = + stats.equipment.main.as_ref().map(|i| &i.kind) + { + let wield_duration = kind.wield_duration(); + Wield { + time_left: wield_duration, + } + } else { + Idle + } + }; + + let get_state_from_move_dir = |move_dir: &Vec2| -> MovementState { + if move_dir.magnitude_squared() > 0.0 { + Run(_) + } else { + Stand(_) + } + }; + + // Being dead overrides all other states + if stats.is_dead { + // Only options: click respawn + // prevent instant-respawns (i.e. player was holding attack) + // by disallowing while input is held down + if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { + server_emitter.emit(ServerEvent::Respawn(entity)); + } + // Or do nothing + continue; + } + // If mounted, character state is controlled by mount + if mount.is_some() { + character.movement = Sit; + continue; + } + + // Update Action States + match character.action { + Attack { + ref mut time_left, .. + } => { + *time_left = time_left + .checked_sub(Duration::from_secs_f32(dt.0)) + .unwrap_or_default(); + } + Roll { + ref mut time_left, .. + } => { + *time_left = time_left + .checked_sub(Duration::from_secs_f32(dt.0)) + .unwrap_or_default(); + } + Charge { ref mut time_left } => { + *time_left = time_left + .checked_sub(Duration::from_secs_f32(dt.0)) + .unwrap_or_default(); + } + Wield { ref mut time_left } => { + *time_left = time_left + .checked_sub(Duration::from_secs_f32(dt.0)) + .unwrap_or_default(); + } + Block { + ref mut time_active, + } => { + *time_active = time_active + .checked_add(Duration::from_secs_f32(dt.0)) + .unwrap_or_default(); + } + Idle => {} + } + + // Determine new states + match (character.action, character.movement) { + // Jumping, one frame state that calls jump server event + (_, Jump) => { + character.movement = Fall; + local_emitter.emit(LocalEvent::Jump(entity)); + } + // Charging + Any Movement, prioritizes finishing charge + // over movement states + (Charge { time_left }, _) => { + if let Some(uid_b) = physics.touch_entity { + server_emitter.emit(ServerEvent::Damage { + uid: uid_b, + change: HealthChange { + amount: -20, + cause: HealthSource::Attack { by: *uid }, + }, + }); + + character.action = try_wield(stats); + } else if time_left == Duration::default() || vel.0.magnitude_squared() < 10.0 { + character.action = try_wield(stats); + } + } + // Rolling + Any Movement, prioritizes finishing charge + // over movement states + ( + Roll { + time_left, + was_wielding, + }, + _, + ) => { + if time_left == Duration::default() { + if was_wielding { + character.action = try_wield(stats); + } else { + character.action = Idle; + } + } + } + // Any Action + Falling + (action_state, Fall) => { + // character.movement = get_state_from_move_dir(&inputs.move_dir); + if inputs.glide.is_pressed() && !inputs.glide.is_held_down() { + character.movement = Glide; + continue; + } + // Reset to Falling while not standing on ground, + // otherwise keep the state given above + if !physics.on_ground { + if physics.in_fluid { + character.movement = Swim; + } else { + character.movement = Fall; + } + } else { + character.movement = Stand(comp::character_state::Stand); + continue; + } + + match action_state { + // Unwield if buttons pressed + Wield { .. } | Attack { .. } => { + if inputs.toggle_wield.is_just_pressed() { + character.action = Idle; + } + } + // Try to wield if any of buttons pressed + Idle => { + if inputs.primary.is_pressed() || inputs.secondary.is_pressed() { + character.action = try_wield(stats); + } + } + // Cancel blocks + Block { .. } => { + character.action = try_wield(stats); + } + // Don't change action + Charge { .. } | Roll { .. } => {} + } + } + // Any Action + Swimming + (_, Swim) => { + character.movement = get_state_from_move_dir(&inputs.move_dir); + + if !physics.on_ground && physics.in_fluid { + character.movement = Swim; + } + if inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + } + // // Blocking, restricted look_dir compared to other states + // (Block { .. }, Stand) | (Block { .. }, Run) => { + // character.movement = get_state_from_move_dir(&inputs.move_dir); + + // if !inputs.secondary.is_pressed() { + // character.action = try_wield(stats); + // } else { + // // TODO: SecondaryStart + // } + + // if !physics.on_ground && physics.in_fluid { + // character.movement = Swim; + // } + // } + // // Standing and Running states, typical states :shrug: + // (action_state, Run) | (action_state, Stand) => { + // character.movement = get_state_from_move_dir(&inputs.move_dir); + // // Try to sit + // if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { + // character.movement = Sit; + // continue; + // } + + // // Try to climb + // if let (true, Some(_wall_dir)) = ( + // inputs.climb.is_pressed() | inputs.climb_down.is_pressed() + // && body.is_humanoid(), + // physics.on_wall, + // ) { + // character.movement = Climb; + // continue; + // } + + // // Try to swim + // if !physics.on_ground && physics.in_fluid { + // character.movement = Swim; + // continue; + // } + + // // While on ground ... + // if physics.on_ground { + // // Try to jump + // if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { + // character.movement = Jump; + // continue; + // } + + // // Try to charge + // if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { + // character.action = Charge { + // time_left: Duration::from_millis(250), + // }; + // continue; + // } + + // // Try to roll + // if character.movement == Run + // && inputs.roll.is_pressed() + // && body.is_humanoid() + // { + // character.action = Roll { + // time_left: ROLL_DURATION, + // was_wielding: character.action.is_wield(), + // }; + // continue; + // } + // } + // // While not on ground ... + // else { + // // Try to glide + // if physics.on_wall == None + // && inputs.glide.is_pressed() + // && !inputs.glide.is_held_down() + // && body.is_humanoid() + // { + // character.movement = Glide; + // continue; + // } + // character.movement = Fall; + // } + + // // Tool Actions + // if inputs.toggle_wield.is_just_pressed() { + // match action_state { + // Wield { .. } | Attack { .. } => { + // // Prevent instantaneous reequipping by checking + // // for done wielding + // if character.action.is_action_finished() { + // character.action = Idle; + // } + // continue; + // } + // Idle => { + // character.action = try_wield(stats); + // continue; + // } + // Charge { .. } | Roll { .. } | Block { .. } => {} + // } + // } + // if inputs.primary.is_pressed() { + // // TODO: PrimaryStart + // } else if inputs.secondary.is_pressed() { + // // TODO: SecondaryStart + // } + // } + // Sitting + (_, Sit) => { + character.action = Idle; + character.movement = get_state_from_move_dir(&inputs.move_dir); + + // character.movement will be Stand after updating when + // no movement has occurred + if character.movement == Stand(_) { + character.movement = Sit; + } + if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { + character.movement = Jump; + continue; + } + if !physics.on_ground { + character.movement = Fall; + } + } + // Any Action + Gliding, shouldnt care about action, + // because should be Idle + (_, Glide) => { + character.action = Idle; + + if !inputs.glide.is_pressed() { + character.movement = Fall; + } else if let Some(_wall_dir) = physics.on_wall { + character.movement = Fall; + } + + if physics.on_ground { + character.movement = Stand(Stand) + } + } + // Any Action + Climbing, shouldnt care about action, + // because should be Idle + (_, Climb) => { + character.action = Idle; + if let None = physics.on_wall { + if inputs.jump.is_pressed() { + character.movement = Jump; + } else { + character.movement = Fall; + } + } + if physics.on_ground { + character.movement = Stand(Stand); + } + } + }; + } + } +} diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index 3894d1b325..7548d322df 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -17,226 +17,9 @@ use std::time::Duration; use vek::*; /// # Controller System -/// #### Responsible for validating controller inputs and setting new Character States -/// ---- -/// -/// **Writes:** -/// `CharacterState`, `ControllerInputs` -/// -/// **Reads:** -/// `Stats`, `Vel`, `PhysicsState`, `Uid`, `Mounting` -/// -/// _TODO: Join ActionStates and MovementStates into one and have a handle() trait / fn?_ -/// _TODO: Move weapon action to trait fn?_ +/// #### Responsible for validating and updating controller inputs pub struct Sys; -impl Sys { - /// Assumes `input.primary` has been pressed - /// handles primary actions. ie. equipping, mainhand weapon attacks. - /// - /// Returns the `ActionState` that occurred - fn handle_primary( - inputs: &mut ControllerInputs, - character: &mut CharacterState, - stats: &Stats, - entity: Entity, - uid: &Uid, - server_emitter: &mut Emitter<'_, ServerEvent>, - local_emitter: &mut Emitter<'_, LocalEvent>, - ) -> ActionState { - match stats.equipment.main.as_ref().map(|i| &i.kind) { - // Character is wielding something - Some(ItemKind::Tool { kind, power, .. }) => { - let attack_duration = kind.attack_duration(); - let wield_duration = kind.wield_duration(); - - // Since primary input was pressed, set - // action to new Wield, in case of - // instant primary actions - if character.action == Idle { - character.action = Wield { - time_left: wield_duration, - }; - } - - match kind { - item::Tool::Bow if character.action.is_action_finished() => { - // Immediately end the wield - server_emitter.emit(ServerEvent::Shoot { - entity, - dir: inputs.look_dir, - body: comp::Body::Object(comp::object::Body::Arrow), - light: None, - gravity: Some(comp::Gravity(0.3)), - projectile: Projectile { - owner: *uid, - hit_ground: vec![projectile::Effect::Stick], - hit_wall: vec![projectile::Effect::Stick], - hit_entity: vec![ - projectile::Effect::Damage(HealthChange { - amount: -(*power as i32), - cause: HealthSource::Attack { by: *uid }, - }), - projectile::Effect::Vanish, - ], - time_left: Duration::from_secs(15), - }, - }); - Attack { - time_left: attack_duration, - applied: false, // We don't want to do a melee attack - } - //character.action - } - item::Tool::Debug(item::Debug::Boost) => { - local_emitter.emit(LocalEvent::Boost { - entity, - vel: inputs.look_dir * 7.0, - }); - character.action - } - - item::Tool::Debug(item::Debug::Possess) - if character.action.is_action_finished() => - { - server_emitter.emit(ServerEvent::Shoot { - entity, - gravity: Some(comp::Gravity(0.1)), - dir: inputs.look_dir, - body: comp::Body::Object(comp::object::Body::ArrowSnake), - light: Some(comp::LightEmitter { - col: (0.0, 1.0, 0.3).into(), - ..Default::default() - }), - projectile: Projectile { - owner: *uid, - hit_ground: vec![projectile::Effect::Stick], - hit_wall: vec![projectile::Effect::Stick], - hit_entity: vec![ - projectile::Effect::Stick, - projectile::Effect::Possess, - ], - time_left: Duration::from_secs(10), - }, - }); - - character.action - } - // All other weapons - _ if character.action.is_action_finished() => Attack { - time_left: attack_duration, - applied: false, - }, - _ => { - // Return the new Wield action - character.action - } - } - } - // Without a weapon - None => { - // Attack - if !character.action.is_attack() { - Attack { - time_left: Duration::from_millis(100), - applied: false, - } - } else { - character.action - } - } - _ => character.action, - } - } - - /// Assumes `input.seconday` has been pressed - /// handles seconday actions. ie. blocking, althand weapons - /// - /// Returns the `ActionState` that occurred - fn handle_secondary( - inputs: &mut ControllerInputs, - character: &mut CharacterState, - stats: &Stats, - entity: Entity, - uid: &Uid, - server_emitter: &mut Emitter<'_, ServerEvent>, - local_emitter: &mut Emitter<'_, LocalEvent>, - ) -> ActionState { - match stats.equipment.main.as_ref().map(|i| &i.kind) { - // Character is wielding something - Some(ItemKind::Tool { kind, power, .. }) => { - let attack_duration = kind.attack_duration(); - let wield_duration = kind.wield_duration(); - - // Since primary input was pressed, set - // action to new Wield, in case of - // instant primary actions - if character.action == Idle { - character.action = Wield { - time_left: wield_duration, - }; - } - - match kind { - // Magical Bolt - item::Tool::Staff - if character.movement == Stand && character.action.is_action_finished() => - { - server_emitter.emit(ServerEvent::Shoot { - entity, - dir: inputs.look_dir, - body: comp::Body::Object(comp::object::Body::BoltFire), - gravity: Some(comp::Gravity(0.0)), - light: Some(comp::LightEmitter { - col: (0.72, 0.11, 0.11).into(), - strength: 10.0, - offset: Vec3::new(0.0, -5.0, 2.0), - }), - projectile: Projectile { - owner: *uid, - hit_ground: vec![projectile::Effect::Vanish], - hit_wall: vec![projectile::Effect::Vanish], - hit_entity: vec![ - projectile::Effect::Damage(HealthChange { - amount: -(*power as i32), - cause: HealthSource::Attack { by: *uid }, - }), - projectile::Effect::Vanish, - ], - time_left: Duration::from_secs(5), - }, - }); - // TODO: Don't play melee animation - Attack { - time_left: attack_duration, - applied: true, // We don't want to do a melee attack - } - } - - // Go upward - item::Tool::Debug(item::Debug::Boost) => { - local_emitter.emit(LocalEvent::Boost { - entity, - vel: Vec3::new(0.0, 0.0, 7.0), - }); - - character.action - } - - // All other weapons block - _ if character.action.is_action_finished() => Block { - time_active: Duration::from_secs(0), - }, - - _ => character.action, - } - } - - _ => character.action, - } - } -} - impl<'a> System<'a> for Sys { type SystemData = ( Entities<'a>, @@ -245,442 +28,30 @@ impl<'a> System<'a> for Sys { Read<'a, EventBus>, Read<'a, DeltaTime>, WriteStorage<'a, Controller>, - WriteStorage<'a, CharacterState>, - ReadStorage<'a, Stats>, - ReadStorage<'a, Body>, - ReadStorage<'a, Vel>, - ReadStorage<'a, PhysicsState>, ReadStorage<'a, Uid>, - ReadStorage<'a, Mounting>, ); fn run( &mut self, - ( - entities, - uid_allocator, - server_bus, - local_bus, - dt, - mut controllers, - mut character_states, - stats, - bodies, - velocities, - physics_states, - uids, - mountings, - ): Self::SystemData, + (entities, uid_allocator, server_bus, local_bus, dt, mut controllers, uids): Self::SystemData, ) { let mut server_emitter = server_bus.emitter(); let mut local_emitter = local_bus.emitter(); - for (entity, uid, controller, mut character, stats, body, vel, physics, mount) in ( - &entities, - &uids, - &mut controllers, - &mut character_states, - &stats, - &bodies, - &velocities, - &physics_states, - mountings.maybe(), - ) - .join() - { + for (entity, uid, controller) in (&entities, &uids, &mut controllers).join() { let inputs = &mut controller.inputs; - // --------------------------------------- - // Common actions for multiple states as closure fn's for convenience - // Returns a Wield action, or Idle if nothing to wield - let try_wield = |stats: &Stats| -> ActionState { - // Get weapon to wield - if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - } + // Update `inputs.move_dir`. + inputs.move_dir = if inputs.move_dir.magnitude_squared() > 1.0 { + // Cap move_dir to 1 + inputs.move_dir.normalized() + } else { + inputs.move_dir }; - let get_state_from_move_dir = |move_dir: &Vec2| -> MovementState { - if move_dir.magnitude_squared() > 0.0 { - Run - } else { - Stand - } - }; - - // End common actions - // --------------------------------------- - - // Being dead overrides all other states - if stats.is_dead { - // Only options: click respawn - // prevent instant-respawns (i.e. player was holding attack) - // by disallowing while input is held down - if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { - server_emitter.emit(ServerEvent::Respawn(entity)); - } - // Or do nothing - continue; - } - // If mounted, character state is controlled by mount - if mount.is_some() { - character.movement = Sit; - continue; - } - - inputs.update_look_dir(); - inputs.update_move_dir(); - - match (character.action, character.movement) { - // Jumping, one frame state that calls jump server event - (_, Jump) => { - character.movement = Fall; - local_emitter.emit(LocalEvent::Jump(entity)); - } - // Charging + Any Movement, prioritizes finishing charge - // over movement states - (Charge { time_left }, _) => { - inputs.update_move_dir(); - if time_left == Duration::default() || vel.0.magnitude_squared() < 10.0 { - character.action = try_wield(stats); - } else { - character.action = Charge { - time_left: time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(), - }; - } - if let Some(uid_b) = physics.touch_entity { - server_emitter.emit(ServerEvent::Damage { - uid: uid_b, - change: HealthChange { - amount: -20, - cause: HealthSource::Attack { by: *uid }, - }, - }); - - character.action = try_wield(stats); - } - } - // Rolling + Any Movement, prioritizes finishing charge - // over movement states - ( - Roll { - time_left, - was_wielding, - }, - _, - ) => { - if time_left == Duration::default() { - if was_wielding { - character.action = try_wield(stats); - } else { - character.action = Idle; - } - } else { - character.action = Roll { - time_left: time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(), - was_wielding, - } - } - } - // Any Action + Falling - (action_state, Fall) => { - character.movement = get_state_from_move_dir(&inputs.move_dir); - if inputs.glide.is_pressed() { - character.movement = Glide; - continue; - } - // Try to climb - if let (true, Some(_wall_dir)) = ( - inputs.climb.is_pressed() | inputs.climb_down.is_pressed() - && body.is_humanoid(), - physics.on_wall, - ) { - character.movement = Climb; - continue; - } - // Reset to Falling while not standing on ground, - // otherwise keep the state given above - if !physics.on_ground { - if physics.in_fluid { - character.movement = Swim; - } else { - character.movement = Fall; - } - } else { - character.movement = Stand; - continue; - } - - match action_state { - // Unwield if buttons pressed - Wield { .. } | Attack { .. } => { - if inputs.toggle_wield.is_just_pressed() { - character.action = Idle; - } - } - // Try to wield if any of buttons pressed - Idle => { - if inputs.primary.is_pressed() || inputs.secondary.is_pressed() { - character.action = try_wield(stats); - continue; - } - } - // Cancel blocks - Block { .. } => { - character.action = try_wield(stats); - continue; - } - // Don't change action - Charge { .. } | Roll { .. } => {} - } - if inputs.primary.is_pressed() { - character.action = Self::handle_primary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } else if inputs.secondary.is_pressed() { - character.action = Self::handle_secondary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } - } - // Any Action + Swimming - (_action_state, Swim) => { - character.movement = get_state_from_move_dir(&inputs.move_dir); - - if !physics.on_ground && physics.in_fluid { - character.movement = Swim; - } - if inputs.primary.is_pressed() { - character.action = Self::handle_primary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } else if inputs.secondary.is_pressed() { - character.action = Self::handle_secondary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } - } - // Blocking, restricted look_dir compared to other states - (Block { .. }, Stand) | (Block { .. }, Run) => { - character.movement = get_state_from_move_dir(&inputs.move_dir); - - if !inputs.secondary.is_pressed() { - character.action = try_wield(stats); - } else { - character.action = Self::handle_secondary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } - - if !physics.on_ground { - if physics.in_fluid { - character.movement = Swim; - } else { - character.movement = Fall; - } - } - } - // Standing and Running states, typical states :shrug: - (action_state, Run) | (action_state, Stand) => { - character.movement = get_state_from_move_dir(&inputs.move_dir); - // Try to sit - if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { - character.movement = Sit; - continue; - } - - // Try to climb - if let (true, Some(_wall_dir)) = ( - inputs.climb.is_pressed() | inputs.climb_down.is_pressed() - && body.is_humanoid(), - physics.on_wall, - ) { - character.movement = Climb; - continue; - } - - // Try to swim - if !physics.on_ground { - if physics.in_fluid { - character.movement = Swim; - } else { - character.movement = Fall; - } - } - - // While on ground ... - if physics.on_ground { - // Try to jump - if inputs.jump.is_pressed() { - character.movement = Jump; - continue; - } - - // Try to charge - if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { - character.action = Charge { - time_left: Duration::from_millis(250), - }; - continue; - } - - // Try to roll - if character.movement == Run - && inputs.roll.is_pressed() - && body.is_humanoid() - { - character.action = Roll { - time_left: ROLL_DURATION, - was_wielding: character.action.is_wield(), - }; - continue; - } - } - // While not on ground ... - else { - // Try to glide - if physics.on_wall == None - && inputs.glide.is_pressed() - && body.is_humanoid() - { - character.movement = Glide; - continue; - } - } - - // Tool Actions - if inputs.toggle_wield.is_just_pressed() { - match action_state { - Wield { .. } | Attack { .. } => { - // Prevent instantaneous reequipping by checking - // for done wielding - if character.action.is_action_finished() { - character.action = Idle; - } - continue; - } - Idle => { - character.action = try_wield(stats); - continue; - } - Charge { .. } | Roll { .. } | Block { .. } => {} - } - } - if inputs.primary.is_pressed() { - character.action = Self::handle_primary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } else if inputs.secondary.is_pressed() { - character.action = Self::handle_secondary( - inputs, - character, - stats, - entity, - uid, - &mut server_emitter, - &mut local_emitter, - ); - } - } - // Sitting - (_, Sit) => { - character.action = Idle; - character.movement = get_state_from_move_dir(&inputs.move_dir); - - // character.movement will be Stand after updating when - // no movement has occurred - if character.movement == Stand { - character.movement = Sit; - } - if inputs.jump.is_pressed() { - character.movement = Jump; - continue; - } - if !physics.on_ground { - character.movement = Fall; - } - } - // Any Action + Gliding, shouldnt care about action, - // because should be Idle - (_, Glide) => { - character.action = Idle; - - if !inputs.glide.is_pressed() { - character.movement = Fall; - } else if let Some(_wall_dir) = physics.on_wall { - character.movement = Climb; - } - - if physics.on_ground { - character.movement = Stand - } - } - // Any Action + Climbing, shouldnt care about action, - // because should be Idle - (_, Climb) => { - character.action = Idle; - if let None = physics.on_wall { - if inputs.jump.is_pressed() { - character.movement = Jump; - } else { - character.movement = Fall; - } - } - if physics.on_ground { - character.movement = Stand; - } - } // In case of adding new states - // (_, _) => { - // println!("UNKNOWN STATE"); - // character.action = Idle; - // character.movement = Fall; - // } - }; + // Update `inputs.look_dir` + inputs + .look_dir + .try_normalized() + .unwrap_or(inputs.move_dir.into()); // Process other controller events for event in controller.events.drain(..) { diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index f9f154c82d..b490c19354 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -1,4 +1,5 @@ pub mod agent; +pub mod character_state; mod cleanup; pub mod combat; pub mod controller; @@ -12,6 +13,7 @@ use specs::DispatcherBuilder; // System names const AGENT_SYS: &str = "agent_sys"; +const CHARACTER_STATE_SYS: &str = "character_state_sys"; const CONTROLLER_SYS: &str = "controller_sys"; const PHYS_SYS: &str = "phys_sys"; const MOVEMENT_SYS: &str = "movement_sys"; @@ -23,7 +25,8 @@ const CLEANUP_SYS: &str = "cleanup_sys"; pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(agent::Sys, AGENT_SYS, &[]); dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS]); - dispatch_builder.add(movement::Sys, MOVEMENT_SYS, &[]); + dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); + dispatch_builder.add(movement::Sys, MOVEMENT_SYS, &[CHARACTER_STATE_SYS]); dispatch_builder.add(combat::Sys, COMBAT_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(stats::Sys, STATS_SYS, &[COMBAT_SYS]); dispatch_builder.add( diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index 6bd3b797ee..531acc9da0 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -105,6 +105,10 @@ impl<'a> System<'a> for Sys { ) .join() { + if character.movement == Run || character.movement == Stand { + continue; + } + if stats.is_dead { continue; } From e40eb2ba20bd00fa6d8c5e2713b6f7ff6ce51541 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Fri, 20 Dec 2019 08:50:54 -0800 Subject: [PATCH 002/387] Finish Stand handle() (untested) --- common/src/comp/character_state.rs | 58 ++++++++++++++++++++++++------ common/src/sys/character_state.rs | 19 ++++++---- 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 86588381ce..192af702ef 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,4 +1,6 @@ -use crate::comp::{Body, CharacterState, Controller, ControllerInputs, PhysicsState}; +use crate::comp::{ + Body, CharacterState, Controller, ControllerInputs, ItemKind, PhysicsState, Stats, +}; use specs::{Component, FlaggedStorage, HashMapStorage}; use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System}; use sphynx::{Uid, UidAllocator}; @@ -10,6 +12,7 @@ pub trait State { &self, character: &CharacterState, inputs: &ControllerInputs, + stats: &Stats, body: &Body, physics: &PhysicsState, ) -> CharacterState; @@ -25,6 +28,7 @@ impl State for StandData { &self, character: &CharacterState, inputs: &ControllerInputs, + stats: &Stats, body: &Body, physics: &PhysicsState, ) -> CharacterState { @@ -100,26 +104,45 @@ impl State for StandData { && !inputs.glide.is_held_down() && body.is_humanoid() { - character.movement = Glide; - continue; + return CharacterState { + action: Idle, + movement: Glide, + }; } - character.movement = Fall; + return CharacterState { + action: character.action, + movement: Fall, + }; } // Tool Actions if inputs.toggle_wield.is_just_pressed() { - match action_state { + match character.action { Wield { .. } | Attack { .. } => { // Prevent instantaneous reequipping by checking // for done wielding if character.action.is_action_finished() { - character.action = Idle; + return CharacterState { + action: Idle, + movement: character.movement, + }; } - continue; } Idle => { - character.action = try_wield(stats); - continue; + return CharacterState { + // Try to wield if an item is equipped in main hand + action: if let Some(ItemKind::Tool { kind, .. }) = + stats.equipment.main.as_ref().map(|i| &i.kind) + { + let wield_duration = kind.wield_duration(); + Wield { + time_left: wield_duration, + } + } else { + Idle + }, + movement: character.movement, + }; } Charge { .. } | Roll { .. } | Block { .. } => {} } @@ -129,14 +152,27 @@ impl State for StandData { } else if inputs.secondary.is_pressed() { // TODO: SecondaryStart } + + if inputs.move_dir.magnitude_squared() > 0.0 { + return CharacterState { + action: character.action, + movement: Run(RunData), + }; + } else { + return CharacterState { + action: character.action, + movement: Stand(StandData), + }; + } + return character; } } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum MovementState { - Stand(Stand), + Stand(StandData), Sit, - Run(Run), + Run(RunData), Jump, Fall, Glide, diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index d5373c4390..c6fb92407e 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,9 +1,14 @@ use super::movement::ROLL_DURATION; use crate::{ comp::{ - self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ControlEvent, - Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, - MovementState, MovementState::*, PhysicsState, Projectile, Stats, Vel, + self, item, projectile, ActionState, + ActionState::*, + Body, CharacterState, + CharacterState::{RunData, StandData}, + ControlEvent, Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, + MovementState, + MovementState::*, + PhysicsState, Projectile, Stats, Vel, }, event::{Emitter, EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -88,9 +93,9 @@ impl<'a> System<'a> for Sys { let get_state_from_move_dir = |move_dir: &Vec2| -> MovementState { if move_dir.magnitude_squared() > 0.0 { - Run(_) + Run(RunData) } else { - Stand(_) + Stand(StandData) } }; @@ -204,7 +209,7 @@ impl<'a> System<'a> for Sys { character.movement = Fall; } } else { - character.movement = Stand(comp::character_state::Stand); + character.movement = Stand(StandData); continue; } @@ -354,7 +359,7 @@ impl<'a> System<'a> for Sys { // character.movement will be Stand after updating when // no movement has occurred - if character.movement == Stand(_) { + if character.movement == Stand(StandData) { character.movement = Sit; } if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { From 1ab09220b0c5dc73ce6e39084ede7baced497557 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sat, 21 Dec 2019 07:57:15 -0800 Subject: [PATCH 003/387] Rudimentary Stand State handle() move --- common/src/comp/character_state.rs | 159 +----------------- common/src/comp/mod.rs | 2 +- common/src/sys/character_state.rs | 232 ++++++++++++++++++++++++-- common/src/sys/movement.rs | 7 +- voxygen/src/audio/sfx/event_mapper.rs | 2 +- voxygen/src/scene/figure/mod.rs | 54 +++--- 6 files changed, 253 insertions(+), 203 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 192af702ef..1df20ddde1 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,173 +1,16 @@ -use crate::comp::{ - Body, CharacterState, Controller, ControllerInputs, ItemKind, PhysicsState, Stats, -}; +use crate::comp::{Body, Controller, ControllerInputs, ItemKind, PhysicsState, Stats}; use specs::{Component, FlaggedStorage, HashMapStorage}; use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System}; use sphynx::{Uid, UidAllocator}; //use specs_idvs::IDVStorage; use self::{ActionState::*, MovementState::*}; use std::time::Duration; -pub trait State { - fn handle( - &self, - character: &CharacterState, - inputs: &ControllerInputs, - stats: &Stats, - body: &Body, - physics: &PhysicsState, - ) -> CharacterState; -} #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct RunData; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct StandData; -impl State for StandData { - fn handle( - &self, - character: &CharacterState, - inputs: &ControllerInputs, - stats: &Stats, - body: &Body, - physics: &PhysicsState, - ) -> CharacterState { - let mut new_move: MovementState = if inputs.move_dir.magnitude_squared() > 0.0 { - MovementState::Run(RunData) - } else { - MovementState::Stand(StandData) - }; - - // Try to sit - if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { - return CharacterState { - movement: Sit, - action: Idle, - }; - } - - // Try to climb - if let (true, Some(_wall_dir)) = ( - inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), - physics.on_wall, - ) { - return CharacterState { - movement: Climb, - action: Idle, - }; - } - - // Try to swim - if !physics.on_ground && physics.in_fluid { - return CharacterState { - action: character.action, - movement: Swim, - }; - } - - // While on ground ... - if physics.on_ground { - // Try to jump - if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { - return CharacterState { - action: character.action, - movement: Jump, - }; - } - - // Try to charge - if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { - return CharacterState { - action: Charge { - time_left: Duration::from_millis(250), - }, - movement: Run(RunData), - }; - } - - // Try to roll - if inputs.roll.is_pressed() && body.is_humanoid() { - return CharacterState { - action: Roll { - time_left: Duration::from_millis(600), - was_wielding: character.action.is_wield(), - }, - movement: Run(RunData), - }; - } - } - // While not on ground ... - else { - // Try to glide - if physics.on_wall == None - && inputs.glide.is_pressed() - && !inputs.glide.is_held_down() - && body.is_humanoid() - { - return CharacterState { - action: Idle, - movement: Glide, - }; - } - return CharacterState { - action: character.action, - movement: Fall, - }; - } - - // Tool Actions - if inputs.toggle_wield.is_just_pressed() { - match character.action { - Wield { .. } | Attack { .. } => { - // Prevent instantaneous reequipping by checking - // for done wielding - if character.action.is_action_finished() { - return CharacterState { - action: Idle, - movement: character.movement, - }; - } - } - Idle => { - return CharacterState { - // Try to wield if an item is equipped in main hand - action: if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - }, - movement: character.movement, - }; - } - Charge { .. } | Roll { .. } | Block { .. } => {} - } - } - if inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - - if inputs.move_dir.magnitude_squared() > 0.0 { - return CharacterState { - action: character.action, - movement: Run(RunData), - }; - } else { - return CharacterState { - action: character.action, - movement: Stand(StandData), - }; - } - return character; - } -} - #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum MovementState { Stand(StandData), diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 42f8e6e161..a119bf10a6 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -20,7 +20,7 @@ pub use body::{ biped_large, bird_medium, bird_small, dragon, fish_medium, fish_small, humanoid, object, quadruped_medium, quadruped_small, Body, }; -pub use character_state::{ActionState, CharacterState, MovementState}; +pub use character_state::{ActionState, CharacterState, MovementState, RunData, StandData}; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, Mounting, diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index c6fb92407e..8a26c82e5b 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,14 +1,12 @@ use super::movement::ROLL_DURATION; +const HUMANOID_ACCEL: f32 = 50.0; +const HUMANOID_SPEED: f32 = 120.0; use crate::{ comp::{ - self, item, projectile, ActionState, - ActionState::*, - Body, CharacterState, - CharacterState::{RunData, StandData}, - ControlEvent, Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, - MovementState, - MovementState::*, - PhysicsState, Projectile, Stats, Vel, + self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ControlEvent, + Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, + MovementState, MovementState::*, Ori, PhysicsState, Pos, Projectile, RunData, StandData, + Stats, Vel, }, event::{Emitter, EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -33,10 +31,12 @@ impl<'a> System<'a> for Sys { Read<'a, EventBus>, Read<'a, DeltaTime>, WriteStorage<'a, CharacterState>, + WriteStorage<'a, Pos>, + WriteStorage<'a, Vel>, + WriteStorage<'a, Ori>, ReadStorage<'a, Controller>, ReadStorage<'a, Stats>, ReadStorage<'a, Body>, - ReadStorage<'a, Vel>, ReadStorage<'a, PhysicsState>, ReadStorage<'a, Uid>, ReadStorage<'a, Mounting>, @@ -50,10 +50,12 @@ impl<'a> System<'a> for Sys { local_bus, dt, mut character_states, + mut positions, + mut velocities, + mut orientations, controllers, stats, bodies, - velocities, physics_states, uids, mountings, @@ -61,14 +63,28 @@ impl<'a> System<'a> for Sys { ) { let mut server_emitter = server_bus.emitter(); let mut local_emitter = local_bus.emitter(); - for (entity, uid, mut character, controller, stats, body, vel, physics, mount) in ( + for ( + entity, + uid, + mut character, + mut pos, + mut vel, + mut ori, + controller, + stats, + body, + physics, + mount, + ) in ( &entities, &uids, &mut character_states, + &mut positions, + &mut velocities, + &mut orientations, &controllers, &stats, &bodies, - &velocities, &physics_states, mountings.maybe(), ) @@ -382,7 +398,7 @@ impl<'a> System<'a> for Sys { } if physics.on_ground { - character.movement = Stand(Stand) + character.movement = Stand(StandData) } } // Any Action + Climbing, shouldnt care about action, @@ -397,9 +413,197 @@ impl<'a> System<'a> for Sys { } } if physics.on_ground { - character.movement = Stand(Stand); + character.movement = Stand(StandData); } } + (_, Stand(data)) => { + let mut new_char = + data.handle(character, pos, vel, ori, &dt, inputs, stats, body, physics); + println!("{:?}", new_char); + character = &mut new_char; + } + (_, _) => { + character.movement = Stand(StandData); + } + }; + } + } +} + +pub trait State { + fn handle( + &self, + character: &CharacterState, + pos: &mut Pos, + vel: &mut Vel, + ori: &mut Ori, + dt: &DeltaTime, + inputs: &ControllerInputs, + stats: &Stats, + body: &Body, + physics: &PhysicsState, + ) -> CharacterState; +} + +impl State for StandData { + fn handle( + &self, + character: &CharacterState, + pos: &mut Pos, + vel: &mut Vel, + ori: &mut Ori, + dt: &DeltaTime, + inputs: &ControllerInputs, + stats: &Stats, + body: &Body, + physics: &PhysicsState, + ) -> CharacterState { + // Move player according to move_dir + vel.0 += Vec2::broadcast(dt.0) + * inputs.move_dir + * if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { + HUMANOID_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if character.action.is_attack() || character.action.is_block() { + Vec2::from(inputs.look_dir).normalized() + } else { + Vec2::from(vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 + { + ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 9.0 * dt.0); + } + + // Try to sit + if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { + return CharacterState { + movement: Sit, + action: Idle, + }; + } + + // Try to climb + if let (true, Some(_wall_dir)) = ( + inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), + physics.on_wall, + ) { + return CharacterState { + movement: Climb, + action: Idle, + }; + } + + // Try to swim + if !physics.on_ground && physics.in_fluid { + return CharacterState { + action: character.action, + movement: Swim, + }; + } + + // While on ground ... + if physics.on_ground { + // Try to jump + if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { + return CharacterState { + action: character.action, + movement: Jump, + }; + } + + // Try to charge + if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { + return CharacterState { + action: Charge { + time_left: Duration::from_millis(250), + }, + movement: Run(RunData), + }; + } + + // Try to roll + if inputs.roll.is_pressed() && body.is_humanoid() { + return CharacterState { + action: Roll { + time_left: Duration::from_millis(600), + was_wielding: character.action.is_wield(), + }, + movement: Run(RunData), + }; + } + } + // While not on ground ... + else { + // Try to glide + if physics.on_wall == None + && inputs.glide.is_pressed() + && !inputs.glide.is_held_down() + && body.is_humanoid() + { + return CharacterState { + action: Idle, + movement: Glide, + }; + } + return CharacterState { + action: character.action, + movement: Fall, + }; + } + + // Tool Actions + if inputs.toggle_wield.is_just_pressed() { + match character.action { + Wield { .. } | Attack { .. } => { + // Prevent instantaneous reequipping by checking + // for done wielding + if character.action.is_action_finished() { + return CharacterState { + action: Idle, + movement: character.movement, + }; + } + } + Idle => { + return CharacterState { + // Try to wield if an item is equipped in main hand + action: if let Some(ItemKind::Tool { kind, .. }) = + stats.equipment.main.as_ref().map(|i| &i.kind) + { + let wield_duration = kind.wield_duration(); + Wield { + time_left: wield_duration, + } + } else { + Idle + }, + movement: character.movement, + }; + } + Charge { .. } | Roll { .. } | Block { .. } => {} + } + } + if inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + + if inputs.move_dir.magnitude_squared() > 0.0 { + return CharacterState { + action: character.action, + movement: Run(RunData), + }; + } else { + return CharacterState { + action: character.action, + movement: Stand(StandData), }; } } diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index 531acc9da0..bcbb29436b 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -1,7 +1,8 @@ use super::phys::GRAVITY; use crate::{ comp::{ - CharacterState, Controller, Mounting, MovementState::*, Ori, PhysicsState, Pos, Stats, Vel, + CharacterState, Controller, Mounting, MovementState::*, Ori, PhysicsState, Pos, RunData, + StandData, Stats, Vel, }, event::{EventBus, ServerEvent}, state::DeltaTime, @@ -105,7 +106,7 @@ impl<'a> System<'a> for Sys { ) .join() { - if character.movement == Run || character.movement == Stand { + if character.movement == Run(RunData) || character.movement == Stand(StandData) { continue; } @@ -145,7 +146,7 @@ impl<'a> System<'a> for Sys { vel.0 += Vec2::broadcast(dt.0) * inputs.move_dir * match (physics.on_ground, &character.movement) { - (true, Run) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { + (true, Run(_)) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { HUMANOID_ACCEL } (false, Climb) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 8524f04fc8..2873f2d590 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -162,7 +162,7 @@ impl SfxEventMapper { (_, ActionState::Roll { .. }, ..) => SfxEvent::Roll, (MovementState::Climb, ..) => SfxEvent::Climb, (MovementState::Swim, ..) => SfxEvent::Swim, - (MovementState::Run, ..) => SfxEvent::Run, + (MovementState::Run(_), ..) => SfxEvent::Run, (MovementState::Fall, _, previous_event, _) => { if previous_event != SfxEvent::Glide { SfxEvent::Fall diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index ddecd67043..7c7319f74e 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -197,14 +197,14 @@ impl FigureMgr { } let target_base = match &character.movement { - Stand => anim::character::StandAnimation::update_skeleton( + Stand(_) => anim::character::StandAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::character::RunAnimation::update_skeleton( + Run(_) => anim::character::RunAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, state.last_ori, time), state.movement_time, @@ -248,14 +248,16 @@ impl FigureMgr { ), }; let target_bones = match (&character.movement, &character.action) { - (Stand, Wield { .. }) => anim::character::CidleAnimation::update_skeleton( - &target_base, - (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, - skeleton_attr, - ), - (Stand, Block { .. }) => { + (Stand(_), Wield { .. }) => { + anim::character::CidleAnimation::update_skeleton( + &target_base, + (active_tool_kind, time), + state.action_time, + &mut action_animation_rate, + skeleton_attr, + ) + } + (Stand(_), Block { .. }) => { anim::character::BlockIdleAnimation::update_skeleton( &target_base, (active_tool_kind, time), @@ -333,14 +335,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::quadruped_small::IdleAnimation::update_skeleton( + Stand(_) => anim::quadruped_small::IdleAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::quadruped_small::RunAnimation::update_skeleton( + Run(_) => anim::quadruped_small::RunAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -390,14 +392,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::quadruped_medium::IdleAnimation::update_skeleton( + Stand(_) => anim::quadruped_medium::IdleAnimation::update_skeleton( &QuadrupedMediumSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::quadruped_medium::RunAnimation::update_skeleton( + Run(_) => anim::quadruped_medium::RunAnimation::update_skeleton( &QuadrupedMediumSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -445,14 +447,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::bird_medium::IdleAnimation::update_skeleton( + Stand(_) => anim::bird_medium::IdleAnimation::update_skeleton( &BirdMediumSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::bird_medium::RunAnimation::update_skeleton( + Run(_) => anim::bird_medium::RunAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -500,14 +502,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::fish_medium::IdleAnimation::update_skeleton( + Stand(_) => anim::fish_medium::IdleAnimation::update_skeleton( &FishMediumSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::fish_medium::RunAnimation::update_skeleton( + Run(_) => anim::fish_medium::RunAnimation::update_skeleton( &FishMediumSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -555,14 +557,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::dragon::IdleAnimation::update_skeleton( + Stand(_) => anim::dragon::IdleAnimation::update_skeleton( &DragonSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::dragon::RunAnimation::update_skeleton( + Run(_) => anim::dragon::RunAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -610,14 +612,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::bird_small::IdleAnimation::update_skeleton( + Stand(_) => anim::bird_small::IdleAnimation::update_skeleton( &BirdSmallSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::bird_small::RunAnimation::update_skeleton( + Run(_) => anim::bird_small::RunAnimation::update_skeleton( &BirdSmallSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -665,14 +667,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::fish_small::IdleAnimation::update_skeleton( + Stand(_) => anim::fish_small::IdleAnimation::update_skeleton( &FishSmallSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::fish_small::RunAnimation::update_skeleton( + Run(_) => anim::fish_small::RunAnimation::update_skeleton( &FishSmallSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -720,14 +722,14 @@ impl FigureMgr { } let target_base = match character.movement { - Stand => anim::biped_large::IdleAnimation::update_skeleton( + Stand(_) => anim::biped_large::IdleAnimation::update_skeleton( &BipedLargeSkeleton::new(), time, state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Run => anim::biped_large::RunAnimation::update_skeleton( + Run(_) => anim::biped_large::RunAnimation::update_skeleton( &BipedLargeSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, From c2ceabea0e2c2e382ab391cc9f9f778462e368bf Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sun, 22 Dec 2019 08:08:48 -0800 Subject: [PATCH 004/387] finish movment states handle() fn logic --- .DS_Store | Bin 0 -> 6148 bytes common/src/comp/character_state.rs | 26 +- common/src/comp/mod.rs | 5 +- common/src/sys/agent.rs | 7 +- common/src/sys/character_state.rs | 1043 ++++++++++++++++++------- common/src/sys/movement.rs | 232 +++--- voxygen/src/audio/sfx/event_mapper.rs | 8 +- voxygen/src/scene/figure/mod.rs | 26 +- 8 files changed, 930 insertions(+), 417 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8cda30a1a4792f56e6be97fda60289fc9c97c759 GIT binary patch literal 6148 zcmeHKyH3L}6g`GgN|AsK#*8c=F|&j|gevincaS^ve!>5#;9oUf%wdSE;QLnMD=`ch$97Q?FF%-SOn* zKR52#Vzotsp$-ZJ1%d)!3dr{%ViAlj<_7hrgOxr45G(A~#b{p7ITA!4rLD?%Fe9p2}SAIIew(wp<;uf4hjSXd Self { Self { - movement: MovementState::Jump, + movement: MovementState::Fall(FallData), action: ActionState::Idle, } } diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index a119bf10a6..1f2e894539 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -20,7 +20,10 @@ pub use body::{ biped_large, bird_medium, bird_small, dragon, fish_medium, fish_small, humanoid, object, quadruped_medium, quadruped_small, Body, }; -pub use character_state::{ActionState, CharacterState, MovementState, RunData, StandData}; +pub use character_state::{ + ActionState, CharacterState, ClimbData, FallData, GlideData, JumpData, MovementState, RunData, + SitData, StandData, SwimData, +}; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, Mounting, diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index c2bcbe1c2a..f0df4a9e0d 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,6 @@ use crate::comp::{ - Agent, CharacterState, Controller, ControllerInputs, MountState, MovementState::Glide, Pos, - Stats, + Agent, CharacterState, Controller, ControllerInputs, GlideData, MountState, + MovementState::Glide, Pos, Stats, }; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; @@ -163,7 +163,8 @@ impl<'a> System<'a> for Sys { inputs.roll.set_state(true); } - if target_character.movement == Glide && target_pos.0.z > pos.0.z + 5.0 + if target_character.movement == Glide(GlideData) + && target_pos.0.z > pos.0.z + 5.0 { inputs.glide.set_state(true); inputs.jump.set_state(true); diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 8a26c82e5b..716ddacf46 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,12 +1,30 @@ use super::movement::ROLL_DURATION; +use super::phys::GRAVITY; + const HUMANOID_ACCEL: f32 = 50.0; const HUMANOID_SPEED: f32 = 120.0; +const HUMANOID_AIR_ACCEL: f32 = 10.0; +const HUMANOID_AIR_SPEED: f32 = 100.0; +const HUMANOID_WATER_ACCEL: f32 = 70.0; +const HUMANOID_WATER_SPEED: f32 = 120.0; +const HUMANOID_CLIMB_ACCEL: f32 = 5.0; +const ROLL_SPEED: f32 = 17.0; +const CHARGE_SPEED: f32 = 20.0; +const GLIDE_ACCEL: f32 = 15.0; +const GLIDE_SPEED: f32 = 45.0; +const BLOCK_ACCEL: f32 = 30.0; +const BLOCK_SPEED: f32 = 75.0; +// Gravity is 9.81 * 4, so this makes gravity equal to .15 +const GLIDE_ANTIGRAV: f32 = GRAVITY * 0.96; +const CLIMB_SPEED: f32 = 5.0; + +pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; use crate::{ comp::{ - self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ControlEvent, - Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, - MovementState, MovementState::*, Ori, PhysicsState, Pos, Projectile, RunData, StandData, - Stats, Vel, + self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ClimbData, + ControlEvent, Controller, ControllerInputs, FallData, GlideData, HealthChange, + HealthSource, ItemKind, JumpData, Mounting, MovementState, MovementState::*, Ori, + PhysicsState, Pos, Projectile, RunData, SitData, StandData, Stats, SwimData, Vel, }, event::{Emitter, EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -19,6 +37,8 @@ use sphynx::{Uid, UidAllocator}; use std::time::Duration; use vek::*; +struct CharacterStateData(); + /// # Character State System /// #### Updates then detemrines next Character States based on ControllerInputs pub struct Sys; @@ -61,8 +81,6 @@ impl<'a> System<'a> for Sys { mountings, ): Self::SystemData, ) { - let mut server_emitter = server_bus.emitter(); - let mut local_emitter = local_bus.emitter(); for ( entity, uid, @@ -91,7 +109,7 @@ impl<'a> System<'a> for Sys { .join() { let inputs = &controller.inputs; - + // println!("{:?}", character); // Returns a Wield action, or Idle if nothing to wield let try_wield = |stats: &Stats| -> ActionState { // Get weapon to wield @@ -121,14 +139,15 @@ impl<'a> System<'a> for Sys { // prevent instant-respawns (i.e. player was holding attack) // by disallowing while input is held down if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { - server_emitter.emit(ServerEvent::Respawn(entity)); + server_bus.emitter().emit(ServerEvent::Respawn(entity)); } // Or do nothing continue; } // If mounted, character state is controlled by mount + // TODO: Make mounting a state if mount.is_some() { - character.movement = Sit; + character.movement = Sit(SitData); continue; } @@ -168,263 +187,153 @@ impl<'a> System<'a> for Sys { Idle => {} } - // Determine new states - match (character.action, character.movement) { - // Jumping, one frame state that calls jump server event - (_, Jump) => { - character.movement = Fall; - local_emitter.emit(LocalEvent::Jump(entity)); - } - // Charging + Any Movement, prioritizes finishing charge - // over movement states - (Charge { time_left }, _) => { - if let Some(uid_b) = physics.touch_entity { - server_emitter.emit(ServerEvent::Damage { - uid: uid_b, - change: HealthChange { - amount: -20, - cause: HealthSource::Attack { by: *uid }, - }, - }); + // Determine new state + *character = match character.movement { + Stand(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Run(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Jump(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Climb(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Glide(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Swim(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Fall(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), + Sit(data) => data.handle( + &entity, + character, + pos, + vel, + ori, + &dt, + inputs, + stats, + body, + physics, + &server_bus, + &local_bus, + ), // Charging + Any Movement, prioritizes finishing charge + // over movement states + // (Charge { time_left }, _) => { + // if let Some(uid_b) = physics.touch_entity { + // server_emitter.emit(ServerEvent::Damage { + // uid: uid_b, + // change: HealthChange { + // amount: -20, + // cause: HealthSource::Attack { by: *uid }, + // }, + // }); - character.action = try_wield(stats); - } else if time_left == Duration::default() || vel.0.magnitude_squared() < 10.0 { - character.action = try_wield(stats); - } - } - // Rolling + Any Movement, prioritizes finishing charge - // over movement states - ( - Roll { - time_left, - was_wielding, - }, - _, - ) => { - if time_left == Duration::default() { - if was_wielding { - character.action = try_wield(stats); - } else { - character.action = Idle; - } - } - } - // Any Action + Falling - (action_state, Fall) => { - // character.movement = get_state_from_move_dir(&inputs.move_dir); - if inputs.glide.is_pressed() && !inputs.glide.is_held_down() { - character.movement = Glide; - continue; - } - // Reset to Falling while not standing on ground, - // otherwise keep the state given above - if !physics.on_ground { - if physics.in_fluid { - character.movement = Swim; - } else { - character.movement = Fall; - } - } else { - character.movement = Stand(StandData); - continue; - } - - match action_state { - // Unwield if buttons pressed - Wield { .. } | Attack { .. } => { - if inputs.toggle_wield.is_just_pressed() { - character.action = Idle; - } - } - // Try to wield if any of buttons pressed - Idle => { - if inputs.primary.is_pressed() || inputs.secondary.is_pressed() { - character.action = try_wield(stats); - } - } - // Cancel blocks - Block { .. } => { - character.action = try_wield(stats); - } - // Don't change action - Charge { .. } | Roll { .. } => {} - } - } - // Any Action + Swimming - (_, Swim) => { - character.movement = get_state_from_move_dir(&inputs.move_dir); - - if !physics.on_ground && physics.in_fluid { - character.movement = Swim; - } - if inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - } - // // Blocking, restricted look_dir compared to other states - // (Block { .. }, Stand) | (Block { .. }, Run) => { - // character.movement = get_state_from_move_dir(&inputs.move_dir); - - // if !inputs.secondary.is_pressed() { - // character.action = try_wield(stats); - // } else { - // // TODO: SecondaryStart - // } - - // if !physics.on_ground && physics.in_fluid { - // character.movement = Swim; - // } - // } - // // Standing and Running states, typical states :shrug: - // (action_state, Run) | (action_state, Stand) => { - // character.movement = get_state_from_move_dir(&inputs.move_dir); - // // Try to sit - // if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { - // character.movement = Sit; - // continue; - // } - - // // Try to climb - // if let (true, Some(_wall_dir)) = ( - // inputs.climb.is_pressed() | inputs.climb_down.is_pressed() - // && body.is_humanoid(), - // physics.on_wall, - // ) { - // character.movement = Climb; - // continue; - // } - - // // Try to swim - // if !physics.on_ground && physics.in_fluid { - // character.movement = Swim; - // continue; - // } - - // // While on ground ... - // if physics.on_ground { - // // Try to jump - // if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { - // character.movement = Jump; - // continue; - // } - - // // Try to charge - // if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { - // character.action = Charge { - // time_left: Duration::from_millis(250), - // }; - // continue; - // } - - // // Try to roll - // if character.movement == Run - // && inputs.roll.is_pressed() - // && body.is_humanoid() - // { - // character.action = Roll { - // time_left: ROLL_DURATION, - // was_wielding: character.action.is_wield(), - // }; - // continue; - // } - // } - // // While not on ground ... - // else { - // // Try to glide - // if physics.on_wall == None - // && inputs.glide.is_pressed() - // && !inputs.glide.is_held_down() - // && body.is_humanoid() - // { - // character.movement = Glide; - // continue; - // } - // character.movement = Fall; - // } - - // // Tool Actions - // if inputs.toggle_wield.is_just_pressed() { - // match action_state { - // Wield { .. } | Attack { .. } => { - // // Prevent instantaneous reequipping by checking - // // for done wielding - // if character.action.is_action_finished() { - // character.action = Idle; - // } - // continue; - // } - // Idle => { - // character.action = try_wield(stats); - // continue; - // } - // Charge { .. } | Roll { .. } | Block { .. } => {} - // } - // } - // if inputs.primary.is_pressed() { - // // TODO: PrimaryStart - // } else if inputs.secondary.is_pressed() { - // // TODO: SecondaryStart - // } - // } - // Sitting - (_, Sit) => { - character.action = Idle; - character.movement = get_state_from_move_dir(&inputs.move_dir); - - // character.movement will be Stand after updating when - // no movement has occurred - if character.movement == Stand(StandData) { - character.movement = Sit; - } - if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { - character.movement = Jump; - continue; - } - if !physics.on_ground { - character.movement = Fall; - } - } - // Any Action + Gliding, shouldnt care about action, - // because should be Idle - (_, Glide) => { - character.action = Idle; - - if !inputs.glide.is_pressed() { - character.movement = Fall; - } else if let Some(_wall_dir) = physics.on_wall { - character.movement = Fall; - } - - if physics.on_ground { - character.movement = Stand(StandData) - } - } - // Any Action + Climbing, shouldnt care about action, - // because should be Idle - (_, Climb) => { - character.action = Idle; - if let None = physics.on_wall { - if inputs.jump.is_pressed() { - character.movement = Jump; - } else { - character.movement = Fall; - } - } - if physics.on_ground { - character.movement = Stand(StandData); - } - } - (_, Stand(data)) => { - let mut new_char = - data.handle(character, pos, vel, ori, &dt, inputs, stats, body, physics); - println!("{:?}", new_char); - character = &mut new_char; - } - (_, _) => { - character.movement = Stand(StandData); - } + // character.action = try_wield(stats); + // } else if time_left == Duration::default() || vel.0.magnitude_squared() < 10.0 { + // character.action = try_wield(stats); + // } + // } + // Rolling + Any Movement, prioritizes finishing charge + // over movement states + // ( + // Roll { + // time_left, + // was_wielding, + // }, + // _, + // ) => { + // if time_left == Duration::default() { + // if was_wielding { + // character.action = try_wield(stats); + // } else { + // character.action = Idle; + // } + // } + // } }; } } @@ -433,6 +342,7 @@ impl<'a> System<'a> for Sys { pub trait State { fn handle( &self, + entity: &Entity, character: &CharacterState, pos: &mut Pos, vel: &mut Vel, @@ -442,14 +352,17 @@ pub trait State { stats: &Stats, body: &Body, physics: &PhysicsState, + server_bus: &EventBus, + local_bus: &EventBus, ) -> CharacterState; } -impl State for StandData { +impl State for RunData { fn handle( &self, + _entity: &Entity, character: &CharacterState, - pos: &mut Pos, + _pos: &mut Pos, vel: &mut Vel, ori: &mut Ori, dt: &DeltaTime, @@ -457,6 +370,8 @@ impl State for StandData { stats: &Stats, body: &Body, physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, ) -> CharacterState { // Move player according to move_dir vel.0 += Vec2::broadcast(dt.0) @@ -483,7 +398,7 @@ impl State for StandData { // Try to sit if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { return CharacterState { - movement: Sit, + movement: Sit(SitData), action: Idle, }; } @@ -494,7 +409,7 @@ impl State for StandData { physics.on_wall, ) { return CharacterState { - movement: Climb, + movement: Climb(ClimbData), action: Idle, }; } @@ -503,7 +418,7 @@ impl State for StandData { if !physics.on_ground && physics.in_fluid { return CharacterState { action: character.action, - movement: Swim, + movement: Swim(SwimData), }; } @@ -513,7 +428,7 @@ impl State for StandData { if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { return CharacterState { action: character.action, - movement: Jump, + movement: Jump(JumpData), }; } @@ -548,12 +463,12 @@ impl State for StandData { { return CharacterState { action: Idle, - movement: Glide, + movement: Glide(GlideData), }; } return CharacterState { action: character.action, - movement: Fall, + movement: Fall(FallData), }; } @@ -608,3 +523,585 @@ impl State for StandData { } } } + +impl State for StandData { + fn handle( + &self, + _entity: &Entity, + character: &CharacterState, + _pos: &mut Pos, + _vel: &mut Vel, + _ori: &mut Ori, + _dt: &DeltaTime, + inputs: &ControllerInputs, + stats: &Stats, + body: &Body, + physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, + ) -> CharacterState { + // Try to sit + if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { + return CharacterState { + movement: Sit(SitData), + action: Idle, + }; + } + + // Try to climb + if let (true, Some(_wall_dir)) = ( + inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), + physics.on_wall, + ) { + return CharacterState { + movement: Climb(ClimbData), + action: Idle, + }; + } + + // Try to swim + if !physics.on_ground && physics.in_fluid { + return CharacterState { + action: character.action, + movement: Swim(SwimData), + }; + } + + // While on ground ... + if physics.on_ground { + // Try to jump + if inputs.jump.is_pressed() { + return CharacterState { + action: character.action, + movement: Jump(JumpData), + }; + } + + // Try to charge + if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { + return CharacterState { + action: Charge { + time_left: Duration::from_millis(250), + }, + movement: Run(RunData), + }; + } + + // Try to roll + if inputs.roll.is_pressed() && body.is_humanoid() { + return CharacterState { + action: Roll { + time_left: Duration::from_millis(600), + was_wielding: character.action.is_wield(), + }, + movement: Run(RunData), + }; + } + } + // While not on ground ... + else { + // Try to glide + if physics.on_wall == None + && inputs.glide.is_pressed() + && !inputs.glide.is_held_down() + && body.is_humanoid() + { + return CharacterState { + action: Idle, + movement: Glide(GlideData), + }; + } + return CharacterState { + action: character.action, + movement: Fall(FallData), + }; + } + + // Tool Actions + if inputs.toggle_wield.is_just_pressed() { + match character.action { + Wield { .. } | Attack { .. } => { + // Prevent instantaneous reequipping by checking + // for done wielding + if character.action.is_action_finished() { + return CharacterState { + action: Idle, + movement: character.movement, + }; + } + } + Idle => { + return CharacterState { + // Try to wield if an item is equipped in main hand + action: if let Some(ItemKind::Tool { kind, .. }) = + stats.equipment.main.as_ref().map(|i| &i.kind) + { + let wield_duration = kind.wield_duration(); + Wield { + time_left: wield_duration, + } + } else { + Idle + }, + movement: character.movement, + }; + } + Charge { .. } | Roll { .. } | Block { .. } => {} + } + } + if inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + + if inputs.move_dir.magnitude_squared() > 0.0 { + return CharacterState { + action: character.action, + movement: Run(RunData), + }; + } else { + return CharacterState { + action: character.action, + movement: Stand(StandData), + }; + } + } +} + +impl State for SitData { + fn handle( + &self, + _entity: &Entity, + _character: &CharacterState, + _pos: &mut Pos, + _vel: &mut Vel, + _ori: &mut Ori, + _dt: &DeltaTime, + inputs: &ControllerInputs, + _stats: &Stats, + _body: &Body, + physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, + ) -> CharacterState { + // Falling + // Idk, maybe the ground disappears, + // suddenly maybe a water spell appears. + // Can't hurt to be safe :shrug: + if !physics.on_ground { + if physics.in_fluid { + return CharacterState { + action: Idle, + movement: Swim(SwimData), + }; + } else { + return CharacterState { + action: Idle, + movement: Fall(FallData), + }; + } + } + // Jumping + if inputs.jump.is_pressed() { + return CharacterState { + action: Idle, + movement: Jump(JumpData), + }; + } + + // Moving + if inputs.move_dir.magnitude_squared() > 0.0 { + return CharacterState { + action: Idle, + movement: Run(RunData), + }; + } + + // Standing back up (unsitting) + if inputs.sit.is_just_pressed() { + return CharacterState { + action: Idle, + movement: Stand(StandData), + }; + } + + // no movement has occurred + return CharacterState { + action: Idle, + movement: Sit(SitData), + }; + } +} + +impl State for JumpData { + fn handle( + &self, + entity: &Entity, + character: &CharacterState, + _pos: &mut Pos, + _vel: &mut Vel, + _ori: &mut Ori, + _dt: &DeltaTime, + _inputs: &ControllerInputs, + _stats: &Stats, + _body: &Body, + _physics: &PhysicsState, + _server_bus: &EventBus, + local_bus: &EventBus, + ) -> CharacterState { + local_bus.emitter().emit(LocalEvent::Jump(*entity)); + + return CharacterState { + action: character.action, + movement: Fall(FallData), + }; + } +} + +impl State for FallData { + fn handle( + &self, + _entity: &Entity, + character: &CharacterState, + _pos: &mut Pos, + vel: &mut Vel, + ori: &mut Ori, + dt: &DeltaTime, + inputs: &ControllerInputs, + stats: &Stats, + _body: &Body, + physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, + ) -> CharacterState { + // Move player according to move_dir + vel.0 += Vec2::broadcast(dt.0) + * inputs.move_dir + * if vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) { + HUMANOID_AIR_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if character.action.is_attack() || character.action.is_block() { + Vec2::from(inputs.look_dir).normalized() + } else { + Vec2::from(vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 + { + ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 2.0 * dt.0); + } + + let mut new_action = character.action; + + // Update actions + match character.action { + // Unwield if buttons pressed + Wield { .. } | Attack { .. } => { + if inputs.toggle_wield.is_just_pressed() { + new_action = Idle; + } + } + // Try to wield if any of buttons pressed + Idle => { + if inputs.primary.is_pressed() || inputs.secondary.is_pressed() { + new_action = if let Some(ItemKind::Tool { kind, .. }) = + stats.equipment.main.as_ref().map(|i| &i.kind) + { + let wield_duration = kind.wield_duration(); + Wield { + time_left: wield_duration, + } + } else { + Idle + } + }; + } + // Cancel blocks + Block { .. } => { + new_action = if let Some(ItemKind::Tool { kind, .. }) = + stats.equipment.main.as_ref().map(|i| &i.kind) + { + let wield_duration = kind.wield_duration(); + Wield { + time_left: wield_duration, + } + } else { + Idle + }; + } + // Don't change action + Charge { .. } | Roll { .. } => {} + }; + + // Gliding + if inputs.glide.is_pressed() && !inputs.glide.is_held_down() { + return CharacterState { + action: Idle, + movement: Glide(GlideData), + }; + } + + // Reset to Falling while not standing on ground, + // otherwise keep the state given above + if !physics.on_ground { + if physics.in_fluid { + return CharacterState { + action: new_action, + movement: Swim(SwimData), + }; + } else { + return CharacterState { + action: new_action, + movement: Fall(FallData), + }; + } + } + // On ground + else { + // Return to running or standing based on move inputs + return CharacterState { + action: new_action, + movement: if inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunData) + } else { + Stand(StandData) + }, + }; + } + } +} +impl State for GlideData { + fn handle( + &self, + _entity: &Entity, + _character: &CharacterState, + _pos: &mut Pos, + vel: &mut Vel, + ori: &mut Ori, + dt: &DeltaTime, + inputs: &ControllerInputs, + _stats: &Stats, + _body: &Body, + physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, + ) -> CharacterState { + // Move player according to move_dir + vel.0 += Vec2::broadcast(dt.0) + * inputs.move_dir + * if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) { + GLIDE_ACCEL + } else { + 0.0 + }; + + let ori_dir = Vec2::from(vel.0); + + if ori_dir.magnitude_squared() > 0.0001 + && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 + { + ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 2.0 * dt.0); + } + + // Apply Glide lift + if Vec2::::from(vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) && vel.0.z < 0.0 { + let lift = GLIDE_ANTIGRAV + vel.0.z.abs().powf(2.0) * 0.15; + vel.0.z += dt.0 + * lift + * (Vec2::::from(vel.0).magnitude() * 0.075) + .min(1.0) + .max(0.2); + } + + if !inputs.glide.is_pressed() { + return CharacterState { + action: Idle, + movement: Fall(FallData), + }; + } else if let Some(_wall_dir) = physics.on_wall { + return CharacterState { + action: Idle, + movement: Climb(ClimbData), + }; + } + + if physics.on_ground { + return CharacterState { + action: Idle, + movement: Stand(StandData), + }; + } + + return CharacterState { + action: Idle, + movement: Glide(GlideData), + }; + } +} +impl State for ClimbData { + fn handle( + &self, + _entity: &Entity, + character: &CharacterState, + _pos: &mut Pos, + vel: &mut Vel, + ori: &mut Ori, + dt: &DeltaTime, + inputs: &ControllerInputs, + _stats: &Stats, + _body: &Body, + physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, + ) -> CharacterState { + // Move player according to move_dir + vel.0 += Vec2::broadcast(dt.0) + * inputs.move_dir + * if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { + HUMANOID_CLIMB_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if let Some(wall_dir) = physics.on_wall { + if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { + Vec2::from(wall_dir).normalized() + } else { + Vec2::from(vel.0) + } + } else { + Vec2::from(vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 + { + ori.0 = vek::ops::Slerp::slerp( + ori.0, + ori_dir.into(), + if physics.on_ground { 9.0 } else { 2.0 } * dt.0, + ); + } + + // Apply Vertical Climbing Movement + if let (true, Some(_wall_dir)) = ( + (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) && vel.0.z <= CLIMB_SPEED, + physics.on_wall, + ) { + if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() { + vel.0 -= dt.0 * vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); + } else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() { + vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); + } else { + vel.0.z = vel.0.z + dt.0 * GRAVITY * 1.5; + vel.0 = Lerp::lerp( + vel.0, + Vec3::zero(), + 30.0 * dt.0 / (1.0 - vel.0.z.min(0.0) * 5.0), + ); + } + } + + if let None = physics.on_wall { + if inputs.jump.is_pressed() { + return CharacterState { + action: Idle, + movement: Jump(JumpData), + }; + } else { + return CharacterState { + action: Idle, + movement: Fall(FallData), + }; + } + } + if physics.on_ground { + return CharacterState { + action: Idle, + movement: Stand(StandData), + }; + } + + return *character; + } +} +impl State for SwimData { + fn handle( + &self, + _entity: &Entity, + character: &CharacterState, + _pos: &mut Pos, + vel: &mut Vel, + ori: &mut Ori, + dt: &DeltaTime, + inputs: &ControllerInputs, + _stats: &Stats, + _body: &Body, + physics: &PhysicsState, + _server_bus: &EventBus, + _local_bus: &EventBus, + ) -> CharacterState { + // Update velocity + vel.0 += Vec2::broadcast(dt.0) + * inputs.move_dir + * if vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { + HUMANOID_WATER_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if character.action.is_attack() || character.action.is_block() { + Vec2::from(inputs.look_dir).normalized() + } else { + Vec2::from(vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 + { + ori.0 = vek::ops::Slerp::slerp( + ori.0, + ori_dir.into(), + if physics.on_ground { 9.0 } else { 2.0 } * dt.0, + ); + } + + if inputs.jump.is_pressed() { + vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); + } + + if inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + + // Not on ground + if !physics.on_ground { + return CharacterState { + action: character.action, + movement: Swim(SwimData), + }; + } + // On ground + else { + // Return to running or standing based on move inputs + return CharacterState { + action: character.action, + movement: if inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunData) + } else { + Stand(StandData) + }, + }; + } + } +} diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index bcbb29436b..c3693dd828 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -106,131 +106,131 @@ impl<'a> System<'a> for Sys { ) .join() { - if character.movement == Run(RunData) || character.movement == Stand(StandData) { - continue; - } + // if character.movement == Run(RunData) || character.movement == Stand(StandData) { + // continue; + // } - if stats.is_dead { - continue; - } + // if stats.is_dead { + // continue; + // } - if mount.is_some() { - continue; - } + // if mount.is_some() { + // continue; + // } - let inputs = &controller.inputs; + // let inputs = &controller.inputs; - if character.action.is_roll() { - vel.0 = Vec3::new(0.0, 0.0, vel.0.z) - + (vel.0 * Vec3::new(1.0, 1.0, 0.0) - + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) - .try_normalized() - .unwrap_or_default() - * ROLL_SPEED; - } else if character.action.is_charge() { - vel.0 = Vec3::new(0.0, 0.0, vel.0.z) - + (vel.0 * Vec3::new(1.0, 1.0, 0.0) - + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) - .try_normalized() - .unwrap_or_default() - * CHARGE_SPEED; - } else if character.action.is_block() { - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * match physics.on_ground { - true if vel.0.magnitude_squared() < BLOCK_SPEED.powf(2.0) => BLOCK_ACCEL, - _ => 0.0, - } - } else { - // Move player according to move_dir - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * match (physics.on_ground, &character.movement) { - (true, Run(_)) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { - HUMANOID_ACCEL - } - (false, Climb) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { - HUMANOID_CLIMB_ACCEL - } - (false, Glide) if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) => { - GLIDE_ACCEL - } - (false, Fall) | (false, Jump) - if vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) => - { - HUMANOID_AIR_ACCEL - } - (false, Swim) - if vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) => - { - HUMANOID_WATER_ACCEL - } - _ => 0.0, - }; - } + // if character.action.is_roll() { + // vel.0 = Vec3::new(0.0, 0.0, vel.0.z) + // + (vel.0 * Vec3::new(1.0, 1.0, 0.0) + // + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) + // .try_normalized() + // .unwrap_or_default() + // * ROLL_SPEED; + // } else if character.action.is_charge() { + // vel.0 = Vec3::new(0.0, 0.0, vel.0.z) + // + (vel.0 * Vec3::new(1.0, 1.0, 0.0) + // + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) + // .try_normalized() + // .unwrap_or_default() + // * CHARGE_SPEED; + // } else if character.action.is_block() { + // vel.0 += Vec2::broadcast(dt.0) + // * inputs.move_dir + // * match physics.on_ground { + // true if vel.0.magnitude_squared() < BLOCK_SPEED.powf(2.0) => BLOCK_ACCEL, + // _ => 0.0, + // } + // } else { + // // Move player according to move_dir + // vel.0 += Vec2::broadcast(dt.0) + // * inputs.move_dir + // * match (physics.on_ground, &character.movement) { + // (true, Run(_)) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { + // HUMANOID_ACCEL + // } + // (false, Climb) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { + // HUMANOID_CLIMB_ACCEL + // } + // (false, Glide) if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) => { + // GLIDE_ACCEL + // } + // (false, Fall) | (false, Jump) + // if vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) => + // { + // HUMANOID_AIR_ACCEL + // } + // (false, Swim) + // if vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) => + // { + // HUMANOID_WATER_ACCEL + // } + // _ => 0.0, + // }; + // } - // Set direction based on move direction when on the ground - let ori_dir = if - //character.action.is_wield() || - character.action.is_attack() || character.action.is_block() { - Vec2::from(inputs.look_dir).normalized() - } else if let (Climb, Some(wall_dir)) = (character.movement, physics.on_wall) { - if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { - Vec2::from(wall_dir).normalized() - } else { - Vec2::from(vel.0) - } - } else { - Vec2::from(vel.0) - }; + // // Set direction based on move direction when on the ground + // let ori_dir = if + // //character.action.is_wield() || + // character.action.is_attack() || character.action.is_block() { + // Vec2::from(inputs.look_dir).normalized() + // } else if let (Climb, Some(wall_dir)) = (character.movement, physics.on_wall) { + // if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { + // Vec2::from(wall_dir).normalized() + // } else { + // Vec2::from(vel.0) + // } + // } else { + // Vec2::from(vel.0) + // }; - if ori_dir.magnitude_squared() > 0.0001 - && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() - > 0.001 - { - ori.0 = vek::ops::Slerp::slerp( - ori.0, - ori_dir.into(), - if physics.on_ground { 9.0 } else { 2.0 } * dt.0, - ); - } + // if ori_dir.magnitude_squared() > 0.0001 + // && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + // > 0.001 + // { + // ori.0 = vek::ops::Slerp::slerp( + // ori.0, + // ori_dir.into(), + // if physics.on_ground { 9.0 } else { 2.0 } * dt.0, + // ); + // } - // Glide - if character.movement == Glide - && Vec2::::from(vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) - && vel.0.z < 0.0 - { - let lift = GLIDE_ANTIGRAV + vel.0.z.abs().powf(2.0) * 0.15; - vel.0.z += dt.0 - * lift - * (Vec2::::from(vel.0).magnitude() * 0.075) - .min(1.0) - .max(0.2); - } + // // Glide + // if character.movement == Glide + // && Vec2::::from(vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) + // && vel.0.z < 0.0 + // { + // let lift = GLIDE_ANTIGRAV + vel.0.z.abs().powf(2.0) * 0.15; + // vel.0.z += dt.0 + // * lift + // * (Vec2::::from(vel.0).magnitude() * 0.075) + // .min(1.0) + // .max(0.2); + // } - // Climb - if let (true, Some(_wall_dir)) = ( - (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) - && vel.0.z <= CLIMB_SPEED, - physics.on_wall, - ) { - if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() { - vel.0 -= dt.0 * vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); - } else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() { - vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); - } else { - vel.0.z = vel.0.z + dt.0 * GRAVITY * 1.5; - vel.0 = Lerp::lerp( - vel.0, - Vec3::zero(), - 30.0 * dt.0 / (1.0 - vel.0.z.min(0.0) * 5.0), - ); - } - } + // // Climb + // if let (true, Some(_wall_dir)) = ( + // (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) + // && vel.0.z <= CLIMB_SPEED, + // physics.on_wall, + // ) { + // if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() { + // vel.0 -= dt.0 * vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); + // } else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() { + // vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); + // } else { + // vel.0.z = vel.0.z + dt.0 * GRAVITY * 1.5; + // vel.0 = Lerp::lerp( + // vel.0, + // Vec3::zero(), + // 30.0 * dt.0 / (1.0 - vel.0.z.min(0.0) * 5.0), + // ); + // } + // } - if character.movement == Swim && inputs.jump.is_pressed() { - vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); - } + // if character.movement == Swim && inputs.jump.is_pressed() { + // vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); + // } } } } diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 2873f2d590..af68a96313 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -160,17 +160,17 @@ impl SfxEventMapper { stats, ) { (_, ActionState::Roll { .. }, ..) => SfxEvent::Roll, - (MovementState::Climb, ..) => SfxEvent::Climb, - (MovementState::Swim, ..) => SfxEvent::Swim, + (MovementState::Climb(_), ..) => SfxEvent::Climb, + (MovementState::Swim(_), ..) => SfxEvent::Swim, (MovementState::Run(_), ..) => SfxEvent::Run, - (MovementState::Fall, _, previous_event, _) => { + (MovementState::Fall(_), _, previous_event, _) => { if previous_event != SfxEvent::Glide { SfxEvent::Fall } else { SfxEvent::GliderClose } } - (MovementState::Glide, _, previous_event, ..) => { + (MovementState::Glide(_), _, previous_event, ..) => { if previous_event != SfxEvent::GliderOpen && previous_event != SfxEvent::Glide { SfxEvent::GliderOpen } else { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 7c7319f74e..80f52b69fc 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -211,35 +211,35 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump | Fall => anim::character::JumpAnimation::update_skeleton( + Jump(_) | Fall(_) => anim::character::JumpAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Glide => anim::character::GlidingAnimation::update_skeleton( + Glide(_) => anim::character::GlidingAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, state.last_ori, time), state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Swim => anim::character::SwimAnimation::update_skeleton( + Swim(_) => anim::character::SwimAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0.magnitude(), ori.0.magnitude(), time), state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Climb => anim::character::ClimbAnimation::update_skeleton( + Climb(_) => anim::character::ClimbAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, time), state.movement_time, &mut movement_animation_rate, skeleton_attr, ), - Sit => anim::character::SitAnimation::update_skeleton( + Sit(_) => anim::character::SitAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), state.movement_time, @@ -349,7 +349,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::quadruped_small::JumpAnimation::update_skeleton( + Jump(_) => anim::quadruped_small::JumpAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -406,7 +406,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::quadruped_medium::JumpAnimation::update_skeleton( + Jump(_) => anim::quadruped_medium::JumpAnimation::update_skeleton( &QuadrupedMediumSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -461,7 +461,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::bird_medium::JumpAnimation::update_skeleton( + Jump(_) => anim::bird_medium::JumpAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -516,7 +516,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::fish_medium::JumpAnimation::update_skeleton( + Jump(_) => anim::fish_medium::JumpAnimation::update_skeleton( &FishMediumSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -571,7 +571,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::dragon::JumpAnimation::update_skeleton( + Jump(_) => anim::dragon::JumpAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -626,7 +626,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::bird_small::JumpAnimation::update_skeleton( + Jump(_) => anim::bird_small::JumpAnimation::update_skeleton( &BirdSmallSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -681,7 +681,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::fish_small::JumpAnimation::update_skeleton( + Jump(_) => anim::fish_small::JumpAnimation::update_skeleton( &FishSmallSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, @@ -736,7 +736,7 @@ impl FigureMgr { &mut movement_animation_rate, skeleton_attr, ), - Jump => anim::biped_large::JumpAnimation::update_skeleton( + Jump(_) => anim::biped_large::JumpAnimation::update_skeleton( &BipedLargeSkeleton::new(), (vel.0.magnitude(), time), state.movement_time, From 8e0317e03dc0c10aebdd460dd3978161ce683a1a Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Thu, 26 Dec 2019 06:43:59 -0800 Subject: [PATCH 005/387] refactor states to handle update logic --- common/src/comp/character_state.rs | 222 +++-- common/src/comp/mod.rs | 6 +- common/src/comp/states/basic_attack.rs | 19 + common/src/comp/states/basic_block.rs | 19 + common/src/comp/states/charge_attack.rs | 86 ++ common/src/comp/states/climb.rs | 100 +++ common/src/comp/states/fall.rs | 89 ++ common/src/comp/states/glide.rs | 87 ++ common/src/comp/states/jump.rs | 28 + common/src/comp/states/mod.rs | 104 +++ common/src/comp/states/roll.rs | 19 + common/src/comp/states/run.rs | 139 +++ common/src/comp/states/sit.rs | 76 ++ common/src/comp/states/stand.rs | 120 +++ common/src/comp/states/swim.rs | 85 ++ common/src/comp/states/wield.rs | 51 ++ common/src/msg/ecs_packet.rs | 6 + common/src/state.rs | 3 + common/src/sys/agent.rs | 6 +- common/src/sys/character_state.rs | 1071 ++--------------------- common/src/sys/combat.rs | 212 ++--- common/src/sys/controller.rs | 13 +- common/src/sys/mod.rs | 5 +- common/src/sys/movement.rs | 6 +- voxygen/src/audio/sfx/event_mapper.rs | 68 +- voxygen/src/scene/figure/cache.rs | 18 +- voxygen/src/scene/figure/mod.rs | 252 +++--- voxygen/src/scene/mod.rs | 2 +- voxygen/src/session.rs | 6 +- 29 files changed, 1525 insertions(+), 1393 deletions(-) create mode 100644 common/src/comp/states/basic_attack.rs create mode 100644 common/src/comp/states/basic_block.rs create mode 100644 common/src/comp/states/charge_attack.rs create mode 100644 common/src/comp/states/climb.rs create mode 100644 common/src/comp/states/fall.rs create mode 100644 common/src/comp/states/glide.rs create mode 100644 common/src/comp/states/jump.rs create mode 100644 common/src/comp/states/mod.rs create mode 100644 common/src/comp/states/roll.rs create mode 100644 common/src/comp/states/run.rs create mode 100644 common/src/comp/states/sit.rs create mode 100644 common/src/comp/states/stand.rs create mode 100644 common/src/comp/states/swim.rs create mode 100644 common/src/comp/states/wield.rs diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 91f336c3a4..5b6cc3ba49 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,109 +1,121 @@ -use crate::comp::{Body, Controller, ControllerInputs, ItemKind, PhysicsState, Stats}; -use specs::{Component, FlaggedStorage, HashMapStorage}; -use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System}; -use sphynx::{Uid, UidAllocator}; -//use specs_idvs::IDVStorage; -use self::{ActionState::*, MovementState::*}; +use self::ActionState::*; +use super::states::*; +use crate::{ + comp::{Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, + event::{EventBus, LocalEvent, ServerEvent}, + state::DeltaTime, +}; +use specs::LazyUpdate; +use specs::{Component, Entity, FlaggedStorage, HashMapStorage, NullStorage}; +use sphynx::Uid; use std::time::Duration; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct RunData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct StandData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct SitData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct JumpData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct FallData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct GlideData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct SwimData; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct ClimbData; +pub struct ECSStateData<'a> { + pub entity: &'a Entity, + pub uid: &'a Uid, + pub character: &'a CharacterState, + pub pos: &'a Pos, + pub vel: &'a Vel, + pub ori: &'a Ori, + pub dt: &'a DeltaTime, + pub inputs: &'a ControllerInputs, + pub stats: &'a Stats, + pub body: &'a Body, + pub physics: &'a PhysicsState, + pub updater: &'a LazyUpdate, + pub server_bus: &'a EventBus, + pub local_bus: &'a EventBus, +} + +pub struct ECSStateUpdate { + pub character: CharacterState, + pub pos: Pos, + pub vel: Vel, + pub ori: Ori, +} #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum MovementState { - Stand(StandData), - Run(RunData), - Sit(SitData), - Jump(JumpData), - Fall(FallData), - Glide(GlideData), - Swim(SwimData), - Climb(ClimbData), +pub enum MoveState { + Stand(StandHandler), + Run(RunHandler), + Sit(SitHandler), + Jump(JumpHandler), + Fall(FallHandler), + Glide(GlideHandler), + Swim(SwimHandler), + Climb(ClimbHandler), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum ActionState { Idle, - Wield { - time_left: Duration, - }, - Attack { - time_left: Duration, - applied: bool, - }, - Block { - time_active: Duration, - }, - Roll { - time_left: Duration, - // Whether character was wielding before they started roll - was_wielding: bool, - }, - Charge { - time_left: Duration, - }, - // Handle(CharacterAction), + Wield(WieldHandler), + Attack(AttackKind), + Block(BlockKind), + Dodge(DodgeKind), + // Interact, +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub enum AttackKind { + BasicAttack(BasicAttackHandler), + Charge(ChargeAttackHandler), +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub enum BlockKind { + BasicBlock(BasicBlockHandler), +} + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub enum DodgeKind { + Roll(RollHandler), } impl ActionState { - pub fn is_wield(&self) -> bool { - if let Self::Wield { .. } = self { - true - } else { - false - } - } - - pub fn is_action_finished(&self) -> bool { + pub fn is_equip_finished(&self) -> bool { match self { - Self::Wield { time_left } - | Self::Attack { time_left, .. } - | Self::Roll { time_left, .. } - | Self::Charge { time_left } => *time_left == Duration::default(), - Self::Idle | Self::Block { .. } => false, + Wield(WieldHandler { equip_delay }) => *equip_delay == Duration::default(), + _ => true, + } + } + pub fn get_delay(&self) -> Duration { + match self { + Wield(WieldHandler { equip_delay }) => *equip_delay, + _ => Duration::default(), } } - pub fn is_attack(&self) -> bool { - if let Self::Attack { .. } = self { + pub fn is_attacking(&self) -> bool { + match self { + Block(_) => true, + _ => false, + } + } + + pub fn is_blocking(&self) -> bool { + match self { + Attack(_) => true, + _ => false, + } + } + + pub fn is_dodging(&self) -> bool { + match self { + Dodge(_) => true, + _ => false, + } + } + + pub fn is_wielding(&self) -> bool { + if let Wield(_) = self { true } else { false } } - - pub fn is_block(&self) -> bool { - if let Self::Block { .. } = self { - true - } else { - false - } - } - - pub fn is_roll(&self) -> bool { - if let Self::Roll { .. } = self { - true - } else { - false - } - } - - pub fn is_charge(&self) -> bool { - if let Self::Charge { .. } = self { + pub fn is_idling(&self) -> bool { + if let Idle = self { true } else { false @@ -113,29 +125,29 @@ impl ActionState { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct CharacterState { - pub movement: MovementState, - pub action: ActionState, + pub move_state: MoveState, + pub action_state: ActionState, } impl CharacterState { - pub fn is_same_movement(&self, other: &Self) -> bool { - // Check if enum item is the same without looking at the inner data - std::mem::discriminant(&self.movement) == std::mem::discriminant(&other.movement) + pub fn is_same_move_state(&self, other: &Self) -> bool { + // Check if state is the same without looking at the inner data + std::mem::discriminant(&self.move_state) == std::mem::discriminant(&other.move_state) } - pub fn is_same_action(&self, other: &Self) -> bool { - // Check if enum item is the same without looking at the inner data - std::mem::discriminant(&self.action) == std::mem::discriminant(&other.action) + pub fn is_same_action_state(&self, other: &Self) -> bool { + // Check if state is the same without looking at the inner data + std::mem::discriminant(&self.action_state) == std::mem::discriminant(&other.action_state) } pub fn is_same_state(&self, other: &Self) -> bool { - self.is_same_movement(other) && self.is_same_action(other) + self.is_same_move_state(other) && self.is_same_action_state(other) } } impl Default for CharacterState { fn default() -> Self { Self { - movement: MovementState::Fall(FallData), - action: ActionState::Idle, + move_state: MoveState::Fall(FallHandler), + action_state: ActionState::Idle, } } } @@ -143,3 +155,21 @@ impl Default for CharacterState { impl Component for CharacterState { type Storage = FlaggedStorage>; } + +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct OverrideState; +impl Component for OverrideState { + type Storage = FlaggedStorage>; +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct OverrideAction; +impl Component for OverrideAction { + type Storage = FlaggedStorage>; +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct OverrideMove; +impl Component for OverrideMove { + type Storage = FlaggedStorage>; +} diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 1f2e894539..2acf89e6b5 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -10,6 +10,7 @@ mod location; mod phys; mod player; pub mod projectile; +mod states; mod stats; mod visual; @@ -21,8 +22,8 @@ pub use body::{ quadruped_medium, quadruped_small, Body, }; pub use character_state::{ - ActionState, CharacterState, ClimbData, FallData, GlideData, JumpData, MovementState, RunData, - SitData, StandData, SwimData, + ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, ECSStateData, ECSStateUpdate, + MoveState, OverrideAction, OverrideMove, OverrideState, }; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, @@ -35,5 +36,6 @@ pub use location::Waypoint; pub use phys::{ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; pub use player::Player; pub use projectile::Projectile; +pub use states::*; pub use stats::{Equipment, Exp, HealthChange, HealthSource, Level, Stats}; pub use visual::LightEmitter; diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs new file mode 100644 index 0000000000..56dd8872d2 --- /dev/null +++ b/common/src/comp/states/basic_attack.rs @@ -0,0 +1,19 @@ +use super::{ECSStateData, ECSStateUpdate, StateHandle}; +use std::time::Duration; + +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct BasicAttackHandler { + /// How long the state has until exitting + remaining_duration: Duration, +} + +impl StateHandle for BasicAttackHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + return ECSStateUpdate { + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + character: *ecs_data.character, + }; + } +} diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs new file mode 100644 index 0000000000..038d30be14 --- /dev/null +++ b/common/src/comp/states/basic_block.rs @@ -0,0 +1,19 @@ +use super::{ECSStateData, ECSStateUpdate, StateHandle}; +use std::time::Duration; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct BasicBlockHandler { + /// How long the blocking state has been active + active_duration: Duration, +} + +impl StateHandle for BasicBlockHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + return ECSStateUpdate { + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + character: *ecs_data.character, + }; + } +} diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs new file mode 100644 index 0000000000..8caec5b33e --- /dev/null +++ b/common/src/comp/states/charge_attack.rs @@ -0,0 +1,86 @@ +use super::{ + CharacterState, ECSStateData, ECSStateUpdate, MoveState::Run, RunHandler, Stand, StandHandler, + StateHandle, WieldHandler, +}; +use crate::comp::{ + ActionState::{Attack, Idle, Wield}, + AttackKind::Charge, + HealthChange, HealthSource, + ItemKind::Tool, +}; +use crate::event::ServerEvent; +use std::time::Duration; + +use super::TEMP_EQUIP_DELAY; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct ChargeAttackHandler { + /// How long the state has until exitting + pub remaining_duration: Duration, +} + +impl StateHandle for ChargeAttackHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + character: *ecs_data.character, + }; + + if let Some(uid_b) = ecs_data.physics.touch_entity { + ecs_data.server_bus.emitter().emit(ServerEvent::Damage { + uid: uid_b, + change: HealthChange { + amount: -20, + cause: HealthSource::Attack { by: *ecs_data.uid }, + }, + }); + + update.character = CharacterState { + move_state: Stand(StandHandler), + action_state: if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle + }, + }; + + return update; + } + + if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 + { + update.character = CharacterState { + move_state: Stand(StandHandler), + action_state: if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle + }, + }; + + return update; + } + + update.character = CharacterState { + move_state: Run(RunHandler), + action_state: Attack(Charge(ChargeAttackHandler { + remaining_duration: self + .remaining_duration + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(), + })), + }; + + return update; + } +} diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs new file mode 100644 index 0000000000..cc915f60dd --- /dev/null +++ b/common/src/comp/states/climb.rs @@ -0,0 +1,100 @@ +use super::{ + ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, FallHandler, JumpHandler, + MoveState::*, StandHandler, StateHandle, +}; +use super::{CLIMB_SPEED, HUMANOID_CLIMB_ACCEL, HUMANOID_SPEED}; +use crate::sys::phys::GRAVITY; +use vek::vec::{Vec2, Vec3}; +use vek::Lerp; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct ClimbHandler; + +impl StateHandle for ClimbHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + character: *ecs_data.character, + }; + + // Move player according to move_dir + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { + HUMANOID_CLIMB_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if let Some(wall_dir) = ecs_data.physics.on_wall { + if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { + Vec2::from(wall_dir).normalized() + } else { + Vec2::from(update.vel.0) + } + } else { + Vec2::from(update.vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = vek::ops::Slerp::slerp( + update.ori.0, + ori_dir.into(), + if ecs_data.physics.on_ground { 9.0 } else { 2.0 } * ecs_data.dt.0, + ); + } + + // Apply Vertical Climbing Movement + if let (true, Some(_wall_dir)) = ( + (ecs_data.inputs.climb.is_pressed() | ecs_data.inputs.climb_down.is_pressed()) + && update.vel.0.z <= CLIMB_SPEED, + ecs_data.physics.on_wall, + ) { + if ecs_data.inputs.climb_down.is_pressed() && !ecs_data.inputs.climb.is_pressed() { + update.vel.0 -= + ecs_data.dt.0 * update.vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); + } else if ecs_data.inputs.climb.is_pressed() && !ecs_data.inputs.climb_down.is_pressed() + { + update.vel.0.z = (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); + } else { + update.vel.0.z = update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.5; + update.vel.0 = Lerp::lerp( + update.vel.0, + Vec3::zero(), + 30.0 * ecs_data.dt.0 / (1.0 - update.vel.0.z.min(0.0) * 5.0), + ); + } + } + + if let None = ecs_data.physics.on_wall { + if ecs_data.inputs.jump.is_pressed() { + update.character = CharacterState { + action_state: Idle, + move_state: Jump(JumpHandler), + }; + return update; + } else { + update.character = CharacterState { + action_state: Idle, + move_state: Fall(FallHandler), + }; + return update; + } + } + if ecs_data.physics.on_ground { + update.character = CharacterState { + action_state: Idle, + move_state: Stand(StandHandler), + }; + return update; + } + + return update; + } +} diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs new file mode 100644 index 0000000000..8a5c30dcc1 --- /dev/null +++ b/common/src/comp/states/fall.rs @@ -0,0 +1,89 @@ +use super::{ + ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, GlideHandler, MoveState::*, + RunHandler, StandHandler, StateHandle, SwimHandler, +}; +use super::{HUMANOID_AIR_ACCEL, HUMANOID_AIR_SPEED}; +use vek::{Vec2, Vec3}; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct FallHandler; + +impl StateHandle for FallHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + character: *ecs_data.character, + }; + + // Move player according to movement direction vector + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * if update.vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) { + HUMANOID_AIR_ACCEL + } else { + 0.0 + }; + + // Set orientation vector based on direction of movement when on the ground + let ori_dir = if update.character.action_state.is_attacking() + || update.character.action_state.is_blocking() + { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = + vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 2.0 * ecs_data.dt.0); + } + + // Check gliding + if ecs_data.inputs.glide.is_pressed() && !ecs_data.inputs.glide.is_held_down() { + update.character = CharacterState { + action_state: Idle, + move_state: Glide(GlideHandler), + }; + + return update; + } + + // Not on ground, go to swim or fall + if !ecs_data.physics.on_ground { + // Check if in fluid to go to swimming or back to falling + if ecs_data.physics.in_fluid { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Swim(SwimHandler), + }; + + return update; + } else { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Fall(FallHandler), + }; + + return update; + } + } + // On ground + else { + // Return to running or standing based on move inputs + update.character = CharacterState { + action_state: update.character.action_state, + move_state: if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunHandler) + } else { + Stand(StandHandler) + }, + }; + + return update; + } + } +} diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs new file mode 100644 index 0000000000..8511d4c469 --- /dev/null +++ b/common/src/comp/states/glide.rs @@ -0,0 +1,87 @@ +use super::{ + ActionState::*, CharacterState, ClimbHandler, ECSStateData, ECSStateUpdate, FallHandler, + MoveState::*, StandHandler, StateHandle, +}; +use super::{GLIDE_ACCEL, GLIDE_ANTIGRAV, GLIDE_SPEED}; +use vek::{Vec2, Vec3}; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct GlideHandler; + +impl StateHandle for GlideHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + character: *ecs_data.character, + }; + + // Move player according to movement direction vector + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * if ecs_data.vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) { + GLIDE_ACCEL + } else { + 0.0 + }; + + // Determine orientation vector from movement direction vector + let ori_dir = Vec2::from(update.vel.0); + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = + vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 2.0 * ecs_data.dt.0); + } + + // Apply Glide lift + if Vec2::::from(update.vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) + && update.vel.0.z < 0.0 + { + let lift = GLIDE_ANTIGRAV + update.vel.0.z.abs().powf(2.0) * 0.15; + update.vel.0.z += ecs_data.dt.0 + * lift + * (Vec2::::from(update.vel.0).magnitude() * 0.075) + .min(1.0) + .max(0.2); + } + + // If glide button isn't held + if !ecs_data.inputs.glide.is_pressed() { + update.character = CharacterState { + action_state: Idle, + move_state: Fall(FallHandler), + }; + + return update; + } + // If there is a wall in front of character go to climb + else if let Some(_wall_dir) = ecs_data.physics.on_wall { + update.character = CharacterState { + action_state: Idle, + move_state: Climb(ClimbHandler), + }; + + return update; + } + // If on ground go to stand + if ecs_data.physics.on_ground { + update.character = CharacterState { + action_state: Idle, + move_state: Stand(StandHandler), + }; + + return update; + } + + // Otherwise keep gliding + update.character = CharacterState { + action_state: Idle, + move_state: Glide(GlideHandler), + }; + + return update; + } +} diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs new file mode 100644 index 0000000000..0f48e33c92 --- /dev/null +++ b/common/src/comp/states/jump.rs @@ -0,0 +1,28 @@ +use super::{CharacterState, ECSStateData, ECSStateUpdate, FallHandler, MoveState::*, StateHandle}; +use crate::event::LocalEvent; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct JumpHandler; + +impl StateHandle for JumpHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + ecs_data + .local_bus + .emitter() + .emit(LocalEvent::Jump(*ecs_data.entity)); + + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Fall(FallHandler), + }; + + return update; + } +} diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs new file mode 100644 index 0000000000..77e32be07a --- /dev/null +++ b/common/src/comp/states/mod.rs @@ -0,0 +1,104 @@ +// Module declarations +mod basic_attack; +mod basic_block; +mod charge_attack; +mod climb; +mod fall; +mod glide; +mod jump; +mod roll; +mod run; +mod sit; +mod stand; +mod swim; +mod wield; + +// Reexports +pub use basic_attack::*; +pub use basic_block::*; +pub use charge_attack::*; +pub use climb::*; +pub use fall::*; +pub use glide::*; +pub use jump::*; +pub use roll::*; +pub use run::*; +pub use sit::*; +pub use stand::*; +pub use swim::*; +pub use wield::*; + +// TODO: Attach these to racial components and/or ecs resources +pub const HUMANOID_ACCEL: f32 = 50.0; +pub const HUMANOID_SPEED: f32 = 120.0; +pub const HUMANOID_AIR_ACCEL: f32 = 10.0; +pub const HUMANOID_AIR_SPEED: f32 = 100.0; +pub const HUMANOID_WATER_ACCEL: f32 = 70.0; +pub const HUMANOID_WATER_SPEED: f32 = 120.0; +pub const HUMANOID_CLIMB_ACCEL: f32 = 5.0; +pub const ROLL_SPEED: f32 = 17.0; +pub const CHARGE_SPEED: f32 = 20.0; +pub const GLIDE_ACCEL: f32 = 15.0; +pub const GLIDE_SPEED: f32 = 45.0; +pub const BLOCK_ACCEL: f32 = 30.0; +pub const BLOCK_SPEED: f32 = 75.0; +pub const TEMP_EQUIP_DELAY: u64 = 100; +// Gravity is 9.81 * 4, so this makes gravity equal to .15 +pub const GLIDE_ANTIGRAV: f32 = crate::sys::phys::GRAVITY * 0.96; +pub const CLIMB_SPEED: f32 = 5.0; +pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; + +// Public interface, wires character states to their handlers. +use super::{ + ActionState, ActionState::*, AttackKind::*, BlockKind::*, CharacterState, DodgeKind::*, + ECSStateData, ECSStateUpdate, MoveState, MoveState::*, +}; + +pub trait StateHandle { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate; +} + +impl StateHandle for ActionState { + /// Passes handle to variant or subvariant handlers + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + match self { + Attack(kind) => match kind { + BasicAttack(handler) => handler.handle(ecs_data), + Charge(handler) => handler.handle(ecs_data), + }, + Block(kind) => match kind { + BasicBlock(handler) => handler.handle(ecs_data), + }, + Dodge(kind) => match kind { + Roll(handler) => handler.handle(ecs_data), + }, + Wield(handler) => handler.handle(ecs_data), + Idle => ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }, + // All states should be explicitly handled + // Do not use default match: _ => {}, + } + } +} + +impl StateHandle for MoveState { + /// Passes handle to variant handlers + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + match self { + Stand(handler) => handler.handle(&ecs_data), + Run(handler) => handler.handle(&ecs_data), + Jump(handler) => handler.handle(&ecs_data), + Climb(handler) => handler.handle(&ecs_data), + Glide(handler) => handler.handle(&ecs_data), + Swim(handler) => handler.handle(&ecs_data), + Fall(handler) => handler.handle(&ecs_data), + Sit(handler) => handler.handle(&ecs_data), + // All states should be explicitly handled + // Do not use default match: _ => {}, + } + } +} diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs new file mode 100644 index 0000000000..2759a10653 --- /dev/null +++ b/common/src/comp/states/roll.rs @@ -0,0 +1,19 @@ +use super::{ECSStateData, ECSStateUpdate, StateHandle}; +use std::time::Duration; + +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct RollHandler { + /// How long the state has until exitting + remaining_duration: Duration, +} + +impl StateHandle for RollHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + } + } +} diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs new file mode 100644 index 0000000000..80ee1f0c5d --- /dev/null +++ b/common/src/comp/states/run.rs @@ -0,0 +1,139 @@ +use super::{ + ActionState::*, CharacterState, ClimbHandler, ECSStateData, ECSStateUpdate, FallHandler, + GlideHandler, JumpHandler, MoveState::*, SitHandler, StandHandler, StateHandle, SwimHandler, +}; +use super::{HUMANOID_ACCEL, HUMANOID_SPEED}; +use vek::vec::{Vec2, Vec3}; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct RunHandler; + +impl StateHandle for RunHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + // Move player according to move_dir + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { + HUMANOID_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if update.character.action_state.is_attacking() + || update.character.action_state.is_blocking() + { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = + vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * ecs_data.dt.0); + } + + // Try to sit + if ecs_data.inputs.sit.is_pressed() + && ecs_data.physics.on_ground + && ecs_data.body.is_humanoid() + { + update.character = CharacterState { + action_state: Idle, + move_state: Sit(SitHandler), + }; + + return update; + } + + // Try to climb + if let (true, Some(_wall_dir)) = ( + ecs_data.inputs.climb.is_pressed() | ecs_data.inputs.climb_down.is_pressed() + && ecs_data.body.is_humanoid(), + ecs_data.physics.on_wall, + ) { + update.character = CharacterState { + action_state: Idle, + move_state: Climb(ClimbHandler), + }; + + return update; + } + + // Try to swim + if !ecs_data.physics.on_ground && ecs_data.physics.in_fluid { + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Swim(SwimHandler), + }; + + return update; + } + + // While on ground ... + if ecs_data.physics.on_ground { + // Try to jump + if ecs_data.inputs.jump.is_pressed() && !ecs_data.inputs.jump.is_held_down() { + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Jump(JumpHandler), + }; + + return update; + } + + // Try to dodge + if ecs_data.inputs.roll.is_pressed() && ecs_data.body.is_humanoid() { + // updater.insert(entity, DodgeStart); + } + } + // While not on ground ... + else { + // Try to glide + if ecs_data.physics.on_wall == None + && ecs_data.inputs.glide.is_pressed() + && !ecs_data.inputs.glide.is_held_down() + && ecs_data.body.is_humanoid() + { + update.character = CharacterState { + action_state: Idle, + move_state: Glide(GlideHandler), + }; + + return update; + } + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Fall(FallHandler), + }; + + return update; + } + + if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Run(RunHandler), + }; + + return update; + } else { + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Stand(StandHandler), + }; + + return update; + } + } +} diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs new file mode 100644 index 0000000000..5634b1fb21 --- /dev/null +++ b/common/src/comp/states/sit.rs @@ -0,0 +1,76 @@ +use super::{ + ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, FallHandler, JumpHandler, + MoveState::*, RunHandler, StandHandler, StateHandle, SwimHandler, +}; +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct SitHandler; + +impl StateHandle for SitHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + // Falling + // Idk, maybe the ground disappears, + // suddenly maybe a water spell appears. + // Can't hurt to be safe :shrug: + if !ecs_data.physics.on_ground { + if ecs_data.physics.in_fluid { + update.character = CharacterState { + action_state: Idle, + move_state: Swim(SwimHandler), + }; + + return update; + } else { + update.character = CharacterState { + action_state: Idle, + move_state: Fall(FallHandler), + }; + + return update; + } + } + // Jumping + if ecs_data.inputs.jump.is_pressed() { + update.character = CharacterState { + action_state: Idle, + move_state: Jump(JumpHandler), + }; + + return update; + } + + // Moving + if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + update.character = CharacterState { + action_state: Idle, + move_state: Run(RunHandler), + }; + + return update; + } + + // Standing back up (unsitting) + if ecs_data.inputs.sit.is_just_pressed() { + update.character = CharacterState { + action_state: Idle, + move_state: Stand(StandHandler), + }; + + return update; + } + + // no move_state has occurred + update.character = CharacterState { + action_state: Idle, + move_state: Sit(SitHandler), + }; + + return update; + } +} diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs new file mode 100644 index 0000000000..fb42b04f12 --- /dev/null +++ b/common/src/comp/states/stand.rs @@ -0,0 +1,120 @@ +use super::{ + ActionState::*, CharacterState, ClimbHandler, ECSStateData, ECSStateUpdate, FallHandler, + GlideHandler, JumpHandler, MoveState::*, RunHandler, SitHandler, StateHandle, SwimHandler, +}; +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct StandHandler; + +impl StateHandle for StandHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + // Try to sit + if ecs_data.inputs.sit.is_pressed() + && ecs_data.physics.on_ground + && ecs_data.body.is_humanoid() + { + update.character = CharacterState { + move_state: Sit(SitHandler), + action_state: update.character.action_state, + }; + + return update; + } + + // Try to climb + if let (true, Some(_wall_dir)) = ( + ecs_data.inputs.climb.is_pressed() | ecs_data.inputs.climb_down.is_pressed() + && ecs_data.body.is_humanoid(), + ecs_data.physics.on_wall, + ) { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Climb(ClimbHandler), + }; + + return update; + } + + // Try to swim + if !ecs_data.physics.on_ground && ecs_data.physics.in_fluid { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Swim(SwimHandler), + }; + + return update; + } + + // While on ground ... + if ecs_data.physics.on_ground { + // Try to jump + if ecs_data.inputs.jump.is_pressed() { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Jump(JumpHandler), + }; + + return update; + } + + // // Try to charge + // if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { + // } + + // Try to roll + if ecs_data.inputs.roll.is_pressed() && ecs_data.body.is_humanoid() { + // updater.insert(entity, DodgeStart); + } + } + // While not on ground ... + else { + // Try to glide + if ecs_data.physics.on_wall == None + && ecs_data.inputs.glide.is_pressed() + && !ecs_data.inputs.glide.is_held_down() + && ecs_data.body.is_humanoid() + { + update.character = CharacterState { + action_state: Idle, + move_state: Glide(GlideHandler), + }; + + return update; + } + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Fall(FallHandler), + }; + + return update; + } + + if ecs_data.inputs.primary.is_pressed() { + // updater.insert(entity, PrimaryStart); + } else if ecs_data.inputs.secondary.is_pressed() { + // updater.insert(entity, SecondaryStart); + } + + if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Run(RunHandler), + }; + + return update; + } else { + update.character = CharacterState { + action_state: update.character.action_state, + move_state: Stand(StandHandler), + }; + + return update; + } + } +} diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs new file mode 100644 index 0000000000..2a864c0a38 --- /dev/null +++ b/common/src/comp/states/swim.rs @@ -0,0 +1,85 @@ +use super::{ + CharacterState, ECSStateData, ECSStateUpdate, MoveState::*, RunHandler, StandHandler, + StateHandle, +}; +use super::{HUMANOID_WATER_ACCEL, HUMANOID_WATER_SPEED}; +use crate::sys::phys::GRAVITY; +use vek::{Vec2, Vec3}; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct SwimHandler; + +impl StateHandle for SwimHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + // Update velocity + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * if update.vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { + HUMANOID_WATER_ACCEL + } else { + 0.0 + }; + + // Set direction based on move direction when on the ground + let ori_dir = if update.character.action_state.is_attacking() + || update.character.action_state.is_blocking() + { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = vek::ops::Slerp::slerp( + update.ori.0, + ori_dir.into(), + if ecs_data.physics.on_ground { 9.0 } else { 2.0 } * ecs_data.dt.0, + ); + } + + if ecs_data.inputs.jump.is_pressed() { + update.vel.0.z = + (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); + } + + if ecs_data.inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if ecs_data.inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + + // Not on ground + if !ecs_data.physics.on_ground { + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: Swim(SwimHandler), + }; + + return update; + } + // On ground + else { + // Return to running or standing based on move inputs + update.character = CharacterState { + action_state: ecs_data.character.action_state, + move_state: if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunHandler) + } else { + Stand(StandHandler) + }, + }; + + return update; + } + } +} diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs new file mode 100644 index 0000000000..a0e55ee56f --- /dev/null +++ b/common/src/comp/states/wield.rs @@ -0,0 +1,51 @@ +use super::{ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, StateHandle}; +use std::time::Duration; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct WieldHandler { + /// How long before a new action can be performed + /// after equipping + pub equip_delay: Duration, +} + +impl StateHandle for WieldHandler { + fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + let mut update = ECSStateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + // Toggling Weapons + if ecs_data.inputs.toggle_wield.is_pressed() + && ecs_data.character.action_state.is_equip_finished() + { + update.character = CharacterState { + action_state: Idle, + move_state: ecs_data.character.move_state, + }; + + return update; + } + + if ecs_data.inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if ecs_data.inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } + + // Update wield delay + update.character = CharacterState { + action_state: Wield(WieldHandler { + equip_delay: self + .equip_delay + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(), + }), + move_state: ecs_data.character.move_state, + }; + + return update; + } +} diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 70f24e228c..7f4a4f792b 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -33,6 +33,9 @@ sphynx::sum_type! { Projectile(comp::Projectile), Gravity(comp::Gravity), Sticky(comp::Sticky), + OverrideAction(comp::OverrideAction), + OverrideMove(comp::OverrideMove), + OverrideState(comp::OverrideState), } } // Automatically derive From for EcsCompPhantom @@ -56,6 +59,9 @@ sphynx::sum_type! { Projectile(PhantomData), Gravity(PhantomData), Sticky(PhantomData), + OverrideAction(PhantomData), + OverrideMove(PhantomData), + OverrideState(PhantomData), } } impl sphynx::CompPacket for EcsCompPacket { diff --git a/common/src/state.rs b/common/src/state.rs index 9a3b5cd9ee..b3aa25af8e 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -136,6 +136,9 @@ impl State { ecs.register_synced::(); ecs.register_synced::(); ecs.register_synced::(); + ecs.register_synced::(); + ecs.register_synced::(); + ecs.register_synced::(); // Register components send from clients -> server ecs.register::(); diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index f0df4a9e0d..a99e904b71 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,6 @@ use crate::comp::{ - Agent, CharacterState, Controller, ControllerInputs, GlideData, MountState, - MovementState::Glide, Pos, Stats, + Agent, CharacterState, Controller, ControllerInputs, GlideHandler, MountState, + MoveState::Glide, Pos, SitHandler, Stats, }; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; @@ -163,7 +163,7 @@ impl<'a> System<'a> for Sys { inputs.roll.set_state(true); } - if target_character.movement == Glide(GlideData) + if target_character.move_state == Glide(GlideHandler) && target_pos.0.z > pos.0.z + 5.0 { inputs.glide.set_state(true); diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 716ddacf46..ab1c754aaf 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,45 +1,17 @@ -use super::movement::ROLL_DURATION; -use super::phys::GRAVITY; - -const HUMANOID_ACCEL: f32 = 50.0; -const HUMANOID_SPEED: f32 = 120.0; -const HUMANOID_AIR_ACCEL: f32 = 10.0; -const HUMANOID_AIR_SPEED: f32 = 100.0; -const HUMANOID_WATER_ACCEL: f32 = 70.0; -const HUMANOID_WATER_SPEED: f32 = 120.0; -const HUMANOID_CLIMB_ACCEL: f32 = 5.0; -const ROLL_SPEED: f32 = 17.0; -const CHARGE_SPEED: f32 = 20.0; -const GLIDE_ACCEL: f32 = 15.0; -const GLIDE_SPEED: f32 = 45.0; -const BLOCK_ACCEL: f32 = 30.0; -const BLOCK_SPEED: f32 = 75.0; -// Gravity is 9.81 * 4, so this makes gravity equal to .15 -const GLIDE_ANTIGRAV: f32 = GRAVITY * 0.96; -const CLIMB_SPEED: f32 = 5.0; - -pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; use crate::{ comp::{ - self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ClimbData, - ControlEvent, Controller, ControllerInputs, FallData, GlideData, HealthChange, - HealthSource, ItemKind, JumpData, Mounting, MovementState, MovementState::*, Ori, - PhysicsState, Pos, Projectile, RunData, SitData, StandData, Stats, SwimData, Vel, + Body, CharacterState, Controller, ControllerInputs, ECSStateData, Mounting, MoveState::*, + Ori, OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitHandler, + StateHandle, Stats, Vel, }, - event::{Emitter, EventBus, LocalEvent, ServerEvent}, + event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, }; -use specs::{ - saveload::{Marker, MarkerAllocator}, - Entities, Entity, Join, Read, ReadStorage, System, WriteStorage, -}; + +use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; use sphynx::{Uid, UidAllocator}; -use std::time::Duration; -use vek::*; -struct CharacterStateData(); - -/// # Character State System +/// # Character StateHandle System /// #### Updates then detemrines next Character States based on ControllerInputs pub struct Sys; @@ -50,6 +22,7 @@ impl<'a> System<'a> for Sys { Read<'a, EventBus>, Read<'a, EventBus>, Read<'a, DeltaTime>, + Read<'a, LazyUpdate>, WriteStorage<'a, CharacterState>, WriteStorage<'a, Pos>, WriteStorage<'a, Vel>, @@ -60,6 +33,9 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, PhysicsState>, ReadStorage<'a, Uid>, ReadStorage<'a, Mounting>, + ReadStorage<'a, OverrideState>, + ReadStorage<'a, OverrideMove>, + ReadStorage<'a, OverrideAction>, ); fn run( &mut self, @@ -69,6 +45,7 @@ impl<'a> System<'a> for Sys { server_bus, local_bus, dt, + updater, mut character_states, mut positions, mut velocities, @@ -79,6 +56,9 @@ impl<'a> System<'a> for Sys { physics_states, uids, mountings, + state_overrides, + move_overrides, + action_overrides, ): Self::SystemData, ) { for ( @@ -92,7 +72,10 @@ impl<'a> System<'a> for Sys { stats, body, physics, - mount, + maybe_mount, + maybe_move_override, + maybe_action_override, + (), ) in ( &entities, &uids, @@ -105,33 +88,13 @@ impl<'a> System<'a> for Sys { &bodies, &physics_states, mountings.maybe(), + move_overrides.maybe(), + action_overrides.maybe(), + !&state_overrides, ) .join() { let inputs = &controller.inputs; - // println!("{:?}", character); - // Returns a Wield action, or Idle if nothing to wield - let try_wield = |stats: &Stats| -> ActionState { - // Get weapon to wield - if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - } - }; - - let get_state_from_move_dir = |move_dir: &Vec2| -> MovementState { - if move_dir.magnitude_squared() > 0.0 { - Run(RunData) - } else { - Stand(StandData) - } - }; // Being dead overrides all other states if stats.is_dead { @@ -145,963 +108,79 @@ impl<'a> System<'a> for Sys { continue; } // If mounted, character state is controlled by mount - // TODO: Make mounting a state - if mount.is_some() { - character.movement = Sit(SitData); + // TODO: Make mounting a stater + if maybe_mount.is_some() { + character.move_state = Sit(SitHandler); continue; } - // Update Action States - match character.action { - Attack { - ref mut time_left, .. - } => { - *time_left = time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - } - Roll { - ref mut time_left, .. - } => { - *time_left = time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - } - Charge { ref mut time_left } => { - *time_left = time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - } - Wield { ref mut time_left } => { - *time_left = time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - } - Block { - ref mut time_active, - } => { - *time_active = time_active - .checked_add(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - } - Idle => {} - } - - // Determine new state - *character = match character.movement { - Stand(data) => data.handle( - &entity, + // Determine new move state if can move + if !maybe_move_override.is_some() { + let state_update = character.move_state.handle(&ECSStateData { + entity: &entity, + uid, character, pos, vel, ori, - &dt, + dt: &dt, inputs, stats, body, physics, - &server_bus, - &local_bus, - ), - Run(data) => data.handle( - &entity, + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); + + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } + + // Determine new action if can_act + if !maybe_action_override.is_some() { + let state_update = character.action_state.handle(&ECSStateData { + entity: &entity, + uid, character, pos, vel, ori, - &dt, + dt: &dt, inputs, stats, body, physics, - &server_bus, - &local_bus, - ), - Jump(data) => data.handle( - &entity, - character, - pos, - vel, - ori, - &dt, - inputs, - stats, - body, - physics, - &server_bus, - &local_bus, - ), - Climb(data) => data.handle( - &entity, - character, - pos, - vel, - ori, - &dt, - inputs, - stats, - body, - physics, - &server_bus, - &local_bus, - ), - Glide(data) => data.handle( - &entity, - character, - pos, - vel, - ori, - &dt, - inputs, - stats, - body, - physics, - &server_bus, - &local_bus, - ), - Swim(data) => data.handle( - &entity, - character, - pos, - vel, - ori, - &dt, - inputs, - stats, - body, - physics, - &server_bus, - &local_bus, - ), - Fall(data) => data.handle( - &entity, - character, - pos, - vel, - ori, - &dt, - inputs, - stats, - body, - physics, - &server_bus, - &local_bus, - ), - Sit(data) => data.handle( - &entity, - character, - pos, - vel, - ori, - &dt, - inputs, - stats, - body, - physics, - &server_bus, - &local_bus, - ), // Charging + Any Movement, prioritizes finishing charge - // over movement states - // (Charge { time_left }, _) => { - // if let Some(uid_b) = physics.touch_entity { - // server_emitter.emit(ServerEvent::Damage { - // uid: uid_b, - // change: HealthChange { - // amount: -20, - // cause: HealthSource::Attack { by: *uid }, - // }, - // }); + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); - // character.action = try_wield(stats); - // } else if time_left == Duration::default() || vel.0.magnitude_squared() < 10.0 { - // character.action = try_wield(stats); - // } - // } - // Rolling + Any Movement, prioritizes finishing charge - // over movement states - // ( - // Roll { - // time_left, - // was_wielding, - // }, - // _, - // ) => { - // if time_left == Duration::default() { - // if was_wielding { - // character.action = try_wield(stats); - // } else { - // character.action = Idle; - // } - // } - // } - }; - } - } -} - -pub trait State { - fn handle( - &self, - entity: &Entity, - character: &CharacterState, - pos: &mut Pos, - vel: &mut Vel, - ori: &mut Ori, - dt: &DeltaTime, - inputs: &ControllerInputs, - stats: &Stats, - body: &Body, - physics: &PhysicsState, - server_bus: &EventBus, - local_bus: &EventBus, - ) -> CharacterState; -} - -impl State for RunData { - fn handle( - &self, - _entity: &Entity, - character: &CharacterState, - _pos: &mut Pos, - vel: &mut Vel, - ori: &mut Ori, - dt: &DeltaTime, - inputs: &ControllerInputs, - stats: &Stats, - body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Move player according to move_dir - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { - HUMANOID_ACCEL - } else { - 0.0 - }; - - // Set direction based on move direction when on the ground - let ori_dir = if character.action.is_attack() || character.action.is_block() { - Vec2::from(inputs.look_dir).normalized() - } else { - Vec2::from(vel.0) - }; - - if ori_dir.magnitude_squared() > 0.0001 - && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 - { - ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 9.0 * dt.0); - } - - // Try to sit - if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { - return CharacterState { - movement: Sit(SitData), - action: Idle, - }; - } - - // Try to climb - if let (true, Some(_wall_dir)) = ( - inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), - physics.on_wall, - ) { - return CharacterState { - movement: Climb(ClimbData), - action: Idle, - }; - } - - // Try to swim - if !physics.on_ground && physics.in_fluid { - return CharacterState { - action: character.action, - movement: Swim(SwimData), - }; - } - - // While on ground ... - if physics.on_ground { - // Try to jump - if inputs.jump.is_pressed() && !inputs.jump.is_held_down() { - return CharacterState { - action: character.action, - movement: Jump(JumpData), - }; - } - - // Try to charge - if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { - return CharacterState { - action: Charge { - time_left: Duration::from_millis(250), - }, - movement: Run(RunData), - }; - } - - // Try to roll - if inputs.roll.is_pressed() && body.is_humanoid() { - return CharacterState { - action: Roll { - time_left: Duration::from_millis(600), - was_wielding: character.action.is_wield(), - }, - movement: Run(RunData), - }; - } - } - // While not on ground ... - else { - // Try to glide - if physics.on_wall == None - && inputs.glide.is_pressed() - && !inputs.glide.is_held_down() - && body.is_humanoid() - { - return CharacterState { - action: Idle, - movement: Glide(GlideData), - }; - } - return CharacterState { - action: character.action, - movement: Fall(FallData), - }; - } - - // Tool Actions - if inputs.toggle_wield.is_just_pressed() { - match character.action { - Wield { .. } | Attack { .. } => { - // Prevent instantaneous reequipping by checking - // for done wielding - if character.action.is_action_finished() { - return CharacterState { - action: Idle, - movement: character.movement, - }; - } - } - Idle => { - return CharacterState { - // Try to wield if an item is equipped in main hand - action: if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - }, - movement: character.movement, - }; - } - Charge { .. } | Roll { .. } | Block { .. } => {} - } - } - if inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - - if inputs.move_dir.magnitude_squared() > 0.0 { - return CharacterState { - action: character.action, - movement: Run(RunData), - }; - } else { - return CharacterState { - action: character.action, - movement: Stand(StandData), - }; - } - } -} - -impl State for StandData { - fn handle( - &self, - _entity: &Entity, - character: &CharacterState, - _pos: &mut Pos, - _vel: &mut Vel, - _ori: &mut Ori, - _dt: &DeltaTime, - inputs: &ControllerInputs, - stats: &Stats, - body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Try to sit - if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { - return CharacterState { - movement: Sit(SitData), - action: Idle, - }; - } - - // Try to climb - if let (true, Some(_wall_dir)) = ( - inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), - physics.on_wall, - ) { - return CharacterState { - movement: Climb(ClimbData), - action: Idle, - }; - } - - // Try to swim - if !physics.on_ground && physics.in_fluid { - return CharacterState { - action: character.action, - movement: Swim(SwimData), - }; - } - - // While on ground ... - if physics.on_ground { - // Try to jump - if inputs.jump.is_pressed() { - return CharacterState { - action: character.action, - movement: Jump(JumpData), - }; - } - - // Try to charge - if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { - return CharacterState { - action: Charge { - time_left: Duration::from_millis(250), - }, - movement: Run(RunData), - }; - } - - // Try to roll - if inputs.roll.is_pressed() && body.is_humanoid() { - return CharacterState { - action: Roll { - time_left: Duration::from_millis(600), - was_wielding: character.action.is_wield(), - }, - movement: Run(RunData), - }; - } - } - // While not on ground ... - else { - // Try to glide - if physics.on_wall == None - && inputs.glide.is_pressed() - && !inputs.glide.is_held_down() - && body.is_humanoid() - { - return CharacterState { - action: Idle, - movement: Glide(GlideData), - }; - } - return CharacterState { - action: character.action, - movement: Fall(FallData), - }; - } - - // Tool Actions - if inputs.toggle_wield.is_just_pressed() { - match character.action { - Wield { .. } | Attack { .. } => { - // Prevent instantaneous reequipping by checking - // for done wielding - if character.action.is_action_finished() { - return CharacterState { - action: Idle, - movement: character.movement, - }; - } - } - Idle => { - return CharacterState { - // Try to wield if an item is equipped in main hand - action: if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - }, - movement: character.movement, - }; - } - Charge { .. } | Roll { .. } | Block { .. } => {} - } - } - if inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - - if inputs.move_dir.magnitude_squared() > 0.0 { - return CharacterState { - action: character.action, - movement: Run(RunData), - }; - } else { - return CharacterState { - action: character.action, - movement: Stand(StandData), - }; - } - } -} - -impl State for SitData { - fn handle( - &self, - _entity: &Entity, - _character: &CharacterState, - _pos: &mut Pos, - _vel: &mut Vel, - _ori: &mut Ori, - _dt: &DeltaTime, - inputs: &ControllerInputs, - _stats: &Stats, - _body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Falling - // Idk, maybe the ground disappears, - // suddenly maybe a water spell appears. - // Can't hurt to be safe :shrug: - if !physics.on_ground { - if physics.in_fluid { - return CharacterState { - action: Idle, - movement: Swim(SwimData), - }; - } else { - return CharacterState { - action: Idle, - movement: Fall(FallData), - }; - } - } - // Jumping - if inputs.jump.is_pressed() { - return CharacterState { - action: Idle, - movement: Jump(JumpData), - }; - } - - // Moving - if inputs.move_dir.magnitude_squared() > 0.0 { - return CharacterState { - action: Idle, - movement: Run(RunData), - }; - } - - // Standing back up (unsitting) - if inputs.sit.is_just_pressed() { - return CharacterState { - action: Idle, - movement: Stand(StandData), - }; - } - - // no movement has occurred - return CharacterState { - action: Idle, - movement: Sit(SitData), - }; - } -} - -impl State for JumpData { - fn handle( - &self, - entity: &Entity, - character: &CharacterState, - _pos: &mut Pos, - _vel: &mut Vel, - _ori: &mut Ori, - _dt: &DeltaTime, - _inputs: &ControllerInputs, - _stats: &Stats, - _body: &Body, - _physics: &PhysicsState, - _server_bus: &EventBus, - local_bus: &EventBus, - ) -> CharacterState { - local_bus.emitter().emit(LocalEvent::Jump(*entity)); - - return CharacterState { - action: character.action, - movement: Fall(FallData), - }; - } -} - -impl State for FallData { - fn handle( - &self, - _entity: &Entity, - character: &CharacterState, - _pos: &mut Pos, - vel: &mut Vel, - ori: &mut Ori, - dt: &DeltaTime, - inputs: &ControllerInputs, - stats: &Stats, - _body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Move player according to move_dir - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * if vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) { - HUMANOID_AIR_ACCEL - } else { - 0.0 - }; - - // Set direction based on move direction when on the ground - let ori_dir = if character.action.is_attack() || character.action.is_block() { - Vec2::from(inputs.look_dir).normalized() - } else { - Vec2::from(vel.0) - }; - - if ori_dir.magnitude_squared() > 0.0001 - && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 - { - ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 2.0 * dt.0); - } - - let mut new_action = character.action; - - // Update actions - match character.action { - // Unwield if buttons pressed - Wield { .. } | Attack { .. } => { - if inputs.toggle_wield.is_just_pressed() { - new_action = Idle; - } - } - // Try to wield if any of buttons pressed - Idle => { - if inputs.primary.is_pressed() || inputs.secondary.is_pressed() { - new_action = if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - } - }; - } - // Cancel blocks - Block { .. } => { - new_action = if let Some(ItemKind::Tool { kind, .. }) = - stats.equipment.main.as_ref().map(|i| &i.kind) - { - let wield_duration = kind.wield_duration(); - Wield { - time_left: wield_duration, - } - } else { - Idle - }; - } - // Don't change action - Charge { .. } | Roll { .. } => {} - }; - - // Gliding - if inputs.glide.is_pressed() && !inputs.glide.is_held_down() { - return CharacterState { - action: Idle, - movement: Glide(GlideData), - }; - } - - // Reset to Falling while not standing on ground, - // otherwise keep the state given above - if !physics.on_ground { - if physics.in_fluid { - return CharacterState { - action: new_action, - movement: Swim(SwimData), - }; - } else { - return CharacterState { - action: new_action, - movement: Fall(FallData), - }; - } - } - // On ground - else { - // Return to running or standing based on move inputs - return CharacterState { - action: new_action, - movement: if inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunData) - } else { - Stand(StandData) - }, - }; - } - } -} -impl State for GlideData { - fn handle( - &self, - _entity: &Entity, - _character: &CharacterState, - _pos: &mut Pos, - vel: &mut Vel, - ori: &mut Ori, - dt: &DeltaTime, - inputs: &ControllerInputs, - _stats: &Stats, - _body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Move player according to move_dir - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) { - GLIDE_ACCEL - } else { - 0.0 - }; - - let ori_dir = Vec2::from(vel.0); - - if ori_dir.magnitude_squared() > 0.0001 - && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 - { - ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 2.0 * dt.0); - } - - // Apply Glide lift - if Vec2::::from(vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) && vel.0.z < 0.0 { - let lift = GLIDE_ANTIGRAV + vel.0.z.abs().powf(2.0) * 0.15; - vel.0.z += dt.0 - * lift - * (Vec2::::from(vel.0).magnitude() * 0.075) - .min(1.0) - .max(0.2); - } - - if !inputs.glide.is_pressed() { - return CharacterState { - action: Idle, - movement: Fall(FallData), - }; - } else if let Some(_wall_dir) = physics.on_wall { - return CharacterState { - action: Idle, - movement: Climb(ClimbData), - }; - } - - if physics.on_ground { - return CharacterState { - action: Idle, - movement: Stand(StandData), - }; - } - - return CharacterState { - action: Idle, - movement: Glide(GlideData), - }; - } -} -impl State for ClimbData { - fn handle( - &self, - _entity: &Entity, - character: &CharacterState, - _pos: &mut Pos, - vel: &mut Vel, - ori: &mut Ori, - dt: &DeltaTime, - inputs: &ControllerInputs, - _stats: &Stats, - _body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Move player according to move_dir - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { - HUMANOID_CLIMB_ACCEL - } else { - 0.0 - }; - - // Set direction based on move direction when on the ground - let ori_dir = if let Some(wall_dir) = physics.on_wall { - if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { - Vec2::from(wall_dir).normalized() - } else { - Vec2::from(vel.0) - } - } else { - Vec2::from(vel.0) - }; - - if ori_dir.magnitude_squared() > 0.0001 - && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 - { - ori.0 = vek::ops::Slerp::slerp( - ori.0, - ori_dir.into(), - if physics.on_ground { 9.0 } else { 2.0 } * dt.0, - ); - } - - // Apply Vertical Climbing Movement - if let (true, Some(_wall_dir)) = ( - (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) && vel.0.z <= CLIMB_SPEED, - physics.on_wall, - ) { - if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() { - vel.0 -= dt.0 * vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); - } else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() { - vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); - } else { - vel.0.z = vel.0.z + dt.0 * GRAVITY * 1.5; - vel.0 = Lerp::lerp( - vel.0, - Vec3::zero(), - 30.0 * dt.0 / (1.0 - vel.0.z.min(0.0) * 5.0), - ); - } - } - - if let None = physics.on_wall { - if inputs.jump.is_pressed() { - return CharacterState { - action: Idle, - movement: Jump(JumpData), - }; - } else { - return CharacterState { - action: Idle, - movement: Fall(FallData), - }; - } - } - if physics.on_ground { - return CharacterState { - action: Idle, - movement: Stand(StandData), - }; - } - - return *character; - } -} -impl State for SwimData { - fn handle( - &self, - _entity: &Entity, - character: &CharacterState, - _pos: &mut Pos, - vel: &mut Vel, - ori: &mut Ori, - dt: &DeltaTime, - inputs: &ControllerInputs, - _stats: &Stats, - _body: &Body, - physics: &PhysicsState, - _server_bus: &EventBus, - _local_bus: &EventBus, - ) -> CharacterState { - // Update velocity - vel.0 += Vec2::broadcast(dt.0) - * inputs.move_dir - * if vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { - HUMANOID_WATER_ACCEL - } else { - 0.0 - }; - - // Set direction based on move direction when on the ground - let ori_dir = if character.action.is_attack() || character.action.is_block() { - Vec2::from(inputs.look_dir).normalized() - } else { - Vec2::from(vel.0) - }; - - if ori_dir.magnitude_squared() > 0.0001 - && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 - { - ori.0 = vek::ops::Slerp::slerp( - ori.0, - ori_dir.into(), - if physics.on_ground { 9.0 } else { 2.0 } * dt.0, - ); - } - - if inputs.jump.is_pressed() { - vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); - } - - if inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - - // Not on ground - if !physics.on_ground { - return CharacterState { - action: character.action, - movement: Swim(SwimData), - }; - } - // On ground - else { - // Return to running or standing based on move inputs - return CharacterState { - action: character.action, - movement: if inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunData) - } else { - Stand(StandData) - }, - }; + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } + + // Rolling + Any Movement, prioritizes finishing charge + // over move_state states + // ( + // Roll { + // time_left, + // was_wielding, + // }, + // _, + // ) => { + // if time_left == Duration::default() { + // if was_wielding { + // character.action = try_wield(stats); + // } else { + // character.action = Idle; + // } + // } + // } } } } diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 6a23de568f..156067b531 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -46,119 +46,119 @@ impl<'a> System<'a> for Sys { stats, ): Self::SystemData, ) { - let mut server_emitter = server_bus.emitter(); - let mut _local_emitter = local_bus.emitter(); + // let mut server_emitter = server_bus.emitter(); + // let mut _local_emitter = local_bus.emitter(); - // Attacks - for (entity, uid, pos, ori, _, stat) in ( - &entities, - &uids, - &positions, - &orientations, - &controllers, - &stats, - ) - .join() - { - let recover_duration = if let Some(Item { - kind: ItemKind::Tool { kind, .. }, - .. - }) = stat.equipment.main - { - kind.attack_recover_duration() - } else { - Duration::from_secs(1) - }; + // // Attacks + // for (entity, uid, pos, ori, _, stat) in ( + // &entities, + // &uids, + // &positions, + // &orientations, + // &controllers, + // &stats, + // ) + // .join() + // { + // let recover_duration = if let Some(Item { + // kind: ItemKind::Tool { kind, .. }, + // .. + // }) = stat.equipment.main + // { + // kind.attack_recover_duration() + // } else { + // Duration::from_secs(1) + // }; - let (deal_damage, should_end) = if let Some(Attack { time_left, applied }) = - &mut character_states.get_mut(entity).map(|c| &mut c.action) - { - *time_left = time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - if !*applied && recover_duration > *time_left { - *applied = true; - (true, false) - } else if *time_left == Duration::default() { - (false, true) - } else { - (false, false) - } - } else { - (false, false) - }; + // let (deal_damage, should_end) = if let Some(Attack { time_left, applied }) = + // &mut character_states.get_mut(entity).map(|c| &mut c.action) + // { + // *time_left = time_left + // .checked_sub(Duration::from_secs_f32(dt.0)) + // .unwrap_or_default(); + // if !*applied && recover_duration > *time_left { + // *applied = true; + // (true, false) + // } else if *time_left == Duration::default() { + // (false, true) + // } else { + // (false, false) + // } + // } else { + // (false, false) + // }; - if deal_damage { - if let Some(Attack { .. }) = &character_states.get(entity).map(|c| c.action) { - // Go through all other entities - for (b, uid_b, pos_b, ori_b, character_b, stat_b) in ( - &entities, - &uids, - &positions, - &orientations, - &character_states, - &stats, - ) - .join() - { - // 2D versions - let pos2 = Vec2::from(pos.0); - let pos_b2: Vec2 = Vec2::from(pos_b.0); - let ori2 = Vec2::from(ori.0); + // if deal_damage { + // if let Some(Attack { .. }) = &character_states.get(entity).map(|c| c.action) { + // // Go through all other entities + // for (b, uid_b, pos_b, ori_b, character_b, stat_b) in ( + // &entities, + // &uids, + // &positions, + // &orientations, + // &character_states, + // &stats, + // ) + // .join() + // { + // // 2D versions + // let pos2 = Vec2::from(pos.0); + // let pos_b2: Vec2 = Vec2::from(pos_b.0); + // let ori2 = Vec2::from(ori.0); - // Check if it is a hit - if entity != b - && !stat_b.is_dead - && pos.0.distance_squared(pos_b.0) < ATTACK_RANGE.powi(2) - // TODO: Use size instead of 1.0 - && ori2.angle_between(pos_b2 - pos2) < (2.0 / pos2.distance(pos_b2)).atan() - { - // Weapon gives base damage - let mut dmg = if let Some(ItemKind::Tool { power, .. }) = - stat.equipment.main.as_ref().map(|i| &i.kind) - { - *power as i32 - } else { - 1 - }; + // // Check if it is a hit + // if entity != b + // && !stat_b.is_dead + // && pos.0.distance_squared(pos_b.0) < ATTACK_RANGE.powi(2) + // // TODO: Use size instead of 1.0 + // && ori2.angle_between(pos_b2 - pos2) < (2.0 / pos2.distance(pos_b2)).atan() + // { + // // Weapon gives base damage + // let mut dmg = if let Some(ItemKind::Tool { power, .. }) = + // stat.equipment.main.as_ref().map(|i| &i.kind) + // { + // *power as i32 + // } else { + // 1 + // }; - // Block - if character_b.action.is_block() - && ori_b.0.angle_between(pos.0 - pos_b.0).to_degrees() - < BLOCK_ANGLE / 2.0 - { - dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 - } + // // Block + // if character_b.action.is_block() + // && ori_b.0.angle_between(pos.0 - pos_b.0).to_degrees() + // < BLOCK_ANGLE / 2.0 + // { + // dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 + // } - server_emitter.emit(ServerEvent::Damage { - uid: *uid_b, - change: HealthChange { - amount: -dmg, - cause: HealthSource::Attack { by: *uid }, - }, - }); - } - } - } - } + // server_emitter.emit(ServerEvent::Damage { + // uid: *uid_b, + // change: HealthChange { + // amount: -dmg, + // cause: HealthSource::Attack { by: *uid }, + // }, + // }); + // } + // } + // } + // } - if should_end { - if let Some(character) = &mut character_states.get_mut(entity) { - character.action = Wield { - time_left: Duration::default(), - }; - } - } + // if should_end { + // if let Some(character) = &mut character_states.get_mut(entity) { + // character.action = Wield { + // time_left: Duration::default(), + // }; + // } + // } - if let Some(Wield { time_left }) = - &mut character_states.get_mut(entity).map(|c| &mut c.action) - { - if *time_left != Duration::default() { - *time_left = time_left - .checked_sub(Duration::from_secs_f32(dt.0)) - .unwrap_or_default(); - } - } - } + // if let Some(Wield { time_left }) = + // &mut character_states.get_mut(entity).map(|c| &mut c.action) + // { + // if *time_left != Duration::default() { + // *time_left = time_left + // .checked_sub(Duration::from_secs_f32(dt.0)) + // .unwrap_or_default(); + // } + // } + // } } } diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index 7548d322df..2af37f4fb8 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -1,20 +1,13 @@ -use super::movement::ROLL_DURATION; use crate::{ - comp::{ - self, item, projectile, ActionState, ActionState::*, Body, CharacterState, ControlEvent, - Controller, ControllerInputs, HealthChange, HealthSource, ItemKind, Mounting, - MovementState, MovementState::*, PhysicsState, Projectile, Stats, Vel, - }, - event::{Emitter, EventBus, LocalEvent, ServerEvent}, + comp::{ControlEvent, Controller}, + event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, }; use specs::{ saveload::{Marker, MarkerAllocator}, - Entities, Entity, Join, Read, ReadStorage, System, WriteStorage, + Entities, Join, Read, ReadStorage, System, WriteStorage, }; use sphynx::{Uid, UidAllocator}; -use std::time::Duration; -use vek::*; /// # Controller System /// #### Responsible for validating and updating controller inputs diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index b490c19354..948596139a 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -3,7 +3,6 @@ pub mod character_state; mod cleanup; pub mod combat; pub mod controller; -pub mod movement; pub mod phys; mod projectile; mod stats; @@ -16,7 +15,6 @@ const AGENT_SYS: &str = "agent_sys"; const CHARACTER_STATE_SYS: &str = "character_state_sys"; const CONTROLLER_SYS: &str = "controller_sys"; const PHYS_SYS: &str = "phys_sys"; -const MOVEMENT_SYS: &str = "movement_sys"; const PROJECTILE_SYS: &str = "projectile_sys"; const COMBAT_SYS: &str = "combat_sys"; const STATS_SYS: &str = "stats_sys"; @@ -26,13 +24,12 @@ pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(agent::Sys, AGENT_SYS, &[]); dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS]); dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); - dispatch_builder.add(movement::Sys, MOVEMENT_SYS, &[CHARACTER_STATE_SYS]); dispatch_builder.add(combat::Sys, COMBAT_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(stats::Sys, STATS_SYS, &[COMBAT_SYS]); dispatch_builder.add( phys::Sys, PHYS_SYS, - &[CONTROLLER_SYS, MOVEMENT_SYS, COMBAT_SYS, STATS_SYS], + &[CONTROLLER_SYS, COMBAT_SYS, STATS_SYS], ); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); dispatch_builder.add(cleanup::Sys, CLEANUP_SYS, &[PHYS_SYS]); diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index c3693dd828..7a64a996f4 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -1,8 +1,8 @@ use super::phys::GRAVITY; use crate::{ comp::{ - CharacterState, Controller, Mounting, MovementState::*, Ori, PhysicsState, Pos, RunData, - StandData, Stats, Vel, + CharacterState, Controller, Mounting, MoveState::*, Ori, PhysicsState, Pos, RunHandler, + StandHandler, Stats, Vel, }, event::{EventBus, ServerEvent}, state::DeltaTime, @@ -106,7 +106,7 @@ impl<'a> System<'a> for Sys { ) .join() { - // if character.movement == Run(RunData) || character.movement == Stand(StandData) { + // if character.movement == Run(RunHandler) || character.movement == Stand(StandHandler) { // continue; // } diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index af68a96313..3a3eefcd68 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -4,7 +4,11 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use client::Client; use common::{ - comp::{ActionState, Body, CharacterState, ItemKind, MovementState, Pos, Stats}, + comp::{ + ActionState, AttackKind::*, BasicAttackHandler, Body, CharacterState, DodgeKind::*, + FallHandler, GlideHandler, ItemKind, MoveState, Pos, RollHandler, RunHandler, StandHandler, + Stats, + }, event::{EventBus, SfxEvent, SfxEventItem}, }; use hashbrown::HashMap; @@ -125,7 +129,7 @@ impl SfxEventMapper { } } - /// Voxygen has an existing list of character states via `MovementState::*` and `ActionState::*` + /// Voxygen has an existing list of character states via `MoveState::*` and `ActionState::*` /// however that list does not provide enough resolution to target specific entity events, such /// as opening or closing the glider. These methods translate those entity states with some additional /// data into more specific `SfxEvent`'s which we attach sounds to @@ -135,8 +139,8 @@ impl SfxEventMapper { stats: &Stats, ) -> SfxEvent { match ( - current_event.movement, - current_event.action, + current_event.move_state, + current_event.action_state, previous_event, stats, ) { @@ -154,23 +158,23 @@ impl SfxEventMapper { stats: &Stats, ) -> SfxEvent { match ( - current_event.movement, - current_event.action, + current_event.move_state, + current_event.action_state, previous_event, stats, ) { - (_, ActionState::Roll { .. }, ..) => SfxEvent::Roll, - (MovementState::Climb(_), ..) => SfxEvent::Climb, - (MovementState::Swim(_), ..) => SfxEvent::Swim, - (MovementState::Run(_), ..) => SfxEvent::Run, - (MovementState::Fall(_), _, previous_event, _) => { + (_, ActionState::Dodge(_), ..) => SfxEvent::Roll, + (MoveState::Climb(_), ..) => SfxEvent::Climb, + (MoveState::Swim(_), ..) => SfxEvent::Swim, + (MoveState::Run(_), ..) => SfxEvent::Run, + (MoveState::Fall(_), _, previous_event, _) => { if previous_event != SfxEvent::Glide { SfxEvent::Fall } else { SfxEvent::GliderClose } } - (MovementState::Glide(_), _, previous_event, ..) => { + (MoveState::Glide(_), _, previous_event, ..) => { if previous_event != SfxEvent::GliderOpen && previous_event != SfxEvent::Glide { SfxEvent::GliderOpen } else { @@ -193,7 +197,7 @@ mod tests { use super::*; use common::{ assets, - comp::{item::Tool, ActionState, MovementState, Stats}, + comp::{item::Tool, ActionState, MoveState, Stats}, event::SfxEvent, }; use std::time::{Duration, Instant}; @@ -273,8 +277,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Stand, - action: ActionState::Idle, + move_state: MoveState::Stand(StandHandler), + action_state: ActionState::Idle, }, SfxEvent::Idle, &stats, @@ -289,8 +293,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Run, - action: ActionState::Idle, + move_state: MoveState::Run(RunHandler), + action_state: ActionState::Idle, }, SfxEvent::Idle, &stats, @@ -305,11 +309,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - action: ActionState::Roll { - time_left: Duration::new(1, 0), - was_wielding: false, - }, - movement: MovementState::Run, + action_state: ActionState::Dodge(Roll(RollHandler::default())), + move_state: MoveState::Run(RunHandler), }, SfxEvent::Run, &stats, @@ -324,8 +325,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Fall, - action: ActionState::Idle, + move_state: MoveState::Fall(FallHandler), + action_state: ActionState::Idle, }, SfxEvent::Idle, &stats, @@ -340,8 +341,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Glide, - action: ActionState::Idle, + move_state: MoveState::Glide(GlideHandler), + action_state: ActionState::Idle, }, SfxEvent::Jump, &stats, @@ -356,8 +357,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Glide, - action: ActionState::Idle, + move_state: MoveState::Glide(GlideHandler), + action_state: ActionState::Idle, }, SfxEvent::Glide, &stats, @@ -372,8 +373,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Fall, - action: ActionState::Idle, + move_state: MoveState::Fall(FallHandler), + action_state: ActionState::Idle, }, SfxEvent::Glide, &stats, @@ -393,11 +394,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - movement: MovementState::Stand, - action: ActionState::Attack { - time_left: Duration::new(1, 0), - applied: true, - }, + move_state: MoveState::Stand(StandHandler), + action_state: ActionState::Attack(BasicAttack(BasicAttackHandler::default())), }, SfxEvent::Idle, &stats, diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 54fe68a2d5..797dead31d 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -6,7 +6,7 @@ use crate::{ }; use common::{ assets::watch::ReloadIndicator, - comp::{ActionState, Body, CharacterState, Equipment, MovementState}, + comp::{ActionState, Body, CharacterState, Equipment, MoveState}, }; use hashbrown::HashMap; use std::mem::{discriminant, Discriminant}; @@ -24,15 +24,15 @@ enum FigureKey { #[derive(PartialEq, Eq, Hash, Clone)] struct CharacterStateCacheKey { - movement: Discriminant, + move_state: Discriminant, action: Discriminant, } impl From<&CharacterState> for CharacterStateCacheKey { fn from(cs: &CharacterState) -> Self { Self { - movement: discriminant(&cs.movement), - action: discriminant(&cs.action), + move_state: discriminant(&cs.move_state), + action: discriminant(&cs.action_state), } } } @@ -132,7 +132,7 @@ impl FigureModelCache { }, if camera_mode == CameraMode::FirstPerson && character_state - .map(|cs| cs.action.is_roll()) + .map(|cs| cs.action_state.is_dodging()) .unwrap_or_default() { None @@ -140,7 +140,7 @@ impl FigureModelCache { Some(humanoid_armor_hand_spec.mesh_left_hand(&body)) }, if character_state - .map(|cs| cs.action.is_roll()) + .map(|cs| cs.action_state.is_dodging()) .unwrap_or_default() { None @@ -162,9 +162,9 @@ impl FigureModelCache { if camera_mode != CameraMode::FirstPerson || character_state .map(|cs| { - cs.action.is_attack() - || cs.action.is_block() - || cs.action.is_wield() + cs.action_state.is_attacking() + || cs.action_state.is_blocking() + || cs.action_state.is_wielding() }) .unwrap_or_default() { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 80f52b69fc..13e01db904 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -18,8 +18,8 @@ use crate::{ use client::Client; use common::{ comp::{ - ActionState::*, Body, CharacterState, ItemKind, Last, MovementState::*, Ori, Pos, Scale, - Stats, Vel, + ActionState::*, AttackKind::*, Body, CharacterState, ItemKind, Last, MoveState::*, Ori, + Pos, Scale, Stats, Vel, }, terrain::TerrainChunk, vol::RectRasterableVol, @@ -160,7 +160,7 @@ impl FigureMgr { ) .1; - let mut movement_animation_rate = 1.0; + let mut move_state_animation_rate = 1.0; let mut action_animation_rate = 1.0; let vel = ecs @@ -189,65 +189,65 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - if !character.is_same_action(&last_character.0) { + if !character.is_same_action_state(&last_character.0) { state.action_time = 0.0; } - let target_base = match &character.movement { + let target_base = match &character.move_state { Stand(_) => anim::character::StandAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::character::RunAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, state.last_ori, time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) | Fall(_) => anim::character::JumpAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Glide(_) => anim::character::GlidingAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, state.last_ori, time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Swim(_) => anim::character::SwimAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0.magnitude(), ori.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Climb(_) => anim::character::ClimbAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Sit(_) => anim::character::SitAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), }; - let target_bones = match (&character.movement, &character.action) { + let target_bones = match (&character.move_state, &character.action_state) { (Stand(_), Wield { .. }) => { anim::character::CidleAnimation::update_skeleton( &target_base, @@ -266,35 +266,37 @@ impl FigureMgr { skeleton_attr, ) } - (_, Attack { .. }) => anim::character::AttackAnimation::update_skeleton( - &target_base, - (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, - skeleton_attr, - ), - (_, Wield { .. }) => anim::character::WieldAnimation::update_skeleton( + (_, Attack(kind)) => match kind { + Charge(_) => anim::character::ChargeAnimation::update_skeleton( + &target_base, + (active_tool_kind, time), + state.action_time, + &mut action_animation_rate, + skeleton_attr, + ), + BasicAttack(_) => anim::character::AttackAnimation::update_skeleton( + &target_base, + (active_tool_kind, time), + state.action_time, + &mut action_animation_rate, + skeleton_attr, + ), + }, + (_, Wield(_)) => anim::character::WieldAnimation::update_skeleton( &target_base, (active_tool_kind, vel.0.magnitude(), time), state.action_time, &mut action_animation_rate, skeleton_attr, ), - (_, Roll { .. }) => anim::character::RollAnimation::update_skeleton( + (_, Dodge(_)) => anim::character::RollAnimation::update_skeleton( &target_base, (active_tool_kind, time), state.action_time, &mut action_animation_rate, skeleton_attr, ), - (_, Block { .. }) => anim::character::BlockAnimation::update_skeleton( - &target_base, - (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, - skeleton_attr, - ), - (_, Charge { .. }) => anim::character::ChargeAnimation::update_skeleton( + (_, Block(_)) => anim::character::BlockAnimation::update_skeleton( &target_base, (active_tool_kind, time), state.action_time, @@ -313,7 +315,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -330,30 +332,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::quadruped_small::IdleAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::quadruped_small::RunAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::quadruped_small::JumpAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -370,7 +372,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -387,30 +389,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::quadruped_medium::IdleAnimation::update_skeleton( &QuadrupedMediumSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::quadruped_medium::RunAnimation::update_skeleton( &QuadrupedMediumSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::quadruped_medium::JumpAnimation::update_skeleton( &QuadrupedMediumSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -427,7 +429,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -442,30 +444,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::bird_medium::IdleAnimation::update_skeleton( &BirdMediumSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::bird_medium::RunAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::bird_medium::JumpAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -482,7 +484,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -497,30 +499,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::fish_medium::IdleAnimation::update_skeleton( &FishMediumSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::fish_medium::RunAnimation::update_skeleton( &FishMediumSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::fish_medium::JumpAnimation::update_skeleton( &FishMediumSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -537,7 +539,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -552,30 +554,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::dragon::IdleAnimation::update_skeleton( &DragonSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::dragon::RunAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::dragon::JumpAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -592,7 +594,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -607,30 +609,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::bird_small::IdleAnimation::update_skeleton( &BirdSmallSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::bird_small::RunAnimation::update_skeleton( &BirdSmallSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::bird_small::JumpAnimation::update_skeleton( &BirdSmallSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -647,7 +649,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -662,30 +664,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::fish_small::IdleAnimation::update_skeleton( &FishSmallSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::fish_small::RunAnimation::update_skeleton( &FishSmallSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::fish_small::JumpAnimation::update_skeleton( &FishSmallSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -702,7 +704,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -717,30 +719,30 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_movement(&last_character.0) { - state.movement_time = 0.0; + if !character.is_same_move_state(&last_character.0) { + state.move_state_time = 0.0; } - let target_base = match character.movement { + let target_base = match character.move_state { Stand(_) => anim::biped_large::IdleAnimation::update_skeleton( &BipedLargeSkeleton::new(), time, - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Run(_) => anim::biped_large::RunAnimation::update_skeleton( &BipedLargeSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), Jump(_) => anim::biped_large::JumpAnimation::update_skeleton( &BipedLargeSkeleton::new(), (vel.0.magnitude(), time), - state.movement_time, - &mut movement_animation_rate, + state.move_state_time, + &mut move_state_animation_rate, skeleton_attr, ), @@ -757,7 +759,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -776,7 +778,7 @@ impl FigureMgr { scale, col, dt, - movement_animation_rate, + move_state_animation_rate, action_animation_rate, ); } @@ -919,7 +921,7 @@ impl FigureMgr { pub struct FigureState { bone_consts: Consts, locals: Consts, - movement_time: f64, + move_state_time: f64, action_time: f64, skeleton: S, pos: Vec3, @@ -934,7 +936,7 @@ impl FigureState { .create_consts(&skeleton.compute_matrices()) .unwrap(), locals: renderer.create_consts(&[FigureLocals::default()]).unwrap(), - movement_time: 0.0, + move_state_time: 0.0, action_time: 0.0, skeleton, pos: Vec3::zero(), @@ -952,7 +954,7 @@ impl FigureState { scale: f32, col: Rgba, dt: f32, - movement_rate: f32, + move_state_rate: f32, action_rate: f32, ) { self.last_ori = Lerp::lerp(self.last_ori, ori, 15.0 * dt); @@ -966,7 +968,7 @@ impl FigureState { self.ori = ori; } - self.movement_time += (dt * movement_rate) as f64; + self.move_state_time += (dt * move_state_rate) as f64; self.action_time += (dt * action_rate) as f64; let mat = Mat4::::identity() diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index a98e30c436..be4ad36102 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -160,7 +160,7 @@ impl Scene { .ecs() .read_storage::() .get(client.entity()) - .map_or(false, |cs| cs.action.is_roll()); + .map_or(false, |cs| cs.action_state.is_dodging()); let player_scale = match client .state() diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 6d7151d65f..52cc3efbbe 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -202,9 +202,9 @@ impl PlayState for SessionState { .read_storage::() .get(client.entity()) .map(|cs| { - cs.action.is_wield() - || cs.action.is_block() - || cs.action.is_attack() + cs.action_state.is_wielding() + || cs.action_state.is_blocking() + || cs.action_state.is_attacking() }) .unwrap_or(false) { From 06053faed08800d0d4a45f5e71a7417bfd15c027 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Thu, 26 Dec 2019 10:01:19 -0800 Subject: [PATCH 006/387] Add state disables, cleanup imports --- common/src/comp/character_state.rs | 9 ++- common/src/comp/mod.rs | 4 +- common/src/comp/states/basic_attack.rs | 39 +++++++++- common/src/comp/states/basic_block.rs | 40 ++++++++++- common/src/comp/states/charge_attack.rs | 94 +++++++++++++++---------- common/src/comp/states/climb.rs | 41 ++++++----- common/src/comp/states/fall.rs | 37 ++++------ common/src/comp/states/glide.rs | 36 ++++------ common/src/comp/states/jump.rs | 11 ++- common/src/comp/states/mod.rs | 12 ++-- common/src/comp/states/roll.rs | 55 +++++++++++++-- common/src/comp/states/run.rs | 53 ++++---------- common/src/comp/states/sit.rs | 52 ++++++-------- common/src/comp/states/stand.rs | 64 ++++------------- common/src/comp/states/swim.rs | 29 +++----- common/src/comp/states/wield.rs | 50 ++++++------- common/src/sys/agent.rs | 2 +- common/src/sys/character_state.rs | 42 ++++------- common/src/sys/controller.rs | 5 +- 19 files changed, 341 insertions(+), 334 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 5b6cc3ba49..b0e57ac12c 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -10,7 +10,7 @@ use specs::{Component, Entity, FlaggedStorage, HashMapStorage, NullStorage}; use sphynx::Uid; use std::time::Duration; -pub struct ECSStateData<'a> { +pub struct EcsCharacterState<'a> { pub entity: &'a Entity, pub uid: &'a Uid, pub character: &'a CharacterState, @@ -27,7 +27,7 @@ pub struct ECSStateData<'a> { pub local_bus: &'a EventBus, } -pub struct ECSStateUpdate { +pub struct EcsStateUpdate { pub character: CharacterState, pub pos: Pos, pub vel: Vel, @@ -127,6 +127,8 @@ impl ActionState { pub struct CharacterState { pub move_state: MoveState, pub action_state: ActionState, + pub action_disabled: bool, + pub move_disabled: bool, } impl CharacterState { @@ -134,6 +136,7 @@ impl CharacterState { // Check if state is the same without looking at the inner data std::mem::discriminant(&self.move_state) == std::mem::discriminant(&other.move_state) } + pub fn is_same_action_state(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(&self.action_state) == std::mem::discriminant(&other.action_state) @@ -148,6 +151,8 @@ impl Default for CharacterState { Self { move_state: MoveState::Fall(FallHandler), action_state: ActionState::Idle, + action_disabled: false, + move_disabled: false, } } } diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 2acf89e6b5..e1bca6cde3 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -22,8 +22,8 @@ pub use body::{ quadruped_medium, quadruped_small, Body, }; pub use character_state::{ - ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, ECSStateData, ECSStateUpdate, - MoveState, OverrideAction, OverrideMove, OverrideState, + ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, EcsCharacterState, + EcsStateUpdate, MoveState, OverrideAction, OverrideMove, OverrideState, }; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 56dd8872d2..366e177b88 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -1,4 +1,11 @@ -use super::{ECSStateData, ECSStateUpdate, StateHandle}; +use super::TEMP_EQUIP_DELAY; +use crate::comp::{ + ActionState::{Attack, Idle, Wield}, + AttackKind::BasicAttack, + EcsCharacterState, EcsStateUpdate, + ItemKind::Tool, + StateHandle, WieldHandler, +}; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -8,12 +15,38 @@ pub struct BasicAttackHandler { } impl StateHandle for BasicAttackHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - return ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, }; + + // Check if attack duration has expired + if self.remaining_duration == Duration::default() { + // If so, go back to wielding or idling + update.character.action_state = if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle + }; + + return update; + } + + // Otherwise, tick down remaining_duration, and keep rolling + update.character.action_state = Attack(BasicAttack(BasicAttackHandler { + remaining_duration: self + .remaining_duration + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(), + })); + + return update; } } diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index 038d30be14..30d5ff4fe2 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -1,5 +1,12 @@ -use super::{ECSStateData, ECSStateUpdate, StateHandle}; +use super::{BLOCK_ACCEL, BLOCK_SPEED, TEMP_EQUIP_DELAY}; +use crate::comp::{ + ActionState::{Idle, Wield}, + EcsCharacterState, EcsStateUpdate, + ItemKind::Tool, + StateHandle, WieldHandler, +}; use std::time::Duration; +use vek::Vec2; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct BasicBlockHandler { @@ -8,12 +15,39 @@ pub struct BasicBlockHandler { } impl StateHandle for BasicBlockHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - return ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, }; + + // TODO: Apply simple move speed debuff instead + + // Update movement + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * match ecs_data.physics.on_ground { + true if update.vel.0.magnitude_squared() < BLOCK_SPEED.powf(2.0) => BLOCK_ACCEL, + _ => 0.0, + }; + + if !ecs_data.inputs.secondary.is_pressed() { + update.character.action_state = if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle + }; + + update.character.move_disabled = false; + return update; + } + + return update; } } diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index 8caec5b33e..d80ffad2e5 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -1,17 +1,16 @@ -use super::{ - CharacterState, ECSStateData, ECSStateUpdate, MoveState::Run, RunHandler, Stand, StandHandler, - StateHandle, WieldHandler, -}; use crate::comp::{ ActionState::{Attack, Idle, Wield}, AttackKind::Charge, - HealthChange, HealthSource, + EcsCharacterState, EcsStateUpdate, HealthChange, HealthSource, ItemKind::Tool, + MoveState::Run, + RunHandler, StateHandle, WieldHandler, }; use crate::event::ServerEvent; use std::time::Duration; +use vek::Vec3; -use super::TEMP_EQUIP_DELAY; +use super::{CHARGE_SPEED, TEMP_EQUIP_DELAY}; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ChargeAttackHandler { @@ -20,15 +19,36 @@ pub struct ChargeAttackHandler { } impl StateHandle for ChargeAttackHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, }; + // Prevent move state handling, handled here + // ecs_data.updater.insert(*ecs_data.entity, OverrideMove); + update.character.action_disabled = true; + + update.character.move_state = Run(RunHandler); + + // Move player + update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) + + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) + + 1.5 + * ecs_data + .inputs + .move_dir + .try_normalized() + .unwrap_or_default()) + .try_normalized() + .unwrap_or_default() + * CHARGE_SPEED; + + // Check if hitting another entity if let Some(uid_b) = ecs_data.physics.touch_entity { + // Send Damage event ecs_data.server_bus.emitter().emit(ServerEvent::Damage { uid: uid_b, change: HealthChange { @@ -37,49 +57,45 @@ impl StateHandle for ChargeAttackHandler { }, }); - update.character = CharacterState { - move_state: Stand(StandHandler), - action_state: if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }, + // Go back to wielding + update.character.action_state = if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle }; + update.character.move_disabled = false; return update; } + // Check if charge timed out or can't keep moving forward if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { - update.character = CharacterState { - move_state: Stand(StandHandler), - action_state: if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }, + update.character.action_state = if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle }; + update.character.move_disabled = false; return update; } - update.character = CharacterState { - move_state: Run(RunHandler), - action_state: Attack(Charge(ChargeAttackHandler { - remaining_duration: self - .remaining_duration - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) - .unwrap_or_default(), - })), - }; + // Tick remaining-duration and keep charging + update.character.action_state = Attack(Charge(ChargeAttackHandler { + remaining_duration: self + .remaining_duration + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(), + })); return update; } diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index cc915f60dd..e7ad8d55c9 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -1,6 +1,6 @@ use super::{ - ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, FallHandler, JumpHandler, - MoveState::*, StandHandler, StateHandle, + ActionState::*, EcsCharacterState, EcsStateUpdate, FallHandler, JumpHandler, MoveState::*, + StandHandler, StateHandle, }; use super::{CLIMB_SPEED, HUMANOID_CLIMB_ACCEL, HUMANOID_SPEED}; use crate::sys::phys::GRAVITY; @@ -11,15 +11,19 @@ use vek::Lerp; pub struct ClimbHandler; impl StateHandle for ClimbHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, }; - // Move player according to move_dir + // Disable actions in this state + update.character.action_state = Idle; + update.character.action_disabled = true; + + // Move player update.vel.0 += Vec2::broadcast(ecs_data.dt.0) * ecs_data.inputs.move_dir * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { @@ -28,7 +32,7 @@ impl StateHandle for ClimbHandler { 0.0 }; - // Set direction based on move direction when on the ground + // Set orientation direction based on wall direction let ori_dir = if let Some(wall_dir) = ecs_data.physics.on_wall { if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { Vec2::from(wall_dir).normalized() @@ -72,26 +76,27 @@ impl StateHandle for ClimbHandler { } } + // If no wall is infront of character ... if let None = ecs_data.physics.on_wall { if ecs_data.inputs.jump.is_pressed() { - update.character = CharacterState { - action_state: Idle, - move_state: Jump(JumpHandler), - }; + // They've climbed atop something, give them a boost + update.character.move_state = Jump(JumpHandler); + update.character.action_disabled = false; + return update; } else { - update.character = CharacterState { - action_state: Idle, - move_state: Fall(FallHandler), - }; + // Just fall off + update.character.move_state = Fall(FallHandler); + update.character.action_disabled = false; + return update; } } + + // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { - update.character = CharacterState { - action_state: Idle, - move_state: Stand(StandHandler), - }; + update.character.move_state = Stand(StandHandler); + update.character.action_disabled = false; return update; } diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index 8a5c30dcc1..c140bea677 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -1,6 +1,6 @@ use super::{ - ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, GlideHandler, MoveState::*, - RunHandler, StandHandler, StateHandle, SwimHandler, + EcsCharacterState, EcsStateUpdate, GlideHandler, MoveState::*, RunHandler, StandHandler, + StateHandle, SwimHandler, }; use super::{HUMANOID_AIR_ACCEL, HUMANOID_AIR_SPEED}; use vek::{Vec2, Vec3}; @@ -9,8 +9,8 @@ use vek::{Vec2, Vec3}; pub struct FallHandler; impl StateHandle for FallHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -34,6 +34,7 @@ impl StateHandle for FallHandler { } else { Vec2::from(update.vel.0) }; + if ori_dir.magnitude_squared() > 0.0001 && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 @@ -43,11 +44,8 @@ impl StateHandle for FallHandler { } // Check gliding - if ecs_data.inputs.glide.is_pressed() && !ecs_data.inputs.glide.is_held_down() { - update.character = CharacterState { - action_state: Idle, - move_state: Glide(GlideHandler), - }; + if ecs_data.inputs.glide.is_pressed() { + update.character.move_state = Glide(GlideHandler); return update; } @@ -56,17 +54,11 @@ impl StateHandle for FallHandler { if !ecs_data.physics.on_ground { // Check if in fluid to go to swimming or back to falling if ecs_data.physics.in_fluid { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Swim(SwimHandler), - }; + update.character.move_state = Swim(SwimHandler); return update; } else { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Fall(FallHandler), - }; + update.character.move_state = Fall(FallHandler); return update; } @@ -74,13 +66,10 @@ impl StateHandle for FallHandler { // On ground else { // Return to running or standing based on move inputs - update.character = CharacterState { - action_state: update.character.action_state, - move_state: if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunHandler) - } else { - Stand(StandHandler) - }, + update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunHandler) + } else { + Stand(StandHandler) }; return update; diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index 8511d4c469..d709ced47e 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -1,6 +1,6 @@ use super::{ - ActionState::*, CharacterState, ClimbHandler, ECSStateData, ECSStateUpdate, FallHandler, - MoveState::*, StandHandler, StateHandle, + ActionState::*, ClimbHandler, EcsCharacterState, EcsStateUpdate, FallHandler, MoveState::*, + StandHandler, StateHandle, }; use super::{GLIDE_ACCEL, GLIDE_ANTIGRAV, GLIDE_SPEED}; use vek::{Vec2, Vec3}; @@ -9,14 +9,20 @@ use vek::{Vec2, Vec3}; pub struct GlideHandler; impl StateHandle for GlideHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, }; + // Prevent action in this state, set here + update.character.action_disabled = true; + + update.character.action_state = Idle; + update.character.move_state = Glide(GlideHandler); + // Move player according to movement direction vector update.vel.0 += Vec2::broadcast(ecs_data.dt.0) * ecs_data.inputs.move_dir @@ -36,7 +42,7 @@ impl StateHandle for GlideHandler { vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 2.0 * ecs_data.dt.0); } - // Apply Glide lift + // Apply Glide antigrav lift if Vec2::::from(update.vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) && update.vel.0.z < 0.0 { @@ -50,38 +56,24 @@ impl StateHandle for GlideHandler { // If glide button isn't held if !ecs_data.inputs.glide.is_pressed() { - update.character = CharacterState { - action_state: Idle, - move_state: Fall(FallHandler), - }; + update.character.move_state = Fall(FallHandler); return update; } // If there is a wall in front of character go to climb else if let Some(_wall_dir) = ecs_data.physics.on_wall { - update.character = CharacterState { - action_state: Idle, - move_state: Climb(ClimbHandler), - }; + update.character.move_state = Climb(ClimbHandler); return update; } // If on ground go to stand if ecs_data.physics.on_ground { - update.character = CharacterState { - action_state: Idle, - move_state: Stand(StandHandler), - }; + update.character.move_state = Stand(StandHandler); return update; } // Otherwise keep gliding - update.character = CharacterState { - action_state: Idle, - move_state: Glide(GlideHandler), - }; - return update; } } diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index 0f48e33c92..5794ee78c1 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -1,12 +1,12 @@ -use super::{CharacterState, ECSStateData, ECSStateUpdate, FallHandler, MoveState::*, StateHandle}; +use super::{EcsCharacterState, EcsStateUpdate, FallHandler, MoveState::*, StateHandle}; use crate::event::LocalEvent; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct JumpHandler; impl StateHandle for JumpHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -18,10 +18,7 @@ impl StateHandle for JumpHandler { .emitter() .emit(LocalEvent::Jump(*ecs_data.entity)); - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Fall(FallHandler), - }; + update.character.move_state = Fall(FallHandler); return update; } diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 77e32be07a..dff9ec53ae 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -50,17 +50,17 @@ pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; // Public interface, wires character states to their handlers. use super::{ - ActionState, ActionState::*, AttackKind::*, BlockKind::*, CharacterState, DodgeKind::*, - ECSStateData, ECSStateUpdate, MoveState, MoveState::*, + ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsCharacterState, + EcsStateUpdate, MoveState, MoveState::*, }; pub trait StateHandle { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate; + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate; } impl StateHandle for ActionState { /// Passes handle to variant or subvariant handlers - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { match self { Attack(kind) => match kind { BasicAttack(handler) => handler.handle(ecs_data), @@ -73,7 +73,7 @@ impl StateHandle for ActionState { Roll(handler) => handler.handle(ecs_data), }, Wield(handler) => handler.handle(ecs_data), - Idle => ECSStateUpdate { + Idle => EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -87,7 +87,7 @@ impl StateHandle for ActionState { impl StateHandle for MoveState { /// Passes handle to variant handlers - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { match self { Stand(handler) => handler.handle(&ecs_data), Run(handler) => handler.handle(&ecs_data), diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 2759a10653..fb7285759e 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,6 +1,10 @@ -use super::{ECSStateData, ECSStateUpdate, StateHandle}; +use super::{ROLL_SPEED, TEMP_EQUIP_DELAY}; +use crate::comp::{ + ActionState::*, DodgeKind::*, EcsCharacterState, EcsStateUpdate, ItemKind::Tool, OverrideMove, + StateHandle, WieldHandler, +}; use std::time::Duration; - +use vek::Vec3; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct RollHandler { /// How long the state has until exitting @@ -8,12 +12,55 @@ pub struct RollHandler { } impl StateHandle for RollHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + }; + + // Prevent move state handling, handled here + ecs_data.updater.insert(*ecs_data.entity, OverrideMove); + + // Update velocity + update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) + + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) + + 1.5 + * ecs_data + .inputs + .move_dir + .try_normalized() + .unwrap_or_default()) + .try_normalized() + .unwrap_or_default() + * ROLL_SPEED; + + // Check if roll duration has expired + if self.remaining_duration == Duration::default() { + // If so, go back to wielding or idling + update.character.action_state = if let Some(Tool { .. }) = + ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) + { + Wield(WieldHandler { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle + }; + + ecs_data.updater.remove::(*ecs_data.entity); + return update; } + + // Otherwise, tick down remaining_duration, and keep rolling + update.character.action_state = Dodge(Roll(RollHandler { + remaining_duration: self + .remaining_duration + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(), + })); + + return update; } } diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index 80ee1f0c5d..c6ef09d711 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -1,6 +1,6 @@ use super::{ - ActionState::*, CharacterState, ClimbHandler, ECSStateData, ECSStateUpdate, FallHandler, - GlideHandler, JumpHandler, MoveState::*, SitHandler, StandHandler, StateHandle, SwimHandler, + ClimbHandler, EcsCharacterState, EcsStateUpdate, FallHandler, GlideHandler, JumpHandler, + MoveState::*, SitHandler, StandHandler, StateHandle, SwimHandler, }; use super::{HUMANOID_ACCEL, HUMANOID_SPEED}; use vek::vec::{Vec2, Vec3}; @@ -9,8 +9,8 @@ use vek::vec::{Vec2, Vec3}; pub struct RunHandler; impl StateHandle for RunHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -48,10 +48,7 @@ impl StateHandle for RunHandler { && ecs_data.physics.on_ground && ecs_data.body.is_humanoid() { - update.character = CharacterState { - action_state: Idle, - move_state: Sit(SitHandler), - }; + update.character.move_state = Sit(SitHandler); return update; } @@ -62,20 +59,14 @@ impl StateHandle for RunHandler { && ecs_data.body.is_humanoid(), ecs_data.physics.on_wall, ) { - update.character = CharacterState { - action_state: Idle, - move_state: Climb(ClimbHandler), - }; + update.character.move_state = Climb(ClimbHandler); return update; } // Try to swim if !ecs_data.physics.on_ground && ecs_data.physics.in_fluid { - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Swim(SwimHandler), - }; + update.character.move_state = Swim(SwimHandler); return update; } @@ -84,18 +75,10 @@ impl StateHandle for RunHandler { if ecs_data.physics.on_ground { // Try to jump if ecs_data.inputs.jump.is_pressed() && !ecs_data.inputs.jump.is_held_down() { - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Jump(JumpHandler), - }; + update.character.move_state = Jump(JumpHandler); return update; } - - // Try to dodge - if ecs_data.inputs.roll.is_pressed() && ecs_data.body.is_humanoid() { - // updater.insert(entity, DodgeStart); - } } // While not on ground ... else { @@ -105,33 +88,21 @@ impl StateHandle for RunHandler { && !ecs_data.inputs.glide.is_held_down() && ecs_data.body.is_humanoid() { - update.character = CharacterState { - action_state: Idle, - move_state: Glide(GlideHandler), - }; + update.character.move_state = Glide(GlideHandler); return update; } - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Fall(FallHandler), - }; + update.character.move_state = Fall(FallHandler); return update; } if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Run(RunHandler), - }; + update.character.move_state = Run(RunHandler); return update; } else { - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Stand(StandHandler), - }; + update.character.move_state = Stand(StandHandler); return update; } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 5634b1fb21..046acc405e 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -1,76 +1,66 @@ -use super::{ - ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, FallHandler, JumpHandler, - MoveState::*, RunHandler, StandHandler, StateHandle, SwimHandler, +use crate::comp::{ + ActionState::*, EcsCharacterState, EcsStateUpdate, FallHandler, JumpHandler, MoveState::*, + RunHandler, StandHandler, StateHandle, SwimHandler, }; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct SitHandler; impl StateHandle for SitHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, }; + // Prevent action state handling + update.character.action_disabled = true; + update.character.action_state = Idle; + update.character.move_state = Sit(SitHandler); + // Falling // Idk, maybe the ground disappears, // suddenly maybe a water spell appears. // Can't hurt to be safe :shrug: if !ecs_data.physics.on_ground { if ecs_data.physics.in_fluid { - update.character = CharacterState { - action_state: Idle, - move_state: Swim(SwimHandler), - }; + update.character.move_state = Swim(SwimHandler); + update.character.action_disabled = false; return update; } else { - update.character = CharacterState { - action_state: Idle, - move_state: Fall(FallHandler), - }; + update.character.move_state = Fall(FallHandler); + update.character.action_disabled = false; return update; } } // Jumping if ecs_data.inputs.jump.is_pressed() { - update.character = CharacterState { - action_state: Idle, - move_state: Jump(JumpHandler), - }; + update.character.move_state = Jump(JumpHandler); + update.character.action_disabled = false; return update; } // Moving if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character = CharacterState { - action_state: Idle, - move_state: Run(RunHandler), - }; + update.character.move_state = Run(RunHandler); + update.character.action_disabled = false; return update; } // Standing back up (unsitting) if ecs_data.inputs.sit.is_just_pressed() { - update.character = CharacterState { - action_state: Idle, - move_state: Stand(StandHandler), - }; + update.character.move_state = Stand(StandHandler); + update.character.action_disabled = false; return update; } - // no move_state has occurred - update.character = CharacterState { - action_state: Idle, - move_state: Sit(SitHandler), - }; - + // No move has occurred, keep sitting return update; } } diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index fb42b04f12..b4d1402052 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -1,13 +1,13 @@ use super::{ - ActionState::*, CharacterState, ClimbHandler, ECSStateData, ECSStateUpdate, FallHandler, - GlideHandler, JumpHandler, MoveState::*, RunHandler, SitHandler, StateHandle, SwimHandler, + ClimbHandler, EcsCharacterState, EcsStateUpdate, FallHandler, GlideHandler, JumpHandler, + MoveState::*, RunHandler, SitHandler, StateHandle, SwimHandler, }; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct StandHandler; impl StateHandle for StandHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -19,10 +19,7 @@ impl StateHandle for StandHandler { && ecs_data.physics.on_ground && ecs_data.body.is_humanoid() { - update.character = CharacterState { - move_state: Sit(SitHandler), - action_state: update.character.action_state, - }; + update.character.move_state = Sit(SitHandler); return update; } @@ -33,20 +30,14 @@ impl StateHandle for StandHandler { && ecs_data.body.is_humanoid(), ecs_data.physics.on_wall, ) { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Climb(ClimbHandler), - }; + update.character.move_state = Climb(ClimbHandler); return update; } // Try to swim if !ecs_data.physics.on_ground && ecs_data.physics.in_fluid { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Swim(SwimHandler), - }; + update.character.move_state = Swim(SwimHandler); return update; } @@ -55,64 +46,33 @@ impl StateHandle for StandHandler { if ecs_data.physics.on_ground { // Try to jump if ecs_data.inputs.jump.is_pressed() { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Jump(JumpHandler), - }; + update.character.move_state = Jump(JumpHandler); return update; } - - // // Try to charge - // if inputs.charge.is_pressed() && !inputs.charge.is_held_down() { - // } - - // Try to roll - if ecs_data.inputs.roll.is_pressed() && ecs_data.body.is_humanoid() { - // updater.insert(entity, DodgeStart); - } } // While not on ground ... else { // Try to glide if ecs_data.physics.on_wall == None && ecs_data.inputs.glide.is_pressed() - && !ecs_data.inputs.glide.is_held_down() && ecs_data.body.is_humanoid() { - update.character = CharacterState { - action_state: Idle, - move_state: Glide(GlideHandler), - }; + update.character.move_state = Glide(GlideHandler); return update; } - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Fall(FallHandler), - }; + update.character.move_state = Fall(FallHandler); return update; } - if ecs_data.inputs.primary.is_pressed() { - // updater.insert(entity, PrimaryStart); - } else if ecs_data.inputs.secondary.is_pressed() { - // updater.insert(entity, SecondaryStart); - } - if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Run(RunHandler), - }; + update.character.move_state = Run(RunHandler); return update; } else { - update.character = CharacterState { - action_state: update.character.action_state, - move_state: Stand(StandHandler), - }; + update.character.move_state = Stand(StandHandler); return update; } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index 2a864c0a38..4595e5f78d 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -1,6 +1,5 @@ use super::{ - CharacterState, ECSStateData, ECSStateUpdate, MoveState::*, RunHandler, StandHandler, - StateHandle, + EcsCharacterState, EcsStateUpdate, MoveState::*, RunHandler, StandHandler, StateHandle, }; use super::{HUMANOID_WATER_ACCEL, HUMANOID_WATER_SPEED}; use crate::sys::phys::GRAVITY; @@ -10,8 +9,8 @@ use vek::{Vec2, Vec3}; pub struct SwimHandler; impl StateHandle for SwimHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -52,31 +51,19 @@ impl StateHandle for SwimHandler { (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); } - if ecs_data.inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if ecs_data.inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - // Not on ground if !ecs_data.physics.on_ground { - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: Swim(SwimHandler), - }; + update.character.move_state = Swim(SwimHandler); return update; } // On ground else { // Return to running or standing based on move inputs - update.character = CharacterState { - action_state: ecs_data.character.action_state, - move_state: if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunHandler) - } else { - Stand(StandHandler) - }, + update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunHandler) + } else { + Stand(StandHandler) }; return update; diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index a0e55ee56f..ebc5b64a29 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,4 +1,4 @@ -use super::{ActionState::*, CharacterState, ECSStateData, ECSStateUpdate, StateHandle}; +use super::{ActionState::*, EcsCharacterState, EcsStateUpdate, StateHandle}; use std::time::Duration; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -9,42 +9,42 @@ pub struct WieldHandler { } impl StateHandle for WieldHandler { - fn handle(&self, ecs_data: &ECSStateData) -> ECSStateUpdate { - let mut update = ECSStateUpdate { + fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + let mut update = EcsStateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, }; - // Toggling Weapons - if ecs_data.inputs.toggle_wield.is_pressed() - && ecs_data.character.action_state.is_equip_finished() - { - update.character = CharacterState { - action_state: Idle, - move_state: ecs_data.character.move_state, - }; + // Only act once equip_delay has expired + if self.equip_delay == Duration::default() { + // Toggle Weapons + if ecs_data.inputs.toggle_wield.is_pressed() + && ecs_data.character.action_state.is_equip_finished() + { + update.character.action_state = Idle; - return update; + return update; + } + + // Try weapon actions + if ecs_data.inputs.primary.is_pressed() { + // TODO: PrimaryStart + } else if ecs_data.inputs.secondary.is_pressed() { + // TODO: SecondaryStart + } } - - if ecs_data.inputs.primary.is_pressed() { - // TODO: PrimaryStart - } else if ecs_data.inputs.secondary.is_pressed() { - // TODO: SecondaryStart - } - - // Update wield delay - update.character = CharacterState { - action_state: Wield(WieldHandler { + // Equip delay hasn't expired yet + else { + // Update wield delay + update.character.action_state = Wield(WieldHandler { equip_delay: self .equip_delay .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - }), - move_state: ecs_data.character.move_state, - }; + }); + } return update; } diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index a99e904b71..bf14498cc4 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,6 @@ use crate::comp::{ Agent, CharacterState, Controller, ControllerInputs, GlideHandler, MountState, - MoveState::Glide, Pos, SitHandler, Stats, + MoveState::Glide, Pos, Stats, }; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index ab1c754aaf..65138ce500 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,8 +1,8 @@ use crate::{ comp::{ - Body, CharacterState, Controller, ControllerInputs, ECSStateData, Mounting, MoveState::*, - Ori, OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitHandler, - StateHandle, Stats, Vel, + Body, CharacterState, Controller, EcsCharacterState, Mounting, MoveState::*, Ori, + OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitHandler, StateHandle, + Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -41,7 +41,7 @@ impl<'a> System<'a> for Sys { &mut self, ( entities, - uid_allocator, + _uid_allocator, server_bus, local_bus, dt, @@ -65,9 +65,9 @@ impl<'a> System<'a> for Sys { entity, uid, mut character, - mut pos, - mut vel, - mut ori, + pos, + vel, + ori, controller, stats, body, @@ -108,15 +108,15 @@ impl<'a> System<'a> for Sys { continue; } // If mounted, character state is controlled by mount - // TODO: Make mounting a stater + // TODO: Make mounting a state if maybe_mount.is_some() { character.move_state = Sit(SitHandler); continue; } // Determine new move state if can move - if !maybe_move_override.is_some() { - let state_update = character.move_state.handle(&ECSStateData { + if !maybe_move_override.is_some() && !character.move_disabled { + let state_update = character.move_state.handle(&EcsCharacterState { entity: &entity, uid, character, @@ -140,8 +140,8 @@ impl<'a> System<'a> for Sys { } // Determine new action if can_act - if !maybe_action_override.is_some() { - let state_update = character.action_state.handle(&ECSStateData { + if !maybe_action_override.is_some() && !character.action_disabled { + let state_update = character.action_state.handle(&EcsCharacterState { entity: &entity, uid, character, @@ -163,24 +163,6 @@ impl<'a> System<'a> for Sys { *vel = state_update.vel; *ori = state_update.ori; } - - // Rolling + Any Movement, prioritizes finishing charge - // over move_state states - // ( - // Roll { - // time_left, - // was_wielding, - // }, - // _, - // ) => { - // if time_left == Duration::default() { - // if was_wielding { - // character.action = try_wield(stats); - // } else { - // character.action = Idle; - // } - // } - // } } } } diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index 2af37f4fb8..627649a022 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -25,11 +25,10 @@ impl<'a> System<'a> for Sys { ); fn run( &mut self, - (entities, uid_allocator, server_bus, local_bus, dt, mut controllers, uids): Self::SystemData, + (entities, uid_allocator, server_bus, _local_bus, _dt, mut controllers, uids): Self::SystemData, ) { let mut server_emitter = server_bus.emitter(); - let mut local_emitter = local_bus.emitter(); - for (entity, uid, controller) in (&entities, &uids, &mut controllers).join() { + for (entity, _uid, controller) in (&entities, &uids, &mut controllers).join() { let inputs = &mut controller.inputs; // Update `inputs.move_dir`. From ca4449725829425f04de0b81bd8057084fdf7db7 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sat, 28 Dec 2019 08:10:39 -0800 Subject: [PATCH 007/387] Add movement_utils --- common/src/comp/character_state.rs | 80 ++++++++++++++++------ common/src/comp/mod.rs | 4 +- common/src/comp/states/basic_attack.rs | 29 +++----- common/src/comp/states/basic_block.rs | 30 +++------ common/src/comp/states/charge_attack.rs | 48 ++++--------- common/src/comp/states/climb.rs | 20 +++--- common/src/comp/states/fall.rs | 51 +++++--------- common/src/comp/states/glide.rs | 36 +++++----- common/src/comp/states/idle.rs | 35 ++++++++++ common/src/comp/states/jump.rs | 14 ++-- common/src/comp/states/mod.rs | 45 ++++++------- common/src/comp/states/roll.rs | 37 ++++------ common/src/comp/states/run.rs | 79 +++++++--------------- common/src/comp/states/sit.rs | 53 ++++++--------- common/src/comp/states/stand.rs | 79 +++++++--------------- common/src/comp/states/swim.rs | 21 +++--- common/src/comp/states/wield.rs | 20 +++--- common/src/sys/agent.rs | 6 +- common/src/sys/character_state.rs | 10 +-- common/src/sys/movement.rs | 6 +- common/src/util/mod.rs | 19 ++++++ common/src/util/movement_utils.rs | 89 +++++++++++++++++++++++++ voxygen/src/audio/sfx/event_mapper.rs | 54 +++++++++------ 23 files changed, 454 insertions(+), 411 deletions(-) create mode 100644 common/src/comp/states/idle.rs create mode 100644 common/src/util/movement_utils.rs diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index b0e57ac12c..5f1896e4e3 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -10,7 +10,7 @@ use specs::{Component, Entity, FlaggedStorage, HashMapStorage, NullStorage}; use sphynx::Uid; use std::time::Duration; -pub struct EcsCharacterState<'a> { +pub struct EcsStateData<'a> { pub entity: &'a Entity, pub uid: &'a Uid, pub character: &'a CharacterState, @@ -27,7 +27,7 @@ pub struct EcsCharacterState<'a> { pub local_bus: &'a EventBus, } -pub struct EcsStateUpdate { +pub struct StateUpdate { pub character: CharacterState, pub pos: Pos, pub vel: Vel, @@ -36,52 +36,52 @@ pub struct EcsStateUpdate { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum MoveState { - Stand(StandHandler), - Run(RunHandler), - Sit(SitHandler), - Jump(JumpHandler), - Fall(FallHandler), - Glide(GlideHandler), - Swim(SwimHandler), - Climb(ClimbHandler), + Stand(StandState), + Run(RunState), + Sit(SitState), + Jump(JumpState), + Fall(FallState), + Glide(GlideState), + Swim(SwimState), + Climb(ClimbState), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum ActionState { - Idle, - Wield(WieldHandler), + Idle(IdleState), + Wield(WieldState), Attack(AttackKind), Block(BlockKind), Dodge(DodgeKind), - // Interact, + // Interact?, } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum AttackKind { - BasicAttack(BasicAttackHandler), - Charge(ChargeAttackHandler), + BasicAttack(BasicAttackState), + Charge(ChargeAttackState), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum BlockKind { - BasicBlock(BasicBlockHandler), + BasicBlock(BasicBlockState), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum DodgeKind { - Roll(RollHandler), + Roll(RollState), } impl ActionState { pub fn is_equip_finished(&self) -> bool { match self { - Wield(WieldHandler { equip_delay }) => *equip_delay == Duration::default(), + Wield(WieldState { equip_delay }) => *equip_delay == Duration::default(), _ => true, } } pub fn get_delay(&self) -> Duration { match self { - Wield(WieldHandler { equip_delay }) => *equip_delay, + Wield(WieldState { equip_delay }) => *equip_delay, _ => Duration::default(), } } @@ -115,7 +115,7 @@ impl ActionState { } } pub fn is_idling(&self) -> bool { - if let Idle = self { + if let Idle(_) = self { true } else { false @@ -125,22 +125,40 @@ impl ActionState { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct CharacterState { + /// __How the character is currently moving, e.g. Running, Standing, Falling.__ + /// + /// _Primarily `handle()`s updating `Pos`, `Vel`, `Ori`, and lower body animations. + /// Can be overidden by `ActionState`s using `move_disabled` flag. Example: `ChargeAttackState`_ pub move_state: MoveState, + + /// __How the character is currently acting, e.g. Wielding, Attacking, Dodging.__ + /// + /// _Primarily `handle()`s how character interacts with world, and upper body animations. + /// Can be overidden by `MoveState`s using `action_disabled` flag. Example: `GlideState`_ pub action_state: ActionState, + + /// Used by `move_state` to disable `action_state` `handle()` calls. pub action_disabled: bool, + + /// Used by `action_state` to disable `move_state` `handle()` calls. pub move_disabled: bool, } impl CharacterState { + /// __Compares `move_state`s for shallow equality (does not check internal struct equality)__ pub fn is_same_move_state(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(&self.move_state) == std::mem::discriminant(&other.move_state) } + /// __Compares `action_state`s for shallow equality (does not check internal struct equality)__ pub fn is_same_action_state(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(&self.action_state) == std::mem::discriminant(&other.action_state) } + + /// __Compares both `move_state`s and `action_state`a for shallow equality + /// (does not check internal struct equality)__ pub fn is_same_state(&self, other: &Self) -> bool { self.is_same_move_state(other) && self.is_same_action_state(other) } @@ -149,8 +167,8 @@ impl CharacterState { impl Default for CharacterState { fn default() -> Self { Self { - move_state: MoveState::Fall(FallHandler), - action_state: ActionState::Idle, + move_state: MoveState::Fall(FallState), + action_state: ActionState::Idle(IdleState), action_disabled: false, move_disabled: false, } @@ -178,3 +196,21 @@ pub struct OverrideMove; impl Component for OverrideMove { type Storage = FlaggedStorage>; } + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub enum StartAction { + Primary, + Secondary, + Tertiary, + Four, + Five, +} +impl Default for StartAction { + fn default() -> Self { + Self::Primary + } +} + +impl Component for StartAction { + type Storage = FlaggedStorage>; +} diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index e1bca6cde3..cc446bd6b6 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -22,8 +22,8 @@ pub use body::{ quadruped_medium, quadruped_small, Body, }; pub use character_state::{ - ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, EcsCharacterState, - EcsStateUpdate, MoveState, OverrideAction, OverrideMove, OverrideState, + ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, EcsStateData, MoveState, + OverrideAction, OverrideMove, OverrideState, StateUpdate, }; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 366e177b88..14ec2e2e30 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -1,22 +1,18 @@ -use super::TEMP_EQUIP_DELAY; use crate::comp::{ - ActionState::{Attack, Idle, Wield}, - AttackKind::BasicAttack, - EcsCharacterState, EcsStateUpdate, - ItemKind::Tool, - StateHandle, WieldHandler, + ActionState::Attack, AttackKind::BasicAttack, EcsStateData, StateHandle, StateUpdate, }; +use crate::util::movement_utils::*; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct BasicAttackHandler { +pub struct BasicAttackState { /// How long the state has until exitting remaining_duration: Duration, } -impl StateHandle for BasicAttackHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for BasicAttackState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -26,21 +22,12 @@ impl StateHandle for BasicAttackHandler { // Check if attack duration has expired if self.remaining_duration == Duration::default() { // If so, go back to wielding or idling - update.character.action_state = if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }; - + update.character.action_state = attempt_wield(ecs_data.stats); return update; } // Otherwise, tick down remaining_duration, and keep rolling - update.character.action_state = Attack(BasicAttack(BasicAttackHandler { + update.character.action_state = Attack(BasicAttack(BasicAttackState { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index 30d5ff4fe2..1ae98a683e 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -1,22 +1,18 @@ -use super::{BLOCK_ACCEL, BLOCK_SPEED, TEMP_EQUIP_DELAY}; -use crate::comp::{ - ActionState::{Idle, Wield}, - EcsCharacterState, EcsStateUpdate, - ItemKind::Tool, - StateHandle, WieldHandler, -}; +use super::{BLOCK_ACCEL, BLOCK_SPEED}; +use crate::comp::{EcsStateData, StateHandle, StateUpdate}; +use crate::util::movement_utils::*; use std::time::Duration; use vek::Vec2; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct BasicBlockHandler { +pub struct BasicBlockState { /// How long the blocking state has been active active_duration: Duration, } -impl StateHandle for BasicBlockHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for BasicBlockState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -24,6 +20,7 @@ impl StateHandle for BasicBlockHandler { }; // TODO: Apply simple move speed debuff instead + update.character.move_disabled = true; // Update movement update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -34,16 +31,7 @@ impl StateHandle for BasicBlockHandler { }; if !ecs_data.inputs.secondary.is_pressed() { - update.character.action_state = if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }; - + update.character.action_state = attempt_wield(ecs_data.stats); update.character.move_disabled = false; return update; } diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index d80ffad2e5..fbfb9e93ef 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -1,26 +1,23 @@ use crate::comp::{ - ActionState::{Attack, Idle, Wield}, - AttackKind::Charge, - EcsCharacterState, EcsStateUpdate, HealthChange, HealthSource, - ItemKind::Tool, - MoveState::Run, - RunHandler, StateHandle, WieldHandler, + ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, + MoveState::Run, RunState, StateHandle, StateUpdate, }; use crate::event::ServerEvent; +use crate::util::movement_utils::*; use std::time::Duration; use vek::Vec3; -use super::{CHARGE_SPEED, TEMP_EQUIP_DELAY}; +use super::CHARGE_SPEED; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct ChargeAttackHandler { +pub struct ChargeAttackState { /// How long the state has until exitting pub remaining_duration: Duration, } -impl StateHandle for ChargeAttackHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for ChargeAttackState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -30,8 +27,7 @@ impl StateHandle for ChargeAttackHandler { // Prevent move state handling, handled here // ecs_data.updater.insert(*ecs_data.entity, OverrideMove); update.character.action_disabled = true; - - update.character.move_state = Run(RunHandler); + update.character.move_state = Run(RunState); // Move player update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) @@ -57,17 +53,8 @@ impl StateHandle for ChargeAttackHandler { }, }); - // Go back to wielding - update.character.action_state = if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }; - + // Go back to wielding or idling + update.character.action_state = attempt_wield(ecs_data.stats); update.character.move_disabled = false; return update; } @@ -75,22 +62,13 @@ impl StateHandle for ChargeAttackHandler { // Check if charge timed out or can't keep moving forward if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { - update.character.action_state = if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }; - + update.character.action_state = attempt_wield(ecs_data.stats); update.character.move_disabled = false; return update; } // Tick remaining-duration and keep charging - update.character.action_state = Attack(Charge(ChargeAttackHandler { + update.character.action_state = Attack(Charge(ChargeAttackState { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index e7ad8d55c9..6f13212c9c 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -1,6 +1,6 @@ use super::{ - ActionState::*, EcsCharacterState, EcsStateUpdate, FallHandler, JumpHandler, MoveState::*, - StandHandler, StateHandle, + ActionState::*, EcsStateData, FallState, IdleState, JumpState, MoveState::*, StandState, + StateHandle, StateUpdate, }; use super::{CLIMB_SPEED, HUMANOID_CLIMB_ACCEL, HUMANOID_SPEED}; use crate::sys::phys::GRAVITY; @@ -8,11 +8,11 @@ use vek::vec::{Vec2, Vec3}; use vek::Lerp; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct ClimbHandler; +pub struct ClimbState; -impl StateHandle for ClimbHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for ClimbState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -20,7 +20,7 @@ impl StateHandle for ClimbHandler { }; // Disable actions in this state - update.character.action_state = Idle; + update.character.action_state = Idle(IdleState); update.character.action_disabled = true; // Move player @@ -80,13 +80,13 @@ impl StateHandle for ClimbHandler { if let None = ecs_data.physics.on_wall { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost - update.character.move_state = Jump(JumpHandler); + update.character.move_state = Jump(JumpState); update.character.action_disabled = false; return update; } else { // Just fall off - update.character.move_state = Fall(FallHandler); + update.character.move_state = Fall(FallState); update.character.action_disabled = false; return update; @@ -95,7 +95,7 @@ impl StateHandle for ClimbHandler { // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { - update.character.move_state = Stand(StandHandler); + update.character.move_state = Stand(StandState); update.character.action_disabled = false; return update; } diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index c140bea677..78b68cc7f7 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -1,16 +1,15 @@ -use super::{ - EcsCharacterState, EcsStateUpdate, GlideHandler, MoveState::*, RunHandler, StandHandler, - StateHandle, SwimHandler, -}; use super::{HUMANOID_AIR_ACCEL, HUMANOID_AIR_SPEED}; +use crate::comp::{ClimbState, EcsStateData, GlideState, MoveState::*, StateHandle, StateUpdate}; + +use crate::util::movement_utils::*; use vek::{Vec2, Vec3}; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct FallHandler; +pub struct FallState; -impl StateHandle for FallHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for FallState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -43,36 +42,22 @@ impl StateHandle for FallHandler { vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 2.0 * ecs_data.dt.0); } + // Check to start climbing + if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Climb(ClimbState); + return update; + } + // Check gliding if ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Glide(GlideHandler); - + update.character.move_state = Glide(GlideState); return update; } - // Not on ground, go to swim or fall - if !ecs_data.physics.on_ground { - // Check if in fluid to go to swimming or back to falling - if ecs_data.physics.in_fluid { - update.character.move_state = Swim(SwimHandler); + // Else update based on groundedness + update.character.move_state = + determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - return update; - } else { - update.character.move_state = Fall(FallHandler); - - return update; - } - } - // On ground - else { - // Return to running or standing based on move inputs - update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunHandler) - } else { - Stand(StandHandler) - }; - - return update; - } + return update; } } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index d709ced47e..f84ca53d5d 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -1,16 +1,16 @@ -use super::{ - ActionState::*, ClimbHandler, EcsCharacterState, EcsStateUpdate, FallHandler, MoveState::*, - StandHandler, StateHandle, -}; use super::{GLIDE_ACCEL, GLIDE_ANTIGRAV, GLIDE_SPEED}; +use crate::comp::{ + ActionState::*, ClimbState, EcsStateData, FallState, IdleState, MoveState::*, StandState, + StateHandle, StateUpdate, +}; use vek::{Vec2, Vec3}; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct GlideHandler; +pub struct GlideState; -impl StateHandle for GlideHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for GlideState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, @@ -20,8 +20,9 @@ impl StateHandle for GlideHandler { // Prevent action in this state, set here update.character.action_disabled = true; - update.character.action_state = Idle; - update.character.move_state = Glide(GlideHandler); + // Defaults for this state + update.character.action_state = Idle(IdleState); + update.character.move_state = Glide(GlideState); // Move player according to movement direction vector update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -54,22 +55,21 @@ impl StateHandle for GlideHandler { .max(0.2); } - // If glide button isn't held + // If glide button isn't held, start falling if !ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Fall(FallHandler); - + update.character.move_state = Fall(FallState); return update; } + // If there is a wall in front of character go to climb - else if let Some(_wall_dir) = ecs_data.physics.on_wall { - update.character.move_state = Climb(ClimbHandler); - + if let Some(_wall_dir) = ecs_data.physics.on_wall { + update.character.move_state = Climb(ClimbState); return update; } + // If on ground go to stand if ecs_data.physics.on_ground { - update.character.move_state = Stand(StandHandler); - + update.character.move_state = Stand(StandState); return update; } diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs new file mode 100644 index 0000000000..9f1c4aa352 --- /dev/null +++ b/common/src/comp/states/idle.rs @@ -0,0 +1,35 @@ +use super::TEMP_EQUIP_DELAY; +use crate::comp::{ + ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandle, StateUpdate, WieldState, +}; +use std::time::Duration; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct IdleState; + +impl StateHandle for IdleState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + // Try to wield + if ecs_data.inputs.toggle_wield.is_pressed() + || ecs_data.inputs.primary.is_pressed() + || ecs_data.inputs.secondary.is_pressed() + { + if let Some(Tool { .. }) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + update.character.action_state = Wield(WieldState { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } + + // else unarmed stuff? + } + + return update; + } +} diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index 5794ee78c1..e3af3f9253 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -1,12 +1,12 @@ -use super::{EcsCharacterState, EcsStateUpdate, FallHandler, MoveState::*, StateHandle}; +use super::{EcsStateData, FallState, MoveState::*, StateHandle, StateUpdate}; use crate::event::LocalEvent; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct JumpHandler; +pub struct JumpState; -impl StateHandle for JumpHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for JumpState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -18,8 +18,8 @@ impl StateHandle for JumpHandler { .emitter() .emit(LocalEvent::Jump(*ecs_data.entity)); - update.character.move_state = Fall(FallHandler); - + // Immediately go to falling state after jump impulse + update.character.move_state = Fall(FallState); return update; } } diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index dff9ec53ae..e26e30df80 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -5,6 +5,7 @@ mod charge_attack; mod climb; mod fall; mod glide; +mod idle; mod jump; mod roll; mod run; @@ -20,6 +21,7 @@ pub use charge_attack::*; pub use climb::*; pub use fall::*; pub use glide::*; +pub use idle::*; pub use jump::*; pub use roll::*; pub use run::*; @@ -50,35 +52,30 @@ pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; // Public interface, wires character states to their handlers. use super::{ - ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsCharacterState, - EcsStateUpdate, MoveState, MoveState::*, + ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, + MoveState, MoveState::*, StateUpdate, }; pub trait StateHandle { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate; + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; } impl StateHandle for ActionState { /// Passes handle to variant or subvariant handlers - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { Attack(kind) => match kind { - BasicAttack(handler) => handler.handle(ecs_data), - Charge(handler) => handler.handle(ecs_data), + BasicAttack(state) => state.handle(ecs_data), + Charge(state) => state.handle(ecs_data), }, Block(kind) => match kind { - BasicBlock(handler) => handler.handle(ecs_data), + BasicBlock(state) => state.handle(ecs_data), }, Dodge(kind) => match kind { - Roll(handler) => handler.handle(ecs_data), - }, - Wield(handler) => handler.handle(ecs_data), - Idle => EcsStateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, + Roll(state) => state.handle(ecs_data), }, + Wield(state) => state.handle(ecs_data), + Idle(state) => state.handle(ecs_data), // All states should be explicitly handled // Do not use default match: _ => {}, } @@ -87,16 +84,16 @@ impl StateHandle for ActionState { impl StateHandle for MoveState { /// Passes handle to variant handlers - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { - Stand(handler) => handler.handle(&ecs_data), - Run(handler) => handler.handle(&ecs_data), - Jump(handler) => handler.handle(&ecs_data), - Climb(handler) => handler.handle(&ecs_data), - Glide(handler) => handler.handle(&ecs_data), - Swim(handler) => handler.handle(&ecs_data), - Fall(handler) => handler.handle(&ecs_data), - Sit(handler) => handler.handle(&ecs_data), + Stand(state) => state.handle(&ecs_data), + Run(state) => state.handle(&ecs_data), + Jump(state) => state.handle(&ecs_data), + Climb(state) => state.handle(&ecs_data), + Glide(state) => state.handle(&ecs_data), + Swim(state) => state.handle(&ecs_data), + Fall(state) => state.handle(&ecs_data), + Sit(state) => state.handle(&ecs_data), // All states should be explicitly handled // Do not use default match: _ => {}, } diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index fb7285759e..accae700c7 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,19 +1,18 @@ -use super::{ROLL_SPEED, TEMP_EQUIP_DELAY}; -use crate::comp::{ - ActionState::*, DodgeKind::*, EcsCharacterState, EcsStateUpdate, ItemKind::Tool, OverrideMove, - StateHandle, WieldHandler, -}; +use super::ROLL_SPEED; +use crate::comp::{ActionState::*, DodgeKind::*, EcsStateData, StateHandle, StateUpdate}; +use crate::util::movement_utils::*; use std::time::Duration; use vek::Vec3; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct RollHandler { +pub struct RollState { /// How long the state has until exitting remaining_duration: Duration, } -impl StateHandle for RollHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for RollState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -21,7 +20,7 @@ impl StateHandle for RollHandler { }; // Prevent move state handling, handled here - ecs_data.updater.insert(*ecs_data.entity, OverrideMove); + update.character.move_disabled = true; // Update velocity update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) @@ -39,28 +38,20 @@ impl StateHandle for RollHandler { // Check if roll duration has expired if self.remaining_duration == Duration::default() { // If so, go back to wielding or idling - update.character.action_state = if let Some(Tool { .. }) = - ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) - { - Wield(WieldHandler { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) - } else { - Idle - }; - - ecs_data.updater.remove::(*ecs_data.entity); + update.character.action_state = attempt_wield(ecs_data.stats); + update.character.move_disabled = false; return update; } - // Otherwise, tick down remaining_duration, and keep rolling - update.character.action_state = Dodge(Roll(RollHandler { + // Otherwise, tick down remaining_duration + update.character.action_state = Dodge(Roll(RollState { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), })); + // Keep rolling return update; } } diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index c6ef09d711..bc59b7f472 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -1,16 +1,17 @@ -use super::{ - ClimbHandler, EcsCharacterState, EcsStateUpdate, FallHandler, GlideHandler, JumpHandler, - MoveState::*, SitHandler, StandHandler, StateHandle, SwimHandler, -}; use super::{HUMANOID_ACCEL, HUMANOID_SPEED}; +use crate::comp::{ + ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandle, + StateUpdate, +}; +use crate::util::movement_utils::*; use vek::vec::{Vec2, Vec3}; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct RunHandler; +pub struct RunState; -impl StateHandle for RunHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for RunState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -44,67 +45,33 @@ impl StateHandle for RunHandler { } // Try to sit - if ecs_data.inputs.sit.is_pressed() - && ecs_data.physics.on_ground - && ecs_data.body.is_humanoid() - { - update.character.move_state = Sit(SitHandler); - + if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Sit(SitState); return update; } // Try to climb - if let (true, Some(_wall_dir)) = ( - ecs_data.inputs.climb.is_pressed() | ecs_data.inputs.climb_down.is_pressed() - && ecs_data.body.is_humanoid(), - ecs_data.physics.on_wall, - ) { - update.character.move_state = Climb(ClimbHandler); - + if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Climb(ClimbState); return update; } - // Try to swim - if !ecs_data.physics.on_ground && ecs_data.physics.in_fluid { - update.character.move_state = Swim(SwimHandler); - + // Try to jump + if can_jump(ecs_data.physics, ecs_data.inputs) { + update.character.move_state = Jump(JumpState); return update; } - // While on ground ... - if ecs_data.physics.on_ground { - // Try to jump - if ecs_data.inputs.jump.is_pressed() && !ecs_data.inputs.jump.is_held_down() { - update.character.move_state = Jump(JumpHandler); - - return update; - } - } - // While not on ground ... - else { - // Try to glide - if ecs_data.physics.on_wall == None - && ecs_data.inputs.glide.is_pressed() - && !ecs_data.inputs.glide.is_held_down() - && ecs_data.body.is_humanoid() - { - update.character.move_state = Glide(GlideHandler); - - return update; - } - update.character.move_state = Fall(FallHandler); - + // Try to glide + if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Glide(GlideState); return update; } - if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = Run(RunHandler); + // Update based on groundedness + update.character.move_state = + determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - return update; - } else { - update.character.move_state = Stand(StandHandler); - - return update; - } + return update; } } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 046acc405e..33de69af82 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -1,13 +1,15 @@ use crate::comp::{ - ActionState::*, EcsCharacterState, EcsStateUpdate, FallHandler, JumpHandler, MoveState::*, - RunHandler, StandHandler, StateHandle, SwimHandler, + ActionState::*, EcsStateData, IdleState, JumpState, MoveState::*, RunState, StandState, + StateHandle, StateUpdate, }; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct SitHandler; +use crate::util::movement_utils::*; -impl StateHandle for SitHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct SitState; + +impl StateHandle for SitState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -16,46 +18,35 @@ impl StateHandle for SitHandler { // Prevent action state handling update.character.action_disabled = true; - update.character.action_state = Idle; - update.character.move_state = Sit(SitHandler); + update.character.action_state = Idle(IdleState); + update.character.move_state = Sit(SitState); - // Falling - // Idk, maybe the ground disappears, + // Try to Fall + // ... maybe the ground disappears, // suddenly maybe a water spell appears. // Can't hurt to be safe :shrug: if !ecs_data.physics.on_ground { - if ecs_data.physics.in_fluid { - update.character.move_state = Swim(SwimHandler); - - update.character.action_disabled = false; - return update; - } else { - update.character.move_state = Fall(FallHandler); - - update.character.action_disabled = false; - return update; - } + update.character.move_state = determine_fall_or_swim(ecs_data.physics); + update.character.move_disabled = false; + return update; } - // Jumping + // Try to jump if ecs_data.inputs.jump.is_pressed() { - update.character.move_state = Jump(JumpHandler); - + update.character.move_state = Jump(JumpState); update.character.action_disabled = false; return update; } - // Moving + // Try to Run if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = Run(RunHandler); - + update.character.move_state = Run(RunState); update.character.action_disabled = false; return update; } - // Standing back up (unsitting) + // Try to Stand if ecs_data.inputs.sit.is_just_pressed() { - update.character.move_state = Stand(StandHandler); - + update.character.move_state = Stand(StandState); update.character.action_disabled = false; return update; } diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index b4d1402052..dc16d73af2 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -1,13 +1,15 @@ -use super::{ - ClimbHandler, EcsCharacterState, EcsStateUpdate, FallHandler, GlideHandler, JumpHandler, - MoveState::*, RunHandler, SitHandler, StateHandle, SwimHandler, +use crate::comp::{ + ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandle, + StateUpdate, }; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct StandHandler; +use crate::util::movement_utils::*; -impl StateHandle for StandHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct StandState; + +impl StateHandle for StandState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -15,66 +17,33 @@ impl StateHandle for StandHandler { }; // Try to sit - if ecs_data.inputs.sit.is_pressed() - && ecs_data.physics.on_ground - && ecs_data.body.is_humanoid() - { - update.character.move_state = Sit(SitHandler); - + if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Sit(SitState); return update; } // Try to climb - if let (true, Some(_wall_dir)) = ( - ecs_data.inputs.climb.is_pressed() | ecs_data.inputs.climb_down.is_pressed() - && ecs_data.body.is_humanoid(), - ecs_data.physics.on_wall, - ) { - update.character.move_state = Climb(ClimbHandler); - + if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Climb(ClimbState); return update; } - // Try to swim - if !ecs_data.physics.on_ground && ecs_data.physics.in_fluid { - update.character.move_state = Swim(SwimHandler); - + // Try to jump + if can_jump(ecs_data.physics, ecs_data.inputs) { + update.character.move_state = Jump(JumpState); return update; } - // While on ground ... - if ecs_data.physics.on_ground { - // Try to jump - if ecs_data.inputs.jump.is_pressed() { - update.character.move_state = Jump(JumpHandler); - - return update; - } - } - // While not on ground ... - else { - // Try to glide - if ecs_data.physics.on_wall == None - && ecs_data.inputs.glide.is_pressed() - && ecs_data.body.is_humanoid() - { - update.character.move_state = Glide(GlideHandler); - - return update; - } - update.character.move_state = Fall(FallHandler); - + // Check gliding + if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { + update.character.move_state = Glide(GlideState); return update; } - if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = Run(RunHandler); + // Else update based on groundedness + update.character.move_state = + determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - return update; - } else { - update.character.move_state = Stand(StandHandler); - - return update; - } + return update; } } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index 4595e5f78d..ffaf1b2673 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -1,16 +1,14 @@ -use super::{ - EcsCharacterState, EcsStateUpdate, MoveState::*, RunHandler, StandHandler, StateHandle, -}; use super::{HUMANOID_WATER_ACCEL, HUMANOID_WATER_SPEED}; +use crate::comp::{EcsStateData, MoveState::*, RunState, StandState, StateHandle, StateUpdate}; use crate::sys::phys::GRAVITY; use vek::{Vec2, Vec3}; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct SwimHandler; +pub struct SwimState; -impl StateHandle for SwimHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for SwimState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -46,24 +44,23 @@ impl StateHandle for SwimHandler { ); } - if ecs_data.inputs.jump.is_pressed() { + if ecs_data.inputs.jump.is_pressed() && !ecs_data.inputs.jump.is_held_down() { update.vel.0.z = (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); } // Not on ground if !ecs_data.physics.on_ground { - update.character.move_state = Swim(SwimHandler); - + update.character.move_state = Swim(SwimState); return update; } // On ground else { // Return to running or standing based on move inputs update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunHandler) + Run(RunState) } else { - Stand(StandHandler) + Stand(StandState) }; return update; diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index ebc5b64a29..2f1422c37f 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,16 +1,16 @@ -use super::{ActionState::*, EcsCharacterState, EcsStateUpdate, StateHandle}; +use crate::comp::{ActionState::*, EcsStateData, IdleState, StateHandle, StateUpdate}; use std::time::Duration; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct WieldHandler { +pub struct WieldState { /// How long before a new action can be performed /// after equipping pub equip_delay: Duration, } -impl StateHandle for WieldHandler { - fn handle(&self, ecs_data: &EcsCharacterState) -> EcsStateUpdate { - let mut update = EcsStateUpdate { +impl StateHandle for WieldState { + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -23,8 +23,7 @@ impl StateHandle for WieldHandler { if ecs_data.inputs.toggle_wield.is_pressed() && ecs_data.character.action_state.is_equip_finished() { - update.character.action_state = Idle; - + update.character.action_state = Idle(IdleState); return update; } @@ -34,11 +33,10 @@ impl StateHandle for WieldHandler { } else if ecs_data.inputs.secondary.is_pressed() { // TODO: SecondaryStart } - } - // Equip delay hasn't expired yet - else { + } else { + // Equip delay hasn't expired yet // Update wield delay - update.character.action_state = Wield(WieldHandler { + update.character.action_state = Wield(WieldState { equip_delay: self .equip_delay .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index bf14498cc4..52b1f1e149 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,6 @@ use crate::comp::{ - Agent, CharacterState, Controller, ControllerInputs, GlideHandler, MountState, - MoveState::Glide, Pos, Stats, + Agent, CharacterState, Controller, ControllerInputs, GlideState, MountState, MoveState::Glide, + Pos, Stats, }; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; @@ -163,7 +163,7 @@ impl<'a> System<'a> for Sys { inputs.roll.set_state(true); } - if target_character.move_state == Glide(GlideHandler) + if target_character.move_state == Glide(GlideState) && target_pos.0.z > pos.0.z + 5.0 { inputs.glide.set_state(true); diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 65138ce500..9bf8c48241 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - Body, CharacterState, Controller, EcsCharacterState, Mounting, MoveState::*, Ori, - OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitHandler, StateHandle, + Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, + OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitState, StateHandle, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, @@ -110,13 +110,13 @@ impl<'a> System<'a> for Sys { // If mounted, character state is controlled by mount // TODO: Make mounting a state if maybe_mount.is_some() { - character.move_state = Sit(SitHandler); + character.move_state = Sit(SitState); continue; } // Determine new move state if can move if !maybe_move_override.is_some() && !character.move_disabled { - let state_update = character.move_state.handle(&EcsCharacterState { + let state_update = character.move_state.handle(&EcsStateData { entity: &entity, uid, character, @@ -141,7 +141,7 @@ impl<'a> System<'a> for Sys { // Determine new action if can_act if !maybe_action_override.is_some() && !character.action_disabled { - let state_update = character.action_state.handle(&EcsCharacterState { + let state_update = character.action_state.handle(&EcsStateData { entity: &entity, uid, character, diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index 7a64a996f4..9b8da17f1b 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -1,8 +1,8 @@ use super::phys::GRAVITY; use crate::{ comp::{ - CharacterState, Controller, Mounting, MoveState::*, Ori, PhysicsState, Pos, RunHandler, - StandHandler, Stats, Vel, + CharacterState, Controller, Mounting, MoveState::*, Ori, PhysicsState, Pos, RunState, + StandState, Stats, Vel, }, event::{EventBus, ServerEvent}, state::DeltaTime, @@ -106,7 +106,7 @@ impl<'a> System<'a> for Sys { ) .join() { - // if character.movement == Run(RunHandler) || character.movement == Stand(StandHandler) { + // if character.movement == Run(RunState) || character.movement == Stand(StandState) { // continue; // } diff --git a/common/src/util/mod.rs b/common/src/util/mod.rs index 7ccb111fd9..37ce1a120a 100644 --- a/common/src/util/mod.rs +++ b/common/src/util/mod.rs @@ -7,6 +7,9 @@ lazy_static::lazy_static! { use vek::{Mat3, Rgb, Rgba, Vec3}; +pub mod movement_utils; + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// This is a fast approximation of powf. This should only be used when minor accuracy loss is acceptable. #[inline(always)] #[allow(unsafe_code)] @@ -40,6 +43,7 @@ mod approx_powf_tests { } } +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. #[inline(always)] pub fn srgb_to_linear(col: Rgb) -> Rgb { #[inline(always)] @@ -52,6 +56,8 @@ pub fn srgb_to_linear(col: Rgb) -> Rgb { } col.map(to_linear) } + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. #[inline(always)] pub fn linear_to_srgb(col: Rgb) -> Rgb { #[inline(always)] @@ -64,15 +70,20 @@ pub fn linear_to_srgb(col: Rgb) -> Rgb { } col.map(to_srgb) } + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. #[inline(always)] pub fn srgba_to_linear(col: Rgba) -> Rgba { Rgba::from_translucent(srgb_to_linear(Rgb::from(col)), col.a) } + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. #[inline(always)] pub fn linear_to_srgba(col: Rgba) -> Rgba { Rgba::from_translucent(linear_to_srgb(Rgb::from(col)), col.a) } +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// Convert rgb to hsv. Expects rgb to be [0, 1]. #[inline(always)] pub fn rgb_to_hsv(rgb: Rgb) -> Vec3 { @@ -104,6 +115,8 @@ pub fn rgb_to_hsv(rgb: Rgb) -> Vec3 { Vec3::new(h, s, v) } + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// Convert hsv to rgb. Expects h [0, 360], s [0, 1], v [0, 1] #[inline(always)] pub fn hsv_to_rgb(hsv: Vec3) -> Rgb { @@ -129,6 +142,8 @@ pub fn hsv_to_rgb(hsv: Vec3) -> Rgb { Rgb::new(r + m, g + m, b + m) } + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// Convert linear rgb to CIExyY #[inline(always)] pub fn rgb_to_xyy(rgb: Rgb) -> Vec3 { @@ -140,6 +155,8 @@ pub fn rgb_to_xyy(rgb: Rgb) -> Vec3 { let sum = xyz.sum(); Vec3::new(xyz.x / sum, xyz.y / sum, xyz.y) } + +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// Convert to CIExyY to linear rgb #[inline(always)] pub fn xyy_to_rgb(xyy: Vec3) -> Rgb { @@ -156,6 +173,7 @@ pub fn xyy_to_rgb(xyy: Vec3) -> Rgb { ) } +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. // TO-DO: speed this up #[inline(always)] pub fn saturate_srgb(col: Rgb, value: f32) -> Rgb { @@ -164,6 +182,7 @@ pub fn saturate_srgb(col: Rgb, value: f32) -> Rgb { linear_to_srgb(hsv_to_rgb(hsv).map(|e| e.min(1.0).max(0.0))) } +/// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// Preserves the luma of one color while changing its chromaticty to match the other #[inline(always)] pub fn chromify_srgb(luma: Rgb, chroma: Rgb) -> Rgb { diff --git a/common/src/util/movement_utils.rs b/common/src/util/movement_utils.rs new file mode 100644 index 0000000000..38d8cb7903 --- /dev/null +++ b/common/src/util/movement_utils.rs @@ -0,0 +1,89 @@ +use crate::comp::TEMP_EQUIP_DELAY; +use crate::comp::{ + ActionState, ActionState::*, Body, ControllerInputs, FallState, IdleState, ItemKind::Tool, + MoveState, MoveState::*, PhysicsState, RunState, StandState, Stats, SwimState, WieldState, +}; +use std::time::Duration; + +/// __Returns a `MoveState` based on `in_fluid` condition__ +pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { + // Check if in fluid to go to swimming or back to falling + if physics.in_fluid { + Swim(SwimState) + } else { + Fall(FallState) + } +} +/// __Returns a `MoveState` based on `move_dir` magnitude__ +pub fn determine_stand_or_run(inputs: &ControllerInputs) -> MoveState { + // Return to running or standing based on move inputs + if inputs.move_dir.magnitude_squared() > 0.0 { + Run(RunState) + } else { + Stand(StandState) + } +} + +/// __Returns a `MoveState` based on `on_ground` state.__ +/// +/// _`FallState`, or `SwimState` if not `on_ground`, +/// `StandState` or `RunState` if is `on_ground`_ +pub fn determine_move_from_grounded_state( + physics: &PhysicsState, + inputs: &ControllerInputs, +) -> MoveState { + // Not on ground, go to swim or fall + if !physics.on_ground { + determine_fall_or_swim(physics) + } + // On ground + else { + determine_stand_or_run(inputs) + } +} + +/// __Returns an ActionState based on whether character has a weapon equipped.__ +pub fn attempt_wield(stats: &Stats) -> ActionState { + if let Some(Tool { .. }) = stats.equipment.main.as_ref().map(|i| &i.kind) { + Wield(WieldState { + equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + }) + } else { + Idle(IdleState) + } +} + +pub fn can_climb(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { + if let (true, Some(_wall_dir)) = ( + inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), + physics.on_wall, + ) { + true + } else { + false + } +} + +pub fn can_glide(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { + if inputs.glide.is_pressed() && body.is_humanoid() && physics.on_wall == None { + true + } else { + false + } +} + +pub fn can_sit(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { + if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { + true + } else { + false + } +} + +pub fn can_jump(physics: &PhysicsState, inputs: &ControllerInputs) -> bool { + if physics.on_ground && inputs.jump.is_pressed() { + true + } else { + false + } +} diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 3a3eefcd68..311b8fbb1a 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -5,9 +5,9 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use client::Client; use common::{ comp::{ - ActionState, AttackKind::*, BasicAttackHandler, Body, CharacterState, DodgeKind::*, - FallHandler, GlideHandler, ItemKind, MoveState, Pos, RollHandler, RunHandler, StandHandler, - Stats, + ActionState, AttackKind::*, BasicAttackState, Body, CharacterState, DodgeKind::*, + FallState, GlideState, IdleState, ItemKind, MoveState, Pos, RollState, RunState, + StandState, Stats, }, event::{EventBus, SfxEvent, SfxEventItem}, }; @@ -277,8 +277,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Stand(StandHandler), - action_state: ActionState::Idle, + move_state: MoveState::Stand(StandState), + action_state: ActionState::Idle(IdleState), + action_disabled: false, + move_disabled: false, }, SfxEvent::Idle, &stats, @@ -293,8 +295,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Run(RunHandler), - action_state: ActionState::Idle, + move_state: MoveState::Run(RunState), + action_state: ActionState::Idle(IdleState), + action_disabled: false, + move_disabled: false, }, SfxEvent::Idle, &stats, @@ -309,8 +313,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - action_state: ActionState::Dodge(Roll(RollHandler::default())), - move_state: MoveState::Run(RunHandler), + action_state: ActionState::Dodge(Roll(RollState::default())), + move_state: MoveState::Run(RunState), + action_disabled: false, + move_disabled: true, }, SfxEvent::Run, &stats, @@ -325,8 +331,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Fall(FallHandler), - action_state: ActionState::Idle, + move_state: MoveState::Fall(FallState), + action_state: ActionState::Idle(IdleState), + action_disabled: false, + move_disabled: false, }, SfxEvent::Idle, &stats, @@ -341,8 +349,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Glide(GlideHandler), - action_state: ActionState::Idle, + move_state: MoveState::Glide(GlideState), + action_state: ActionState::Idle(IdleState), + action_disabled: true, + move_disabled: false, }, SfxEvent::Jump, &stats, @@ -357,8 +367,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Glide(GlideHandler), - action_state: ActionState::Idle, + move_state: MoveState::Glide(GlideState), + action_state: ActionState::Idle(IdleState), + action_disabled: true, + move_disabled: false, }, SfxEvent::Glide, &stats, @@ -373,8 +385,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Fall(FallHandler), - action_state: ActionState::Idle, + move_state: MoveState::Fall(FallState), + action_state: ActionState::Idle(IdleState), + move_disabled: false, + action_disabled: false, }, SfxEvent::Glide, &stats, @@ -394,8 +408,10 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Stand(StandHandler), - action_state: ActionState::Attack(BasicAttack(BasicAttackHandler::default())), + move_state: MoveState::Stand(StandState), + action_state: ActionState::Attack(BasicAttack(BasicAttackState::default())), + move_disabled: false, + action_disabled: false, }, SfxEvent::Idle, &stats, From 7a4cdfb7a47c29cb0496a778d2f0bdfba4461489 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sun, 29 Dec 2019 08:36:59 -0800 Subject: [PATCH 008/387] Documentation comments --- common/src/comp/character_state.rs | 23 +--- common/src/comp/states/idle.rs | 5 +- common/src/comp/states/mod.rs | 18 ++- common/src/comp/states/wield.rs | 2 +- common/src/sys/character_state.rs | 179 ++++++++++++++++------------- 5 files changed, 124 insertions(+), 103 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 5f1896e4e3..a3dd2d4e57 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -79,6 +79,8 @@ impl ActionState { _ => true, } } + + /// Returns the current `equip_delay` if in `WieldState`, otherwise `Duration::default()` pub fn get_delay(&self) -> Duration { match self { Wield(WieldState { equip_delay }) => *equip_delay, @@ -123,6 +125,9 @@ impl ActionState { } } +/// __A concurrent state machine that allows for spearate `ActionState`s and `MoveState`s.__ +/// +/// _Each state can optionally override the other through `*_disabled` flag_ #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct CharacterState { /// __How the character is currently moving, e.g. Running, Standing, Falling.__ @@ -196,21 +201,3 @@ pub struct OverrideMove; impl Component for OverrideMove { type Storage = FlaggedStorage>; } - -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum StartAction { - Primary, - Secondary, - Tertiary, - Four, - Five, -} -impl Default for StartAction { - fn default() -> Self { - Self::Primary - } -} - -impl Component for StartAction { - type Storage = FlaggedStorage>; -} diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs index 9f1c4aa352..49f36fe591 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/comp/states/idle.rs @@ -17,9 +17,10 @@ impl StateHandle for IdleState { }; // Try to wield - if ecs_data.inputs.toggle_wield.is_pressed() - || ecs_data.inputs.primary.is_pressed() + if ecs_data.inputs.primary.is_pressed() || ecs_data.inputs.secondary.is_pressed() + || (ecs_data.inputs.toggle_wield.is_just_pressed() + && update.character.action_state.is_equip_finished()) { if let Some(Tool { .. }) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { update.character.action_state = Wield(WieldState { diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index e26e30df80..9c024ebfbc 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -50,16 +50,31 @@ pub const GLIDE_ANTIGRAV: f32 = crate::sys::phys::GRAVITY * 0.96; pub const CLIMB_SPEED: f32 = 5.0; pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; -// Public interface, wires character states to their handlers. use super::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, MoveState, MoveState::*, StateUpdate, }; +/// #### A trait for implementing state `handle()`ing logic. +/// _Mimics the typical OOP style state machine pattern, but remains performant and consistent +/// with ECS data-behavior-separation constraint since trait fn's are syntactic sugar for +/// static fn's that accept their implementor's object type as its first parameter. This allows +/// for several benefits over implementing each state's behavior within the `CharacterState` update `System` +/// itself:_ +/// +/// 1. Less cognitive overhead: State's handling logic is next to the its data, and component (inside the state's .rs file). +/// 2. Separation of concerns (between states): all logic within a state's `handle()` is relevant only to that state. +/// States can be added/editted without concerns of affecting other state's logic. +/// 3. Clearly defined API and pattern: All states accept the same `EcsStateData` struct, which can be added to as necessary, +/// without the need for updating every state's implementation. All states return the same `StateUpdate` component. +/// `CharacterState` update `System` passes `EcsStateData` to `ActionState`/`MoveState` `handle()` which matches the character's +/// current state to its `handle()` fn, hiding the implementation details, since the System is only concerned with +/// how the update flow occurs and is in charge of updating the ECS components. pub trait StateHandle { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; } +// Public interface that passes EcsStateData to `StateHandle`s `handle()` fn impl StateHandle for ActionState { /// Passes handle to variant or subvariant handlers fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { @@ -82,6 +97,7 @@ impl StateHandle for ActionState { } } +/// Public interface that passes EcsStateData to `StateHandle`s `handle()` fn impl StateHandle for MoveState { /// Passes handle to variant handlers fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index 2f1422c37f..6055f2a176 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -20,7 +20,7 @@ impl StateHandle for WieldState { // Only act once equip_delay has expired if self.equip_delay == Duration::default() { // Toggle Weapons - if ecs_data.inputs.toggle_wield.is_pressed() + if ecs_data.inputs.toggle_wield.is_just_pressed() && ecs_data.character.action_state.is_equip_finished() { update.character.action_state = Idle(IdleState); diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 9bf8c48241..36eeadb4b4 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -8,11 +8,22 @@ use crate::{ state::DeltaTime, }; -use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; +use rayon::prelude::*; +use specs::{Entities, LazyUpdate, ParJoin, Read, ReadStorage, System, WriteStorage}; use sphynx::{Uid, UidAllocator}; -/// # Character StateHandle System -/// #### Updates then detemrines next Character States based on ControllerInputs +/// # Character State System +/// #### Updates tuples of ( `CharacterState`, `Pos`, `Vel`, and `Ori` ) in parallel. +/// _Each update for a single character involves first passing an `EcsStateData` struct of ECS components +/// to the character's `MoveState`, then the character's `ActionState`. State update logic is +/// is encapsulated in state's `handle()` fn, impl'd by the `StateHandle` trait. `handle()` fn's +/// return a `StateUpdate` tuple containing new ( `CharacterState`, `Pos`, `Vel`, and `Ori` ) components. +/// Since `handle()` accepts readonly components, component updates are contained within this system and ECS +/// behavior constraints are satisfied._ +/// +/// _This mimics the typical OOP style state machine pattern, but remains performant +/// under ECS since trait fn's are syntactic sugar for static fn's that accept their implementor's +/// object type as its first parameter. See `StateHandle` for more information._ pub struct Sys; impl<'a> System<'a> for Sys { @@ -61,22 +72,11 @@ impl<'a> System<'a> for Sys { action_overrides, ): Self::SystemData, ) { - for ( - entity, - uid, - mut character, - pos, - vel, - ori, - controller, - stats, - body, - physics, - maybe_mount, - maybe_move_override, - maybe_action_override, - (), - ) in ( + // Parallel joining behaves similarly to normal `join()`ing + // with the difference that iteration can potentially be + // executed in parallel by a thread pool. + // https://specs.amethyst.rs/docs/tutorials/09_parallel_join.html + ( &entities, &uids, &mut character_states, @@ -92,77 +92,94 @@ impl<'a> System<'a> for Sys { action_overrides.maybe(), !&state_overrides, ) - .join() - { - let inputs = &controller.inputs; - - // Being dead overrides all other states - if stats.is_dead { - // Only options: click respawn - // prevent instant-respawns (i.e. player was holding attack) - // by disallowing while input is held down - if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { - server_bus.emitter().emit(ServerEvent::Respawn(entity)); - } - // Or do nothing - continue; - } - // If mounted, character state is controlled by mount - // TODO: Make mounting a state - if maybe_mount.is_some() { - character.move_state = Sit(SitState); - continue; - } - - // Determine new move state if can move - if !maybe_move_override.is_some() && !character.move_disabled { - let state_update = character.move_state.handle(&EcsStateData { - entity: &entity, + .par_join() + .for_each( + |( + entity, uid, - character, + mut character, pos, vel, ori, - dt: &dt, - inputs, + controller, stats, body, physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); + maybe_mount, + maybe_move_override, + maybe_action_override, + (), + )| { + let inputs = &controller.inputs; - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } + // Being dead overrides all other states + if stats.is_dead { + // Only options: click respawn + // prevent instant-respawns (i.e. player was holding attack) + // by disallowing while input is held down + if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { + server_bus.emitter().emit(ServerEvent::Respawn(entity)); + } + // Or do nothing + continue; + } + // If mounted, character state is controlled by mount + // TODO: Make mounting a state + if maybe_mount.is_some() { + character.move_state = Sit(SitState); + continue; + } - // Determine new action if can_act - if !maybe_action_override.is_some() && !character.action_disabled { - let state_update = character.action_state.handle(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); + // Determine new move state if character can move + if !maybe_move_override.is_some() && !character.move_disabled { + let state_update = character.move_state.handle(&EcsStateData { + entity: &entity, + uid, + character, + pos, + vel, + ori, + dt: &dt, + inputs, + stats, + body, + physics, + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } - } + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } + + // Determine new action if character can act + if !maybe_action_override.is_some() && !character.action_disabled { + let state_update = character.action_state.handle(&EcsStateData { + entity: &entity, + uid, + character, + pos, + vel, + ori, + dt: &dt, + inputs, + stats, + body, + physics, + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); + + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } + }, + ); } } From 9c6ce9babd0c76f051a4f2b3543857a9bfbe89f2 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sun, 29 Dec 2019 15:47:42 -0800 Subject: [PATCH 009/387] Begin implementing combat actions --- assets/common/items/weapons/starter_axe.ron | 8 +- assets/common/items/weapons/starter_bow.ron | 8 +- .../common/items/weapons/starter_dagger.ron | 8 +- .../common/items/weapons/starter_hammer.ron | 8 +- assets/common/items/weapons/starter_staff.ron | 8 +- assets/common/items/weapons/starter_sword.ron | 10 +- assets/voxygen/audio/sfx.ron | 2 +- assets/voxygen/item_image_manifest.ron | 2 +- common/src/comp/character_state.rs | 2 +- common/src/comp/inventory/item.rs | 60 +++---- common/src/comp/inventory/mod.rs | 2 +- common/src/comp/mod.rs | 2 +- common/src/event.rs | 4 +- common/src/sys/character_state.rs | 153 ++++++++---------- common/src/util/movement_utils.rs | 31 +++- voxygen/src/anim/character/attack.rs | 4 +- voxygen/src/anim/character/block.rs | 20 +-- voxygen/src/anim/character/blockidle.rs | 20 +-- voxygen/src/anim/character/charge.rs | 4 +- voxygen/src/anim/character/cidle.rs | 20 +-- voxygen/src/anim/character/climb.rs | 4 +- voxygen/src/anim/character/crun.rs | 4 +- voxygen/src/anim/character/gliding.rs | 4 +- voxygen/src/anim/character/jump.rs | 4 +- voxygen/src/anim/character/roll.rs | 4 +- voxygen/src/anim/character/run.rs | 4 +- voxygen/src/anim/character/sit.rs | 4 +- voxygen/src/anim/character/stand.rs | 4 +- voxygen/src/anim/character/swim.rs | 4 +- voxygen/src/anim/character/wield.rs | 20 +-- 30 files changed, 224 insertions(+), 208 deletions(-) diff --git a/assets/common/items/weapons/starter_axe.ron b/assets/common/items/weapons/starter_axe.ron index 74d97b8864..1a02485aa4 100644 --- a/assets/common/items/weapons/starter_axe.ron +++ b/assets/common/items/weapons/starter_axe.ron @@ -2,7 +2,11 @@ Item( name: "Notched Axe", description: "Every dent tells the story of a chopped tree.", kind: Tool( - kind: Axe, - power: 10, + ToolData ( + kind: Axe, + equip_time_millis: 1000, + attack_buildup_millis: 700, + attack_recover_millis: 100, + ) ), ) diff --git a/assets/common/items/weapons/starter_bow.ron b/assets/common/items/weapons/starter_bow.ron index d59933630c..beaff0229b 100644 --- a/assets/common/items/weapons/starter_bow.ron +++ b/assets/common/items/weapons/starter_bow.ron @@ -2,7 +2,11 @@ Item( name: "Uneven Bow", description: "Someone carved his initials into it...", kind: Tool( - kind: Bow, - power: 10, + ToolData ( + kind: Bow, + equip_time_millis: 800, + attack_buildup_millis: 0, + attack_recover_millis: 800, + ) ), ) diff --git a/assets/common/items/weapons/starter_dagger.ron b/assets/common/items/weapons/starter_dagger.ron index e374c14160..57357db674 100644 --- a/assets/common/items/weapons/starter_dagger.ron +++ b/assets/common/items/weapons/starter_dagger.ron @@ -2,7 +2,11 @@ Item( name: "Sharp Kitchen Knife", description: "Great for cutting meat.", kind: Tool( - kind: Dagger, - power: 10, + ToolData ( + kind: Dagger, + equip_time_millis: 300, + attack_buildup_millis: 100, + attack_recover_millis: 400, + ) ), ) diff --git a/assets/common/items/weapons/starter_hammer.ron b/assets/common/items/weapons/starter_hammer.ron index 02e0840e17..df8a369669 100644 --- a/assets/common/items/weapons/starter_hammer.ron +++ b/assets/common/items/weapons/starter_hammer.ron @@ -2,7 +2,11 @@ Item( name: "Sturdy Old Hammer", description: "'Property of...' The rest is missing. ", kind: Tool( - kind: Hammer, - power: 10, + ToolData ( + kind: Hammer, + equip_time_millis: 1000, + attack_buildup_millis: 700, + attack_recover_millis: 100, + ) ), ) diff --git a/assets/common/items/weapons/starter_staff.ron b/assets/common/items/weapons/starter_staff.ron index f2ada50d49..abb161df9c 100644 --- a/assets/common/items/weapons/starter_staff.ron +++ b/assets/common/items/weapons/starter_staff.ron @@ -2,7 +2,11 @@ Item( name: "Gnarled Rod", description: "Smells like resin and magic.", kind: Tool( - kind: Staff, - power: 10, + ToolData ( + kind: Staff, + equip_time_millis: 800, + attack_buildup_millis: 400, + attack_recover_millis: 300, + ) ), ) diff --git a/assets/common/items/weapons/starter_sword.ron b/assets/common/items/weapons/starter_sword.ron index dadbc9d2d5..4f3f1b2506 100644 --- a/assets/common/items/weapons/starter_sword.ron +++ b/assets/common/items/weapons/starter_sword.ron @@ -2,7 +2,13 @@ Item( name: "Battered Sword", description: "Held together by Rust and hope.", kind: Tool( - kind: Sword, - power: 10, + ToolData ( + kind: Sword(Rapier), + equip_time_millis: 800, + attack_buildup_millis: 100, + attack_recover_millis: 500, + range: 3, + base_damage: 10, + ) ), ) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index 3a3ca23a26..1765b2b332 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -27,7 +27,7 @@ threshold: 0.5, ), ( - trigger: Attack(Sword), + trigger: Attack(Sword(Rapier)), files: [ "voxygen.audio.sfx.weapon.sword", ], diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 048ac495b4..d35d970d85 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -11,7 +11,7 @@ "voxel.weapon.dagger.dagger_rusty", (0.0, 0.0, -4.0), (-120.0, 90.0, 0.0), 1.1, ), - Tool(Sword): VoxTrans( + Tool(Sword(Rapier)): VoxTrans( "voxel.weapon.sword.rusty_2h", (0.0, 9.0, 0.0), (-90.0, 90.0, 0.0), 2.4, ), diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index a3dd2d4e57..35834084bc 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -125,7 +125,7 @@ impl ActionState { } } -/// __A concurrent state machine that allows for spearate `ActionState`s and `MoveState`s.__ +/// __A concurrent state machine that allows for separate `ActionState`s and `MoveState`s.__ /// /// _Each state can optionally override the other through `*_disabled` flag_ #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index ead09e314a..98547f2b8e 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -11,8 +11,14 @@ use std::io::BufReader; use std::time::Duration; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub enum Tool { - Sword, +pub enum SwordKind { + Scimitar, + Rapier, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum ToolKind { + Sword(SwordKind), Axe, Hammer, Bow, @@ -22,43 +28,15 @@ pub enum Tool { Debug(Debug), } -// TODO: Allow override in item ron? -impl Tool { - pub fn wield_duration(&self) -> Duration { - match self { - Tool::Sword => Duration::from_millis(800), - Tool::Axe => Duration::from_millis(1000), - Tool::Hammer => Duration::from_millis(1000), - Tool::Bow => Duration::from_millis(800), - Tool::Dagger => Duration::from_millis(300), - Tool::Staff => Duration::from_millis(800), - Tool::Shield => Duration::from_millis(1000), - Tool::Debug(_) => Duration::from_millis(0), - } +impl ToolData { + pub fn equip_time(&self) -> Duration { + Duration::from_millis(self.equip_time_millis) } pub fn attack_buildup_duration(&self) -> Duration { - match self { - Tool::Sword => Duration::from_millis(100), - Tool::Axe => Duration::from_millis(700), - Tool::Hammer => Duration::from_millis(700), - Tool::Bow => Duration::from_millis(0), - Tool::Dagger => Duration::from_millis(100), - Tool::Staff => Duration::from_millis(400), - Tool::Shield => Duration::from_millis(100), - Tool::Debug(_) => Duration::from_millis(0), - } + Duration::from_millis(self.attack_buildup_millis) } pub fn attack_recover_duration(&self) -> Duration { - match self { - Tool::Sword => Duration::from_millis(500), - Tool::Axe => Duration::from_millis(100), - Tool::Hammer => Duration::from_millis(100), - Tool::Bow => Duration::from_millis(800), - Tool::Dagger => Duration::from_millis(400), - Tool::Staff => Duration::from_millis(300), - Tool::Shield => Duration::from_millis(1000), - Tool::Debug(_) => Duration::from_millis(0), - } + Duration::from_millis(self.attack_recover_millis) } pub fn attack_duration(&self) -> Duration { self.attack_buildup_duration() + self.attack_recover_duration() @@ -105,9 +83,19 @@ pub enum Ingredient { Grass, } +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct ToolData { + pub kind: ToolKind, + equip_time_millis: u64, + attack_buildup_millis: u64, + attack_recover_millis: u64, + range: u64, + base_damage: u64, +} + #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum ItemKind { - Tool { kind: Tool, power: u32 }, + Tool(ToolData), Armor { kind: Armor, power: u32 }, Consumable { kind: Consumable, effect: Effect }, Ingredient(Ingredient), diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index ce5eef18e1..b4f85a052e 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -1,7 +1,7 @@ pub mod item; // Reexports -pub use item::{Debug, Item, ItemKind, Tool}; +pub use item::{Debug, Item, ItemKind, ToolData, ToolKind}; use crate::assets; use specs::{Component, HashMapStorage, NullStorage}; diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index cc446bd6b6..f756584b4a 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -30,7 +30,7 @@ pub use controller::{ Mounting, }; pub use inputs::CanBuild; -pub use inventory::{item, Inventory, InventoryUpdate, Item, ItemKind}; +pub use inventory::{item, Inventory, InventoryUpdate, Item, ItemKind, ToolData, ToolKind}; pub use last::Last; pub use location::Waypoint; pub use phys::{ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; diff --git a/common/src/event.rs b/common/src/event.rs index 5cd5cb1c27..881f7c5ea3 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -1,5 +1,5 @@ use crate::comp; -use comp::item::Tool; +use comp::item::ToolKind; use parking_lot::Mutex; use serde::Deserialize; use specs::Entity as EcsEntity; @@ -44,7 +44,7 @@ pub enum SfxEvent { InventoryDrop, LightLantern, ExtinguishLantern, - Attack(Tool), + Attack(ToolKind), AttackWolf, } diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 36eeadb4b4..8a2a9c1672 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -8,8 +8,7 @@ use crate::{ state::DeltaTime, }; -use rayon::prelude::*; -use specs::{Entities, LazyUpdate, ParJoin, Read, ReadStorage, System, WriteStorage}; +use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; use sphynx::{Uid, UidAllocator}; /// # Character State System @@ -72,11 +71,7 @@ impl<'a> System<'a> for Sys { action_overrides, ): Self::SystemData, ) { - // Parallel joining behaves similarly to normal `join()`ing - // with the difference that iteration can potentially be - // executed in parallel by a thread pool. - // https://specs.amethyst.rs/docs/tutorials/09_parallel_join.html - ( + for (entity, uid, mut character, pos, vel, ori, controller, stats, body, physics, ()) in ( &entities, &uids, &mut character_states, @@ -87,99 +82,79 @@ impl<'a> System<'a> for Sys { &stats, &bodies, &physics_states, - mountings.maybe(), - move_overrides.maybe(), - action_overrides.maybe(), !&state_overrides, ) - .par_join() - .for_each( - |( - entity, + .join() + { + let inputs = &controller.inputs; + + // Being dead overrides all other states + if stats.is_dead { + // Only options: click respawn + // prevent instant-respawns (i.e. player was holding attack) + // by disallowing while input is held down + if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { + server_bus.emitter().emit(ServerEvent::Respawn(entity)); + } + // Or do nothing + return; + } + // If mounted, character state is controlled by mount + // TODO: Make mounting a state + if let Some(Mounting(_)) = mountings.get(entity) { + character.move_state = Sit(SitState); + return; + } + + // Determine new move state if character can move + if let (None, false) = (move_overrides.get(entity), character.move_disabled) { + let state_update = character.move_state.handle(&EcsStateData { + entity: &entity, uid, - mut character, + character, pos, vel, ori, - controller, + dt: &dt, + inputs, stats, body, physics, - maybe_mount, - maybe_move_override, - maybe_action_override, - (), - )| { - let inputs = &controller.inputs; + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); - // Being dead overrides all other states - if stats.is_dead { - // Only options: click respawn - // prevent instant-respawns (i.e. player was holding attack) - // by disallowing while input is held down - if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { - server_bus.emitter().emit(ServerEvent::Respawn(entity)); - } - // Or do nothing - continue; - } - // If mounted, character state is controlled by mount - // TODO: Make mounting a state - if maybe_mount.is_some() { - character.move_state = Sit(SitState); - continue; - } + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } - // Determine new move state if character can move - if !maybe_move_override.is_some() && !character.move_disabled { - let state_update = character.move_state.handle(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); + // Determine new action if character can act + if let (None, false) = (action_overrides.get(entity), character.action_disabled) { + let state_update = character.action_state.handle(&EcsStateData { + entity: &entity, + uid, + character, + pos, + vel, + ori, + dt: &dt, + inputs, + stats, + body, + physics, + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } - - // Determine new action if character can act - if !maybe_action_override.is_some() && !character.action_disabled { - let state_update = character.action_state.handle(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); - - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } - }, - ); + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } + } } } diff --git a/common/src/util/movement_utils.rs b/common/src/util/movement_utils.rs index 38d8cb7903..5a3056eac0 100644 --- a/common/src/util/movement_utils.rs +++ b/common/src/util/movement_utils.rs @@ -1,10 +1,37 @@ use crate::comp::TEMP_EQUIP_DELAY; use crate::comp::{ - ActionState, ActionState::*, Body, ControllerInputs, FallState, IdleState, ItemKind::Tool, - MoveState, MoveState::*, PhysicsState, RunState, StandState, Stats, SwimState, WieldState, + ActionState, ActionState::*, AttackKind::*, BasicAttackState, BasicBlockState, BlockKind::*, + Body, ControllerInputs, FallState, IdleState, ItemKind::Tool, MoveState, MoveState::*, + PhysicsState, RunState, StandState, Stats, SwimState, ToolData, WieldState, }; use std::time::Duration; +/// _Determines what ability a player has selected for their primary ability, +/// and returns the corresponding `ActionState` +/// ... or Idle if nothing it possible?_ +pub fn determine_primary_ability(stats: &Stats) -> ActionState { + if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { + Attack(BasicAttack(BasicAttackState { + remaining_duration: data.attack_duration(), + })) + } else { + Idle(IdleState) + } +} + +/// _Determines what ability a player has selected for their primary ability, +/// and returns the corresponding `ActionState` +/// ... or Idle if nothing it possible?_ +pub fn determine_secondary_ability(stats: &Stats) -> ActionState { + if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { + Block(BasicBlock(BasicBlockState { + active_duration:: Duration::default(), + })) + } else { + Idle(IdleState) + } +} + /// __Returns a `MoveState` based on `in_fluid` condition__ pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { // Check if in fluid to go to swimming or back to falling diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index fa4594822f..24b384760d 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use vek::*; @@ -13,7 +13,7 @@ pub struct AttackAnimation; impl Animation for AttackAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/block.rs b/voxygen/src/anim/character/block.rs index d5770e49d7..e115a087bb 100644 --- a/voxygen/src/anim/character/block.rs +++ b/voxygen/src/anim/character/block.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -13,7 +13,7 @@ pub struct BlockAnimation; impl Animation for BlockAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, @@ -65,7 +65,7 @@ impl Animation for BlockAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0 + wave_ultra_slow * 1.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -82,7 +82,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Axe) => { + Some(ToolKind::Axe) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -107,7 +107,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Hammer) => { + Some(ToolKind::Hammer) => { next.l_hand.offset = Vec3::new(-7.0, 3.5, 6.5); next.l_hand.ori = Quaternion::rotation_x(2.07) * Quaternion::rotation_y(0.0) @@ -128,7 +128,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(-0.85); next.main.scale = Vec3::one(); } - Some(Tool::Staff) => { + Some(ToolKind::Staff) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -153,7 +153,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Shield) => { + Some(ToolKind::Shield) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -178,7 +178,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Bow) => { + Some(ToolKind::Bow) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -203,7 +203,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Dagger) => { + Some(ToolKind::Dagger) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -224,7 +224,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Debug(_)) => { + Some(ToolKind::Debug(_)) => { next.l_hand.offset = Vec3::new(-7.0, 3.5, 6.5); next.l_hand.ori = Quaternion::rotation_x(2.07) * Quaternion::rotation_y(0.0) diff --git a/voxygen/src/anim/character/blockidle.rs b/voxygen/src/anim/character/blockidle.rs index e2bfda6833..8fcdac34c1 100644 --- a/voxygen/src/anim/character/blockidle.rs +++ b/voxygen/src/anim/character/blockidle.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -13,7 +13,7 @@ pub struct BlockIdleAnimation; impl Animation for BlockIdleAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, @@ -64,7 +64,7 @@ impl Animation for BlockIdleAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0 + wave_ultra_slow * 1.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -81,7 +81,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Axe) => { + Some(ToolKind::Axe) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -106,7 +106,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Hammer) => { + Some(ToolKind::Hammer) => { next.l_hand.offset = Vec3::new(-7.0, 3.5 + wave_ultra_slow * 2.0, 6.5); next.l_hand.ori = Quaternion::rotation_x(2.07) * Quaternion::rotation_y(0.0) @@ -127,7 +127,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(-0.85); next.main.scale = Vec3::one(); } - Some(Tool::Staff) => { + Some(ToolKind::Staff) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -152,7 +152,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Shield) => { + Some(ToolKind::Shield) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -177,7 +177,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Bow) => { + Some(ToolKind::Bow) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -202,7 +202,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Dagger) => { + Some(ToolKind::Dagger) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -223,7 +223,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Debug(_)) => { + Some(ToolKind::Debug(_)) => { next.l_hand.offset = Vec3::new(-7.0, 3.5 + wave_ultra_slow * 2.0, 6.5); next.l_hand.ori = Quaternion::rotation_x(2.07) * Quaternion::rotation_y(0.0) diff --git a/voxygen/src/anim/character/charge.rs b/voxygen/src/anim/character/charge.rs index 3e39ee86fc..14263aaa89 100644 --- a/voxygen/src/anim/character/charge.rs +++ b/voxygen/src/anim/character/charge.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use vek::*; @@ -13,7 +13,7 @@ pub struct ChargeAnimation; impl Animation for ChargeAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/cidle.rs b/voxygen/src/anim/character/cidle.rs index 165331fc7d..3f46b86834 100644 --- a/voxygen/src/anim/character/cidle.rs +++ b/voxygen/src/anim/character/cidle.rs @@ -3,7 +3,7 @@ use super::{ CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -14,7 +14,7 @@ pub struct CidleAnimation; impl Animation for CidleAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, @@ -65,7 +65,7 @@ impl Animation for CidleAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, -2.0 + wave_ultra_slow_cos * 0.5, @@ -90,7 +90,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Axe) => { + Some(ToolKind::Axe) => { next.l_hand.offset = Vec3::new( -6.5 + wave_ultra_slow_cos * 1.0, -0.5 + wave_ultra_slow_cos * 0.5, @@ -117,7 +117,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Hammer) => { + Some(ToolKind::Hammer) => { next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0); next.l_hand.ori = Quaternion::rotation_x(1.27 + wave_ultra_slow * -0.1) * Quaternion::rotation_y(0.0) @@ -138,7 +138,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(wave_ultra_slow * 0.2); next.main.scale = Vec3::one(); } - Some(Tool::Staff) => { + Some(ToolKind::Staff) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -163,7 +163,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Shield) => { + Some(ToolKind::Shield) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -188,7 +188,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Bow) => { + Some(ToolKind::Bow) => { next.l_hand.offset = Vec3::new( -4.0 + wave_ultra_slow_cos * 1.0, 5.0 + wave_ultra_slow_cos * 0.5, @@ -217,7 +217,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(0.85); next.main.scale = Vec3::one(); } - Some(Tool::Dagger) => { + Some(ToolKind::Dagger) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, 3.5 + wave_ultra_slow_cos * 0.5, @@ -238,7 +238,7 @@ impl Animation for CidleAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Debug(_)) => { + Some(ToolKind::Debug(_)) => { next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0); next.l_hand.ori = Quaternion::rotation_x(1.27 + wave_ultra_slow * -0.1) * Quaternion::rotation_y(0.0) diff --git a/voxygen/src/anim/character/climb.rs b/voxygen/src/anim/character/climb.rs index 84de64db14..bdac20fa5d 100644 --- a/voxygen/src/anim/character/climb.rs +++ b/voxygen/src/anim/character/climb.rs @@ -2,14 +2,14 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use vek::*; pub struct ClimbAnimation; impl Animation for ClimbAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, Vec3, Vec3, f64); + type Dependency = (Option, Vec3, Vec3, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/crun.rs b/voxygen/src/anim/character/crun.rs index b5b0da0140..7ed32559ce 100644 --- a/voxygen/src/anim/character/crun.rs +++ b/voxygen/src/anim/character/crun.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use std::ops::Mul; use vek::*; @@ -43,7 +43,7 @@ impl Animation for WieldAnimation { match Tool::Bow { //TODO: Inventory - Tool::Sword => { + Tool::Sword(_) => { next.l_hand.offset = Vec3::new(-6.0, 3.75, 0.25); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index d78f8a1142..f0a0bfe427 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -10,7 +10,7 @@ pub struct GlidingAnimation; impl Animation for GlidingAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, Vec3, Vec3, Vec3, f64); + type Dependency = (Option, Vec3, Vec3, Vec3, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs index 29fb164d83..29436e419e 100644 --- a/voxygen/src/anim/character/jump.rs +++ b/voxygen/src/anim/character/jump.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use vek::*; @@ -10,7 +10,7 @@ pub struct JumpAnimation; impl Animation for JumpAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index 92e6149e2e..d41f0d4e67 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use vek::*; @@ -10,7 +10,7 @@ pub struct RollAnimation; impl Animation for RollAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 38fdc58728..96ea69ebb0 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use std::ops::Mul; use vek::*; @@ -11,7 +11,7 @@ pub struct RunAnimation; impl Animation for RunAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, Vec3, Vec3, Vec3, f64); + type Dependency = (Option, Vec3, Vec3, Vec3, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/sit.rs b/voxygen/src/anim/character/sit.rs index 2f1106eb2c..fa2061446e 100644 --- a/voxygen/src/anim/character/sit.rs +++ b/voxygen/src/anim/character/sit.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -10,7 +10,7 @@ pub struct SitAnimation; impl Animation for SitAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index c7f5a47efb..efc67e3d18 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -10,7 +10,7 @@ pub struct StandAnimation; impl Animation for StandAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f64); + type Dependency = (Option, f64); fn update_skeleton( skeleton: &Self::Skeleton, (_active_tool_kind, global_time): Self::Dependency, diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index e22b827071..c806e3ab35 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use std::ops::Mul; use vek::*; @@ -11,7 +11,7 @@ pub struct SwimAnimation; impl Animation for SwimAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f32, f32, f64); + type Dependency = (Option, f32, f32, f64); fn update_skeleton( skeleton: &Self::Skeleton, diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 9c4d41c10a..868372005f 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -2,7 +2,7 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::f32::consts::PI; use vek::*; @@ -11,7 +11,7 @@ pub struct WieldAnimation; impl Animation for WieldAnimation { type Skeleton = CharacterSkeleton; - type Dependency = (Option, f32, f64); + type Dependency = (Option, f32, f64); fn update_skeleton( skeleton: &Self::Skeleton, @@ -29,7 +29,7 @@ impl Animation for WieldAnimation { let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); match active_tool_kind { //TODO: Inventory - Some(Tool::Sword) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(-6.0, -2.0, 1.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.00; @@ -46,7 +46,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Axe) => { + Some(ToolKind::Axe) => { next.l_hand.offset = Vec3::new(-6.5, -0.5, 6.0); next.l_hand.ori = Quaternion::rotation_x(0.13) * Quaternion::rotation_z(-0.25); next.l_hand.scale = Vec3::one() * 1.01; @@ -65,7 +65,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Hammer) => { + Some(ToolKind::Hammer) => { next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0); next.l_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25) * Quaternion::rotation_y(0.0) @@ -86,7 +86,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(wave * -0.25); next.main.scale = Vec3::one(); } - Some(Tool::Staff) => { + Some(ToolKind::Staff) => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -103,7 +103,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Shield) => { + Some(ToolKind::Shield) => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -120,7 +120,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Bow) => { + Some(ToolKind::Bow) => { next.l_hand.offset = Vec3::new(-4.0, 5.0, 0.0); next.l_hand.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(-1.9) @@ -141,7 +141,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.85); next.main.scale = Vec3::one(); } - Some(Tool::Dagger) => { + Some(ToolKind::Dagger) => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -158,7 +158,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } - Some(Tool::Debug(_)) => { + Some(ToolKind::Debug(_)) => { next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0); next.l_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25) * Quaternion::rotation_y(0.0) From ba7ca785f6a9da46b4a6f62d2108864ffd179809 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Mon, 30 Dec 2019 05:56:42 -0800 Subject: [PATCH 010/387] Successful build --- assets/common/items/debug/boost.ron | 6 ++- assets/common/items/debug/possess.ron | 6 ++- common/src/comp/states/basic_attack.rs | 2 +- common/src/comp/states/basic_block.rs | 2 +- common/src/comp/states/wield.rs | 3 +- common/src/util/movement_utils.rs | 2 +- voxygen/src/anim/mod.rs | 38 +++++++------- voxygen/src/audio/sfx/event_mapper.rs | 6 +-- voxygen/src/hud/item_imgs.rs | 6 +-- voxygen/src/hud/skillbar.rs | 72 +++++++++++++------------- voxygen/src/scene/figure/load.rs | 20 +++---- voxygen/src/scene/figure/mod.rs | 4 +- 12 files changed, 86 insertions(+), 81 deletions(-) diff --git a/assets/common/items/debug/boost.ron b/assets/common/items/debug/boost.ron index f03377b0e5..c32d38c69a 100644 --- a/assets/common/items/debug/boost.ron +++ b/assets/common/items/debug/boost.ron @@ -3,7 +3,9 @@ Item( description: "The sky is the limit.", kind: Tool( kind: Debug(Boost), - power: 0, + equip_time_millis: 0, + attack_buildup_millis: 0, + attack_recover_millis: 0, ), ) -// And the ground is pretty hard at maximum velocity... \ No newline at end of file +// And the ground is pretty hard at maximum velocity... diff --git a/assets/common/items/debug/possess.ron b/assets/common/items/debug/possess.ron index d6a2d84a3e..e568ece69b 100644 --- a/assets/common/items/debug/possess.ron +++ b/assets/common/items/debug/possess.ron @@ -3,7 +3,9 @@ Item( description: "It's fixed on my branch.", kind: Tool( kind: Debug(Possess), - power: 0, + equip_time_millis: 0, + attack_buildup_millis: 0, + attack_recover_millis: 0, ), ) -// ... as zesterer always uses to tell us. \ No newline at end of file +// ... as zesterer always uses to tell us. diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 14ec2e2e30..493b42aafd 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -7,7 +7,7 @@ use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct BasicAttackState { /// How long the state has until exitting - remaining_duration: Duration, + pub remaining_duration: Duration, } impl StateHandle for BasicAttackState { diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index 1ae98a683e..b6ba2fe2c8 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -7,7 +7,7 @@ use vek::Vec2; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct BasicBlockState { /// How long the blocking state has been active - active_duration: Duration, + pub active_duration: Duration, } impl StateHandle for BasicBlockState { diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index 6055f2a176..3036f86fef 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,4 +1,5 @@ use crate::comp::{ActionState::*, EcsStateData, IdleState, StateHandle, StateUpdate}; +use crate::util::movement_utils::*; use std::time::Duration; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -29,7 +30,7 @@ impl StateHandle for WieldState { // Try weapon actions if ecs_data.inputs.primary.is_pressed() { - // TODO: PrimaryStart + update.character.action_state = determine_primary_ability(ecs_data.stats); } else if ecs_data.inputs.secondary.is_pressed() { // TODO: SecondaryStart } diff --git a/common/src/util/movement_utils.rs b/common/src/util/movement_utils.rs index 5a3056eac0..c9a503535e 100644 --- a/common/src/util/movement_utils.rs +++ b/common/src/util/movement_utils.rs @@ -25,7 +25,7 @@ pub fn determine_primary_ability(stats: &Stats) -> ActionState { pub fn determine_secondary_ability(stats: &Stats) -> ActionState { if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { Block(BasicBlock(BasicBlockState { - active_duration:: Duration::default(), + active_duration: Duration::default(), })) } else { Idle(IdleState) diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index 6f69c17dc0..4091741ab7 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -11,7 +11,7 @@ pub mod quadruped_medium; pub mod quadruped_small; use crate::render::FigureBoneData; -use common::comp::{self, item::Tool}; +use common::comp::{self, ToolKind}; use vek::*; #[derive(Copy, Clone)] @@ -158,27 +158,27 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr { (Danari, Male) => 0.0, (Danari, Female) => 0.0, }, - weapon_x: match Tool::Hammer { + weapon_x: match ToolKind::Hammer { // TODO: Inventory - Tool::Sword => 0.0, - Tool::Axe => 3.0, - Tool::Hammer => 0.0, - Tool::Shield => 3.0, - Tool::Staff => 3.0, - Tool::Bow => 0.0, - Tool::Dagger => 0.0, - Tool::Debug(_) => 0.0, + ToolKind::Sword(_) => 0.0, + ToolKind::Axe => 3.0, + ToolKind::Hammer => 0.0, + ToolKind::Shield => 3.0, + ToolKind::Staff => 3.0, + ToolKind::Bow => 0.0, + ToolKind::Dagger => 0.0, + ToolKind::Debug(_) => 0.0, }, - weapon_y: match Tool::Hammer { + weapon_y: match ToolKind::Hammer { // TODO: Inventory - Tool::Sword => -1.25, - Tool::Axe => 0.0, - Tool::Hammer => -2.0, - Tool::Shield => 0.0, - Tool::Staff => 0.0, - Tool::Bow => -2.0, - Tool::Dagger => -2.0, - Tool::Debug(_) => 0.0, + ToolKind::Sword(_) => -1.25, + ToolKind::Axe => 0.0, + ToolKind::Hammer => -2.0, + ToolKind::Shield => 0.0, + ToolKind::Staff => 0.0, + ToolKind::Bow => -2.0, + ToolKind::Dagger => -2.0, + ToolKind::Debug(_) => 0.0, }, } } diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 311b8fbb1a..b63b66f05c 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -7,7 +7,7 @@ use common::{ comp::{ ActionState, AttackKind::*, BasicAttackState, Body, CharacterState, DodgeKind::*, FallState, GlideState, IdleState, ItemKind, MoveState, Pos, RollState, RunState, - StandState, Stats, + StandState, Stats, ToolData, }, event::{EventBus, SfxEvent, SfxEventItem}, }; @@ -183,7 +183,7 @@ impl SfxEventMapper { } (_, ActionState::Attack { .. }, _, stats) => { match &stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => SfxEvent::Attack(*kind), + Some(ItemKind::Tool(ToolData { kind, .. })) => SfxEvent::Attack(*kind), _ => SfxEvent::Idle, } } @@ -197,7 +197,7 @@ mod tests { use super::*; use common::{ assets, - comp::{item::Tool, ActionState, MoveState, Stats}, + comp::{ActionState, MoveState, Stats}, event::SfxEvent, }; use std::time::{Duration, Instant}; diff --git a/voxygen/src/hud/item_imgs.rs b/voxygen/src/hud/item_imgs.rs index 81e539d34a..5c07c9eeb6 100644 --- a/voxygen/src/hud/item_imgs.rs +++ b/voxygen/src/hud/item_imgs.rs @@ -1,7 +1,7 @@ use crate::ui::{Graphic, Transform, Ui}; use common::{ assets::{self, watch::ReloadIndicator, Asset}, - comp::item::{Armor, Consumable, Ingredient, Item, ItemKind, Tool}, + comp::item::{Armor, Consumable, Ingredient, Item, ItemKind, ToolData, ToolKind}, }; use conrod_core::image::Id; use dot_vox::DotVoxData; @@ -14,7 +14,7 @@ use vek::*; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum ItemKey { - Tool(Tool), + Tool(ToolKind), Armor(Armor), Consumable(Consumable), Ingredient(Ingredient), @@ -22,7 +22,7 @@ pub enum ItemKey { impl From<&Item> for ItemKey { fn from(item: &Item) -> Self { match &item.kind { - ItemKind::Tool { kind, .. } => ItemKey::Tool(kind.clone()), + ItemKind::Tool(ToolData { kind, .. }) => ItemKey::Tool(kind.clone()), ItemKind::Armor { kind, .. } => ItemKey::Armor(kind.clone()), ItemKind::Consumable { kind, .. } => ItemKey::Consumable(kind.clone()), ItemKind::Ingredient(kind) => ItemKey::Ingredient(kind.clone()), diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 860ef4f57b..8e6d3855c6 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -3,7 +3,7 @@ use super::{ /*FOCUS_COLOR, RAGE_COLOR,*/ HP_COLOR, LOW_HP_COLOR, MANA_COLOR, TEXT_COLOR, XP_COLOR, }; use crate::GlobalState; -use common::comp::{item::Debug, item::Tool, ItemKind, Stats}; +use common::comp::{item::Debug, item::ToolData, item::ToolKind, Equipment, ItemKind, Stats}; use conrod_core::{ color, widget::{self, Button, Image, Rectangle, Text}, @@ -105,10 +105,10 @@ impl<'a> Skillbar<'a> { stats: &'a Stats, ) -> Self { Self { - imgs, - fonts: fonts, - stats, global_state, + imgs, + fonts, + stats, current_resource: ResourceType::Mana, common: widget::CommonBuilder::default(), } @@ -506,9 +506,9 @@ impl<'a> Widget for Skillbar<'a> { Image::new(self.imgs.skillbar_slot_big_bg) .w_h(36.0 * scale, 36.0 * scale) .color(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Bow => Some(BG_COLOR_2), - Tool::Staff => Some(BG_COLOR_2), + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Bow => Some(BG_COLOR_2), + ToolKind::Staff => Some(BG_COLOR_2), _ => Some(BG_COLOR_2), }, _ => Some(BG_COLOR_2), @@ -516,29 +516,29 @@ impl<'a> Widget for Skillbar<'a> { .middle_of(state.ids.m1_slot) .set(state.ids.m1_slot_bg, ui); Button::image(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Sword => self.imgs.twohsword_m1, - Tool::Hammer => self.imgs.twohhammer_m1, - Tool::Axe => self.imgs.twohaxe_m1, - Tool::Bow => self.imgs.bow_m1, - Tool::Staff => self.imgs.staff_m1, - Tool::Debug(Debug::Boost) => self.imgs.flyingrod_m1, + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Sword(_) => self.imgs.twohsword_m1, + ToolKind::Hammer => self.imgs.twohhammer_m1, + ToolKind::Axe => self.imgs.twohaxe_m1, + ToolKind::Bow => self.imgs.bow_m1, + ToolKind::Staff => self.imgs.staff_m1, + ToolKind::Debug(Debug::Boost) => self.imgs.flyingrod_m1, _ => self.imgs.twohaxe_m1, }, _ => self.imgs.twohaxe_m1, }) // Insert Icon here .w(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Bow => 30.0 * scale, - Tool::Staff => 30.0 * scale, + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Bow => 30.0 * scale, + ToolKind::Staff => 30.0 * scale, _ => 38.0 * scale, }, _ => 38.0 * scale, }) .h(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Bow => 30.0 * scale, - Tool::Staff => 36.0 * scale, + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Bow => 30.0 * scale, + ToolKind::Staff => 36.0 * scale, _ => 38.0 * scale, }, _ => 38.0 * scale, @@ -553,9 +553,9 @@ impl<'a> Widget for Skillbar<'a> { Image::new(self.imgs.skillbar_slot_big_bg) .w_h(36.0 * scale, 36.0 * scale) .color(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Bow => Some(BG_COLOR_2), - Tool::Staff => Some(BG_COLOR_2), + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Bow => Some(BG_COLOR_2), + ToolKind::Staff => Some(BG_COLOR_2), _ => Some(BG_COLOR_2), }, _ => Some(BG_COLOR_2), @@ -563,29 +563,29 @@ impl<'a> Widget for Skillbar<'a> { .middle_of(state.ids.m2_slot) .set(state.ids.m2_slot_bg, ui); Button::image(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Sword => self.imgs.twohsword_m2, - Tool::Hammer => self.imgs.twohhammer_m2, - Tool::Axe => self.imgs.twohaxe_m2, - Tool::Bow => self.imgs.bow_m2, - Tool::Staff => self.imgs.staff_m2, - Tool::Debug(Debug::Boost) => self.imgs.flyingrod_m2, + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Sword(_) => self.imgs.twohsword_m2, + ToolKind::Hammer => self.imgs.twohhammer_m2, + ToolKind::Axe => self.imgs.twohaxe_m2, + ToolKind::Bow => self.imgs.bow_m2, + ToolKind::Staff => self.imgs.staff_m2, + ToolKind::Debug(Debug::Boost) => self.imgs.flyingrod_m2, _ => self.imgs.twohaxe_m2, }, _ => self.imgs.twohaxe_m2, }) // Insert Icon here .w(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Bow => 30.0 * scale, - Tool::Staff => 30.0 * scale, + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Bow => 30.0 * scale, + ToolKind::Staff => 30.0 * scale, _ => 38.0 * scale, }, _ => 38.0 * scale, }) .h(match self.stats.equipment.main.as_ref().map(|i| &i.kind) { - Some(ItemKind::Tool { kind, .. }) => match kind { - Tool::Bow => 30.0 * scale, - Tool::Staff => 30.0 * scale, + Some(ItemKind::Tool(ToolData { kind, .. })) => match kind { + ToolKind::Bow => 30.0 * scale, + ToolKind::Staff => 30.0 * scale, _ => 38.0 * scale, }, _ => 38.0 * scale, diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index fe553db45a..ee9f5a724d 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -10,7 +10,7 @@ use common::{ humanoid::{ Belt, BodyType, Chest, EyeColor, Eyebrows, Foot, Hand, Pants, Race, Shoulder, Skin, }, - item::Tool, + item::{ToolData, ToolKind}, object, quadruped_medium, quadruped_small, Item, ItemKind, }, figure::{DynaUnionizer, MatSegment, Material, Segment}, @@ -513,15 +513,15 @@ impl HumArmorFootSpec { pub fn mesh_main(item: Option<&Item>) -> Mesh { if let Some(item) = item { let (name, offset) = match item.kind { - ItemKind::Tool { kind, .. } => match kind { - Tool::Sword => ("weapon.sword.rusty_2h", Vec3::new(-1.5, -6.5, -4.0)), - Tool::Axe => ("weapon.axe.rusty_2h", Vec3::new(-1.5, -5.0, -4.0)), - Tool::Hammer => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)), - Tool::Dagger => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)), - Tool::Shield => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)), - Tool::Bow => ("weapon.bow.simple-bow", Vec3::new(-1.0, -6.0, -2.0)), - Tool::Staff => ("weapon.staff.wood-fire", Vec3::new(-1.0, -6.0, -3.0)), - Tool::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)), + ItemKind::Tool(ToolData { kind, .. }) => match kind { + ToolKind::Sword(_) => ("weapon.sword.rusty_2h", Vec3::new(-1.5, -6.5, -4.0)), + ToolKind::Axe => ("weapon.axe.rusty_2h", Vec3::new(-1.5, -5.0, -4.0)), + ToolKind::Hammer => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)), + ToolKind::Dagger => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)), + ToolKind::Shield => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)), + ToolKind::Bow => ("weapon.bow.simple-bow", Vec3::new(-1.0, -6.0, -2.0)), + ToolKind::Staff => ("weapon.staff.wood-fire", Vec3::new(-1.0, -6.0, -3.0)), + ToolKind::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)), }, _ => return Mesh::new(), }; diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 13e01db904..c104a58df0 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -19,7 +19,7 @@ use client::Client; use common::{ comp::{ ActionState::*, AttackKind::*, Body, CharacterState, ItemKind, Last, MoveState::*, Ori, - Pos, Scale, Stats, Vel, + Pos, Scale, Stats, ToolData, Vel, }, terrain::TerrainChunk, vol::RectRasterableVol, @@ -169,7 +169,7 @@ impl FigureMgr { .cloned() .unwrap_or_default(); - let active_tool_kind = if let Some(ItemKind::Tool { kind, .. }) = stats + let active_tool_kind = if let Some(ItemKind::Tool(ToolData { kind, .. })) = stats .and_then(|s| s.equipment.main.as_ref()) .map(|i| &i.kind) { From b67a4835f4134a69a87f58456cd9b17901326f4e Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Tue, 31 Dec 2019 05:19:23 -0800 Subject: [PATCH 011/387] Update disabled state flags --- common/src/comp/character_state.rs | 18 +++++++------ common/src/comp/inventory/mod.rs | 2 +- common/src/comp/mod.rs | 6 +++-- common/src/comp/states/basic_block.rs | 4 +-- common/src/comp/states/charge_attack.rs | 6 ++--- common/src/comp/states/climb.rs | 8 +++--- common/src/comp/states/glide.rs | 2 +- common/src/comp/states/mod.rs | 11 ++++---- common/src/comp/states/roll.rs | 4 +-- common/src/comp/states/sit.rs | 10 +++---- common/src/sys/character_state.rs | 18 +++++++++++-- voxygen/src/audio/sfx/event_mapper.rs | 36 ++++++++++++------------- 12 files changed, 72 insertions(+), 53 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 35834084bc..be95c8a687 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -143,27 +143,29 @@ pub struct CharacterState { pub action_state: ActionState, /// Used by `move_state` to disable `action_state` `handle()` calls. - pub action_disabled: bool, + /// Resets after every tick. States that use it should set it every tick. + pub action_disabled_this_tick: bool, /// Used by `action_state` to disable `move_state` `handle()` calls. - pub move_disabled: bool, + /// Resets after every tick. States that use it should set it every tick. + pub move_disabled_this_tick: bool, } impl CharacterState { - /// __Compares `move_state`s for shallow equality (does not check internal struct equality)__ + /// Compares `move_state`s for shallow equality (does not check internal struct equality) pub fn is_same_move_state(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(&self.move_state) == std::mem::discriminant(&other.move_state) } - /// __Compares `action_state`s for shallow equality (does not check internal struct equality)__ + /// Compares `action_state`s for shallow equality (does not check internal struct equality) pub fn is_same_action_state(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(&self.action_state) == std::mem::discriminant(&other.action_state) } - /// __Compares both `move_state`s and `action_state`a for shallow equality - /// (does not check internal struct equality)__ + /// Compares both `move_state`s and `action_state`a for shallow equality + /// (does not check internal struct equality) pub fn is_same_state(&self, other: &Self) -> bool { self.is_same_move_state(other) && self.is_same_action_state(other) } @@ -174,8 +176,8 @@ impl Default for CharacterState { Self { move_state: MoveState::Fall(FallState), action_state: ActionState::Idle(IdleState), - action_disabled: false, - move_disabled: false, + action_disabled_this_tick: false, + move_disabled_this_tick: false, } } } diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index b4f85a052e..9ffef91b2a 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -1,7 +1,7 @@ pub mod item; // Reexports -pub use item::{Debug, Item, ItemKind, ToolData, ToolKind}; +pub use item::{Debug, Item, ItemKind, SwordKind, ToolData, ToolKind}; use crate::assets; use specs::{Component, HashMapStorage, NullStorage}; diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index f756584b4a..b5358ec96e 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -10,7 +10,7 @@ mod location; mod phys; mod player; pub mod projectile; -mod states; +pub mod states; mod stats; mod visual; @@ -30,7 +30,9 @@ pub use controller::{ Mounting, }; pub use inputs::CanBuild; -pub use inventory::{item, Inventory, InventoryUpdate, Item, ItemKind, ToolData, ToolKind}; +pub use inventory::{ + item, Inventory, InventoryUpdate, Item, ItemKind, SwordKind, ToolData, ToolKind, +}; pub use last::Last; pub use location::Waypoint; pub use phys::{ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index b6ba2fe2c8..db7018fb9d 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -20,7 +20,7 @@ impl StateHandle for BasicBlockState { }; // TODO: Apply simple move speed debuff instead - update.character.move_disabled = true; + update.character.move_disabled_this_tick = true; // Update movement update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -32,7 +32,7 @@ impl StateHandle for BasicBlockState { if !ecs_data.inputs.secondary.is_pressed() { update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled = false; + update.character.move_disabled_this_tick = false; return update; } diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index fbfb9e93ef..c4c276845c 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -26,7 +26,7 @@ impl StateHandle for ChargeAttackState { // Prevent move state handling, handled here // ecs_data.updater.insert(*ecs_data.entity, OverrideMove); - update.character.action_disabled = true; + update.character.action_disabled_this_tick = true; update.character.move_state = Run(RunState); // Move player @@ -55,7 +55,7 @@ impl StateHandle for ChargeAttackState { // Go back to wielding or idling update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled = false; + update.character.move_disabled_this_tick= false; return update; } @@ -63,7 +63,7 @@ impl StateHandle for ChargeAttackState { if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled = false; + update.character.move_disabled_this_tick= false; return update; } diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index 6f13212c9c..ecf040f7f2 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -21,7 +21,7 @@ impl StateHandle for ClimbState { // Disable actions in this state update.character.action_state = Idle(IdleState); - update.character.action_disabled = true; + update.character.action_disabled_this_tick = true; // Move player update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -81,13 +81,13 @@ impl StateHandle for ClimbState { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost update.character.move_state = Jump(JumpState); - update.character.action_disabled = false; + update.character.action_disabled_this_tick = false; return update; } else { // Just fall off update.character.move_state = Fall(FallState); - update.character.action_disabled = false; + update.character.action_disabled_this_tick = false; return update; } @@ -96,7 +96,7 @@ impl StateHandle for ClimbState { // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { update.character.move_state = Stand(StandState); - update.character.action_disabled = false; + update.character.action_disabled_this_tick = false; return update; } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index f84ca53d5d..cb42711372 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -18,7 +18,7 @@ impl StateHandle for GlideState { }; // Prevent action in this state, set here - update.character.action_disabled = true; + update.character.action_disabled_this_tick = true; // Defaults for this state update.character.action_state = Idle(IdleState); diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 9c024ebfbc..2bf46eeaac 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -56,11 +56,12 @@ use super::{ }; /// #### A trait for implementing state `handle()`ing logic. -/// _Mimics the typical OOP style state machine pattern, but remains performant and consistent -/// with ECS data-behavior-separation constraint since trait fn's are syntactic sugar for -/// static fn's that accept their implementor's object type as its first parameter. This allows -/// for several benefits over implementing each state's behavior within the `CharacterState` update `System` -/// itself:_ +/// _Mimics the typical OOP style state machine pattern where states implement their own behavior, +/// exit conditions, and return new states to the state machine upon exit. +/// This is still performant and consistent with ECS data-behavior-separation constraint +/// since trait fn's are syntactic sugar for static fn's that accept their implementor's +/// object type as its first parameter. This allows for several benefits over implementing +/// each state's behavior within the `CharacterState` update `System` itself:_ /// /// 1. Less cognitive overhead: State's handling logic is next to the its data, and component (inside the state's .rs file). /// 2. Separation of concerns (between states): all logic within a state's `handle()` is relevant only to that state. diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index accae700c7..d9b14a6da0 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -20,7 +20,7 @@ impl StateHandle for RollState { }; // Prevent move state handling, handled here - update.character.move_disabled = true; + update.character.move_disabled_this_tick= true; // Update velocity update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) @@ -39,7 +39,7 @@ impl StateHandle for RollState { if self.remaining_duration == Duration::default() { // If so, go back to wielding or idling update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled = false; + update.character.move_disabled_this_tick= false; return update; } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 33de69af82..4096d11474 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -17,7 +17,7 @@ impl StateHandle for SitState { }; // Prevent action state handling - update.character.action_disabled = true; + update.character.action_disabled_this_tick = true; update.character.action_state = Idle(IdleState); update.character.move_state = Sit(SitState); @@ -27,27 +27,27 @@ impl StateHandle for SitState { // Can't hurt to be safe :shrug: if !ecs_data.physics.on_ground { update.character.move_state = determine_fall_or_swim(ecs_data.physics); - update.character.move_disabled = false; + update.character.move_disabled_this_tick = false; return update; } // Try to jump if ecs_data.inputs.jump.is_pressed() { update.character.move_state = Jump(JumpState); - update.character.action_disabled = false; + update.character.action_disabled_this_tick = false; return update; } // Try to Run if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { update.character.move_state = Run(RunState); - update.character.action_disabled = false; + update.character.action_disabled_this_tick = false; return update; } // Try to Stand if ecs_data.inputs.sit.is_just_pressed() { update.character.move_state = Stand(StandState); - update.character.action_disabled = false; + update.character.action_disabled_this_tick = false; return update; } diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 8a2a9c1672..3c525f30fd 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -107,7 +107,10 @@ impl<'a> System<'a> for Sys { } // Determine new move state if character can move - if let (None, false) = (move_overrides.get(entity), character.move_disabled) { + if let (None, false) = ( + move_overrides.get(entity), + character.move_disabled_this_tick, + ) { let state_update = character.move_state.handle(&EcsStateData { entity: &entity, uid, @@ -131,8 +134,15 @@ impl<'a> System<'a> for Sys { *ori = state_update.ori; } + // Reset disabled every tick. Should be + // set every tick by states that use it. + character.move_disabled_this_tick = false; + // Determine new action if character can act - if let (None, false) = (action_overrides.get(entity), character.action_disabled) { + if let (None, false) = ( + action_overrides.get(entity), + character.action_disabled_this_tick, + ) { let state_update = character.action_state.handle(&EcsStateData { entity: &entity, uid, @@ -155,6 +165,10 @@ impl<'a> System<'a> for Sys { *vel = state_update.vel; *ori = state_update.ori; } + + // Reset disabled every tick. Should + // be set every tick by states that use it. + character.action_disabled_this_tick = false; } } } diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index b63b66f05c..11285bb637 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -7,7 +7,7 @@ use common::{ comp::{ ActionState, AttackKind::*, BasicAttackState, Body, CharacterState, DodgeKind::*, FallState, GlideState, IdleState, ItemKind, MoveState, Pos, RollState, RunState, - StandState, Stats, ToolData, + StandState, Stats, SwordKind::*, ToolData, ToolKind::*, }, event::{EventBus, SfxEvent, SfxEventItem}, }; @@ -279,8 +279,8 @@ mod tests { &CharacterState { move_state: MoveState::Stand(StandState), action_state: ActionState::Idle(IdleState), - action_disabled: false, - move_disabled: false, + action_disabled_this_tick: false, + move_disabled_this_tick: false, }, SfxEvent::Idle, &stats, @@ -297,8 +297,8 @@ mod tests { &CharacterState { move_state: MoveState::Run(RunState), action_state: ActionState::Idle(IdleState), - action_disabled: false, - move_disabled: false, + action_disabled_this_tick: false, + move_disabled_this_tick: false, }, SfxEvent::Idle, &stats, @@ -315,8 +315,8 @@ mod tests { &CharacterState { action_state: ActionState::Dodge(Roll(RollState::default())), move_state: MoveState::Run(RunState), - action_disabled: false, - move_disabled: true, + action_disabled_this_tick: false, + move_disabled_this_tick: true, }, SfxEvent::Run, &stats, @@ -333,8 +333,8 @@ mod tests { &CharacterState { move_state: MoveState::Fall(FallState), action_state: ActionState::Idle(IdleState), - action_disabled: false, - move_disabled: false, + action_disabled_this_tick: false, + move_disabled_this_tick: false, }, SfxEvent::Idle, &stats, @@ -351,8 +351,8 @@ mod tests { &CharacterState { move_state: MoveState::Glide(GlideState), action_state: ActionState::Idle(IdleState), - action_disabled: true, - move_disabled: false, + action_disabled_this_tick: true, + move_disabled_this_tick: false, }, SfxEvent::Jump, &stats, @@ -369,8 +369,8 @@ mod tests { &CharacterState { move_state: MoveState::Glide(GlideState), action_state: ActionState::Idle(IdleState), - action_disabled: true, - move_disabled: false, + action_disabled_this_tick: true, + move_disabled_this_tick: false, }, SfxEvent::Glide, &stats, @@ -387,8 +387,8 @@ mod tests { &CharacterState { move_state: MoveState::Fall(FallState), action_state: ActionState::Idle(IdleState), - move_disabled: false, - action_disabled: false, + move_disabled_this_tick: false, + action_disabled_this_tick: false, }, SfxEvent::Glide, &stats, @@ -410,13 +410,13 @@ mod tests { &CharacterState { move_state: MoveState::Stand(StandState), action_state: ActionState::Attack(BasicAttack(BasicAttackState::default())), - move_disabled: false, - action_disabled: false, + move_disabled_this_tick: false, + action_disabled_this_tick: false, }, SfxEvent::Idle, &stats, ); - assert_eq!(result, SfxEvent::Attack(Tool::Sword)); + // assert_eq!(result, SfxEvent::Attack(Sword(_))); } } From 2635c405fef9ef9c5d69dcd31ee7f769f69ffaa9 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Wed, 1 Jan 2020 09:16:29 -0800 Subject: [PATCH 012/387] Ability comps and sys --- common/src/comp/ability.rs | 34 +++++++++++++ common/src/comp/character_state.rs | 10 ---- common/src/comp/mod.rs | 2 + common/src/comp/states/basic_block.rs | 2 - common/src/comp/states/charge_attack.rs | 4 -- common/src/comp/states/climb.rs | 5 -- common/src/comp/states/glide.rs | 3 -- common/src/comp/states/mod.rs | 43 +++++++++++++++- common/src/comp/states/roll.rs | 4 -- common/src/comp/states/sit.rs | 5 -- common/src/comp/states/wield.rs | 13 +++-- common/src/sys/ability.rs | 64 ++++++++++++++++++++++++ common/src/sys/character_state.rs | 66 +++++++++++-------------- common/src/sys/mod.rs | 3 ++ 14 files changed, 184 insertions(+), 74 deletions(-) create mode 100644 common/src/comp/ability.rs create mode 100644 common/src/sys/ability.rs diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs new file mode 100644 index 0000000000..53c1a0ce4e --- /dev/null +++ b/common/src/comp/ability.rs @@ -0,0 +1,34 @@ +use crate::comp; +use specs::{Component, FlaggedStorage, HashMapStorage, VecStorage}; + +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub enum AbilityActionKind { + Primary, + Secondary, + Dodge, + Block, + // UpdatePool? +} +impl Default for AbilityActionKind { + fn default() -> Self { + Self::Primary + } +} +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct AbilityAction(pub AbilityActionKind); + +impl Component for AbilityAction { + type Storage = FlaggedStorage>; +} + +#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)] +pub struct AbilityPool { + pub primary: Option, + pub secondary: Option, + pub block: Option, + pub dodge: Option, +} + +impl Component for AbilityPool { + type Storage = HashMapStorage; +} diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index be95c8a687..a2ed953f54 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -141,14 +141,6 @@ pub struct CharacterState { /// _Primarily `handle()`s how character interacts with world, and upper body animations. /// Can be overidden by `MoveState`s using `action_disabled` flag. Example: `GlideState`_ pub action_state: ActionState, - - /// Used by `move_state` to disable `action_state` `handle()` calls. - /// Resets after every tick. States that use it should set it every tick. - pub action_disabled_this_tick: bool, - - /// Used by `action_state` to disable `move_state` `handle()` calls. - /// Resets after every tick. States that use it should set it every tick. - pub move_disabled_this_tick: bool, } impl CharacterState { @@ -176,8 +168,6 @@ impl Default for CharacterState { Self { move_state: MoveState::Fall(FallState), action_state: ActionState::Idle(IdleState), - action_disabled_this_tick: false, - move_disabled_this_tick: false, } } } diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index b5358ec96e..26a02bdef6 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -1,3 +1,4 @@ +mod ability; mod admin; mod agent; mod body; @@ -15,6 +16,7 @@ mod stats; mod visual; // Reexports +pub use ability::{AbilityAction, AbilityActionKind, AbilityPool}; pub use admin::Admin; pub use agent::Agent; pub use body::{ diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index db7018fb9d..89e99ad700 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -20,7 +20,6 @@ impl StateHandle for BasicBlockState { }; // TODO: Apply simple move speed debuff instead - update.character.move_disabled_this_tick = true; // Update movement update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -32,7 +31,6 @@ impl StateHandle for BasicBlockState { if !ecs_data.inputs.secondary.is_pressed() { update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled_this_tick = false; return update; } diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index c4c276845c..f72d121685 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -25,8 +25,6 @@ impl StateHandle for ChargeAttackState { }; // Prevent move state handling, handled here - // ecs_data.updater.insert(*ecs_data.entity, OverrideMove); - update.character.action_disabled_this_tick = true; update.character.move_state = Run(RunState); // Move player @@ -55,7 +53,6 @@ impl StateHandle for ChargeAttackState { // Go back to wielding or idling update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled_this_tick= false; return update; } @@ -63,7 +60,6 @@ impl StateHandle for ChargeAttackState { if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled_this_tick= false; return update; } diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index ecf040f7f2..73f2d19677 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -19,9 +19,7 @@ impl StateHandle for ClimbState { character: *ecs_data.character, }; - // Disable actions in this state update.character.action_state = Idle(IdleState); - update.character.action_disabled_this_tick = true; // Move player update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -81,13 +79,11 @@ impl StateHandle for ClimbState { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost update.character.move_state = Jump(JumpState); - update.character.action_disabled_this_tick = false; return update; } else { // Just fall off update.character.move_state = Fall(FallState); - update.character.action_disabled_this_tick = false; return update; } @@ -96,7 +92,6 @@ impl StateHandle for ClimbState { // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { update.character.move_state = Stand(StandState); - update.character.action_disabled_this_tick = false; return update; } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index cb42711372..1c95eac184 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -17,9 +17,6 @@ impl StateHandle for GlideState { character: *ecs_data.character, }; - // Prevent action in this state, set here - update.character.action_disabled_this_tick = true; - // Defaults for this state update.character.action_state = Idle(IdleState); update.character.move_state = Glide(GlideState); diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 2bf46eeaac..fa56c53694 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -54,7 +54,6 @@ use super::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, MoveState, MoveState::*, StateUpdate, }; - /// #### A trait for implementing state `handle()`ing logic. /// _Mimics the typical OOP style state machine pattern where states implement their own behavior, /// exit conditions, and return new states to the state machine upon exit. @@ -98,6 +97,48 @@ impl StateHandle for ActionState { } } +// Other fn's that relate to individual `ActionState`s +impl ActionState { + /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing + pub fn overrides_move_state(&self) -> bool { + match self { + Attack(kind) => match kind { + BasicAttack(state) => false, + Charge(state) => true, + }, + Block(kind) => match kind { + BasicBlock(state) => true, + }, + Dodge(kind) => match kind { + Roll(state) => true, + }, + Wield(state) => false, + Idle(state) => false, + // All states should be explicitly handled + // Do not use default match: _ => {}, + } + } +} + +// Other fn's that relate to individual `MoveState`s +impl MoveState { + /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing + pub fn overrides_action_state(&self) -> bool { + match self { + Stand(state) => false, + Run(state) => false, + Jump(state) => false, + Climb(state) => true, + Glide(state) => true, + Swim(state) => false, + Fall(state) => false, + Sit(state) => true, + // All states should be explicitly handled + // Do not use default match: _ => {}, + } + } +} + /// Public interface that passes EcsStateData to `StateHandle`s `handle()` fn impl StateHandle for MoveState { /// Passes handle to variant handlers diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index d9b14a6da0..8f8ce40192 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -19,9 +19,6 @@ impl StateHandle for RollState { ori: *ecs_data.ori, }; - // Prevent move state handling, handled here - update.character.move_disabled_this_tick= true; - // Update velocity update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) @@ -39,7 +36,6 @@ impl StateHandle for RollState { if self.remaining_duration == Duration::default() { // If so, go back to wielding or idling update.character.action_state = attempt_wield(ecs_data.stats); - update.character.move_disabled_this_tick= false; return update; } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 4096d11474..e1c4f5f389 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -17,7 +17,6 @@ impl StateHandle for SitState { }; // Prevent action state handling - update.character.action_disabled_this_tick = true; update.character.action_state = Idle(IdleState); update.character.move_state = Sit(SitState); @@ -27,27 +26,23 @@ impl StateHandle for SitState { // Can't hurt to be safe :shrug: if !ecs_data.physics.on_ground { update.character.move_state = determine_fall_or_swim(ecs_data.physics); - update.character.move_disabled_this_tick = false; return update; } // Try to jump if ecs_data.inputs.jump.is_pressed() { update.character.move_state = Jump(JumpState); - update.character.action_disabled_this_tick = false; return update; } // Try to Run if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { update.character.move_state = Run(RunState); - update.character.action_disabled_this_tick = false; return update; } // Try to Stand if ecs_data.inputs.sit.is_just_pressed() { update.character.move_state = Stand(StandState); - update.character.action_disabled_this_tick = false; return update; } diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index 3036f86fef..3037755c3f 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,4 +1,7 @@ -use crate::comp::{ActionState::*, EcsStateData, IdleState, StateHandle, StateUpdate}; +use crate::comp::{ + AbilityAction, AbilityActionKind::*, ActionState::*, EcsStateData, IdleState, StateHandle, + StateUpdate, +}; use crate::util::movement_utils::*; use std::time::Duration; @@ -30,9 +33,13 @@ impl StateHandle for WieldState { // Try weapon actions if ecs_data.inputs.primary.is_pressed() { - update.character.action_state = determine_primary_ability(ecs_data.stats); + ecs_data + .updater + .insert(*ecs_data.entity, AbilityAction(Primary)); } else if ecs_data.inputs.secondary.is_pressed() { - // TODO: SecondaryStart + ecs_data + .updater + .insert(*ecs_data.entity, AbilityAction(Secondary)); } } else { // Equip delay hasn't expired yet diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs new file mode 100644 index 0000000000..ed0b327032 --- /dev/null +++ b/common/src/sys/ability.rs @@ -0,0 +1,64 @@ +use crate::comp::{ + AbilityAction, AbilityActionKind, AbilityPool, ActionState::*, AttackKind, CharacterState, +}; + +use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; + +/// # Ability System +/// #### Updates tuples of ( `CharacterState`, `AbilityAction`, and `AbilityPool`s ) +/// _Each update determines what type of ability is being started, and looks into the AbilityPool for which +/// Ability that should be used. System then updates `CharacterState` to that Ability._ +pub struct Sys; + +impl<'a> System<'a> for Sys { + type SystemData = ( + Entities<'a>, + Read<'a, LazyUpdate>, + WriteStorage<'a, CharacterState>, + ReadStorage<'a, AbilityAction>, + ReadStorage<'a, AbilityPool>, + ); + fn run( + &mut self, + ( + entities, + updater, + mut character_state_storage, + ability_action_storage, + ability_pool_storage, + ): Self::SystemData, + ) { + for (entity, mut character, ability_action, ability_pool) in ( + &entities, + &mut character_state_storage, + &ability_action_storage, + &ability_pool_storage, + ) + .join() + { + match ability_action.0 { + AbilityActionKind::Primary => { + if let Some(attack_kind) = ability_pool.primary { + character.action_state = Attack(attack_kind); + } + } + AbilityActionKind::Secondary => { + if let Some(attack_kind) = ability_pool.secondary { + character.action_state = Attack(attack_kind); + } + } + AbilityActionKind::Block => { + if let Some(block_kind) = ability_pool.block { + character.action_state = Block(block_kind); + } + } + AbilityActionKind::Dodge => { + if let Some(dodge_kind) = ability_pool.dodge { + character.action_state = Dodge(dodge_kind); + } + } + _ => {} + } + } + } +} diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 3c525f30fd..58baca6e33 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,6 +1,6 @@ use crate::{ comp::{ - Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, + states::*, Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitState, StateHandle, Stats, Vel, }, @@ -106,42 +106,10 @@ impl<'a> System<'a> for Sys { return; } - // Determine new move state if character can move - if let (None, false) = ( - move_overrides.get(entity), - character.move_disabled_this_tick, - ) { - let state_update = character.move_state.handle(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); - - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } - - // Reset disabled every tick. Should be - // set every tick by states that use it. - character.move_disabled_this_tick = false; - // Determine new action if character can act if let (None, false) = ( action_overrides.get(entity), - character.action_disabled_this_tick, + character.action_state.overrides_move_state(), ) { let state_update = character.action_state.handle(&EcsStateData { entity: &entity, @@ -166,9 +134,33 @@ impl<'a> System<'a> for Sys { *ori = state_update.ori; } - // Reset disabled every tick. Should - // be set every tick by states that use it. - character.action_disabled_this_tick = false; + // Determine new move state if character can move + if let (None, false) = ( + move_overrides.get(entity), + character.move_state.overrides_action_state(), + ) { + let state_update = character.move_state.handle(&EcsStateData { + entity: &entity, + uid, + character, + pos, + vel, + ori, + dt: &dt, + inputs, + stats, + body, + physics, + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); + + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; + } } } } diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index 948596139a..64b39d750e 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -1,3 +1,4 @@ +mod ability; pub mod agent; pub mod character_state; mod cleanup; @@ -11,6 +12,7 @@ mod stats; use specs::DispatcherBuilder; // System names +const ABILITY_SYS: &str = "ability_sys"; const AGENT_SYS: &str = "agent_sys"; const CHARACTER_STATE_SYS: &str = "character_state_sys"; const CONTROLLER_SYS: &str = "controller_sys"; @@ -24,6 +26,7 @@ pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(agent::Sys, AGENT_SYS, &[]); dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS]); dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); + dispatch_builder.add(ability::Sys, ABILITY_SYS, &[CHARACTER_STATE_SYS]); dispatch_builder.add(combat::Sys, COMBAT_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(stats::Sys, STATS_SYS, &[COMBAT_SYS]); dispatch_builder.add( From 2f3ccbc5d66cf3136923c9cd157d60cdce805dc0 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Fri, 3 Jan 2020 12:46:41 -0800 Subject: [PATCH 013/387] Update Comments --- common/src/comp/character_state.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index a2ed953f54..9ebaf3eb9e 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -126,20 +126,16 @@ impl ActionState { } /// __A concurrent state machine that allows for separate `ActionState`s and `MoveState`s.__ -/// -/// _Each state can optionally override the other through `*_disabled` flag_ #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct CharacterState { /// __How the character is currently moving, e.g. Running, Standing, Falling.__ /// /// _Primarily `handle()`s updating `Pos`, `Vel`, `Ori`, and lower body animations. - /// Can be overidden by `ActionState`s using `move_disabled` flag. Example: `ChargeAttackState`_ pub move_state: MoveState, /// __How the character is currently acting, e.g. Wielding, Attacking, Dodging.__ /// /// _Primarily `handle()`s how character interacts with world, and upper body animations. - /// Can be overidden by `MoveState`s using `action_disabled` flag. Example: `GlideState`_ pub action_state: ActionState, } From 8fe5cec94771d1bc9dfd6fe264c5e8fea1eb975e Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 10:19:09 -0800 Subject: [PATCH 014/387] Clean up, make state handlers options --- common/src/comp/character_state.rs | 44 +++++------ common/src/comp/states/basic_attack.rs | 11 +-- common/src/comp/states/basic_block.rs | 8 +- common/src/comp/states/charge_attack.rs | 14 ++-- common/src/comp/states/climb.rs | 14 ++-- common/src/comp/states/fall.rs | 12 +-- common/src/comp/states/glide.rs | 16 ++-- common/src/comp/states/idle.rs | 10 +-- common/src/comp/states/jump.rs | 8 +- common/src/comp/states/mod.rs | 75 +++++++++---------- common/src/comp/states/roll.rs | 10 +-- common/src/comp/states/run.rs | 16 ++-- common/src/comp/states/sit.rs | 18 ++--- common/src/comp/states/stand.rs | 16 ++-- common/src/comp/states/swim.rs | 12 +-- common/src/comp/states/wield.rs | 26 +++---- common/src/sys/ability.rs | 45 +++++------ common/src/sys/agent.rs | 2 +- common/src/sys/character_state.rs | 8 +- common/src/util/mod.rs | 2 +- .../{movement_utils.rs => state_utils.rs} | 26 +++---- 21 files changed, 199 insertions(+), 194 deletions(-) rename common/src/util/{movement_utils.rs => state_utils.rs} (90%) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 9ebaf3eb9e..0a2d340a44 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -5,6 +5,8 @@ use crate::{ event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, }; +use serde::Deserialize; +use serde::Serialize; use specs::LazyUpdate; use specs::{Component, Entity, FlaggedStorage, HashMapStorage, NullStorage}; use sphynx::Uid; @@ -36,20 +38,20 @@ pub struct StateUpdate { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum MoveState { - Stand(StandState), - Run(RunState), - Sit(SitState), - Jump(JumpState), - Fall(FallState), - Glide(GlideState), - Swim(SwimState), - Climb(ClimbState), + Stand(Option), + Run(Option), + Sit(Option), + Jump(Option), + Fall(Option), + Glide(Option), + Swim(Option), + Climb(Option), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum ActionState { - Idle(IdleState), - Wield(WieldState), + Idle(Option), + Wield(Option), Attack(AttackKind), Block(BlockKind), Dodge(DodgeKind), @@ -58,24 +60,24 @@ pub enum ActionState { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum AttackKind { - BasicAttack(BasicAttackState), - Charge(ChargeAttackState), + BasicAttack(Option), + Charge(Option), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum BlockKind { - BasicBlock(BasicBlockState), + BasicBlock(Option), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum DodgeKind { - Roll(RollState), + Roll(Option), } impl ActionState { pub fn is_equip_finished(&self) -> bool { match self { - Wield(WieldState { equip_delay }) => *equip_delay == Duration::default(), + Wield(Some(WieldState { equip_delay })) => *equip_delay == Duration::default(), _ => true, } } @@ -83,21 +85,21 @@ impl ActionState { /// Returns the current `equip_delay` if in `WieldState`, otherwise `Duration::default()` pub fn get_delay(&self) -> Duration { match self { - Wield(WieldState { equip_delay }) => *equip_delay, + Wield(Some(WieldState { equip_delay })) => *equip_delay, _ => Duration::default(), } } pub fn is_attacking(&self) -> bool { match self { - Block(_) => true, + Attack(_) => true, _ => false, } } pub fn is_blocking(&self) -> bool { match self { - Attack(_) => true, + Block(_) => true, _ => false, } } @@ -126,7 +128,7 @@ impl ActionState { } /// __A concurrent state machine that allows for separate `ActionState`s and `MoveState`s.__ -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct CharacterState { /// __How the character is currently moving, e.g. Running, Standing, Falling.__ /// @@ -162,8 +164,8 @@ impl CharacterState { impl Default for CharacterState { fn default() -> Self { Self { - move_state: MoveState::Fall(FallState), - action_state: ActionState::Idle(IdleState), + move_state: MoveState::Fall(Some(FallState)), + action_state: ActionState::Idle(Some(IdleState)), } } } diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 493b42aafd..b8fbb8a09a 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -1,7 +1,8 @@ use crate::comp::{ - ActionState::Attack, AttackKind::BasicAttack, EcsStateData, StateHandle, StateUpdate, + ActionState::Attack, AttackKind::BasicAttack, EcsStateData, MoveState, StateHandler, + StateUpdate, ToolData, }; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -10,7 +11,7 @@ pub struct BasicAttackState { pub remaining_duration: Duration, } -impl StateHandle for BasicAttackState { +impl StateHandler for BasicAttackState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, @@ -27,12 +28,12 @@ impl StateHandle for BasicAttackState { } // Otherwise, tick down remaining_duration, and keep rolling - update.character.action_state = Attack(BasicAttack(BasicAttackState { + update.character.action_state = Attack(BasicAttack(Some(BasicAttackState { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - })); + }))); return update; } diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index 89e99ad700..6d62a55ada 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -1,16 +1,16 @@ use super::{BLOCK_ACCEL, BLOCK_SPEED}; -use crate::comp::{EcsStateData, StateHandle, StateUpdate}; -use crate::util::movement_utils::*; +use crate::comp::{EcsStateData, StateHandler, StateUpdate}; +use crate::util::state_utils::*; use std::time::Duration; use vek::Vec2; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct BasicBlockState { /// How long the blocking state has been active pub active_duration: Duration, } -impl StateHandle for BasicBlockState { +impl StateHandler for BasicBlockState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index f72d121685..dd6854809d 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -1,21 +1,21 @@ use crate::comp::{ ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, - MoveState::Run, RunState, StateHandle, StateUpdate, + MoveState::Run, RunState, StateHandler, StateUpdate, }; use crate::event::ServerEvent; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; use super::CHARGE_SPEED; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ChargeAttackState { /// How long the state has until exitting pub remaining_duration: Duration, } -impl StateHandle for ChargeAttackState { +impl StateHandler for ChargeAttackState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, @@ -25,7 +25,7 @@ impl StateHandle for ChargeAttackState { }; // Prevent move state handling, handled here - update.character.move_state = Run(RunState); + update.character.move_state = Run(Some(RunState)); // Move player update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) @@ -64,12 +64,12 @@ impl StateHandle for ChargeAttackState { } // Tick remaining-duration and keep charging - update.character.action_state = Attack(Charge(ChargeAttackState { + update.character.action_state = Attack(Charge(Some(ChargeAttackState { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - })); + }))); return update; } diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index 73f2d19677..e315e7c5e2 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -1,16 +1,16 @@ use super::{ ActionState::*, EcsStateData, FallState, IdleState, JumpState, MoveState::*, StandState, - StateHandle, StateUpdate, + StateHandler, StateUpdate, }; use super::{CLIMB_SPEED, HUMANOID_CLIMB_ACCEL, HUMANOID_SPEED}; use crate::sys::phys::GRAVITY; use vek::vec::{Vec2, Vec3}; use vek::Lerp; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ClimbState; -impl StateHandle for ClimbState { +impl StateHandler for ClimbState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, @@ -19,7 +19,7 @@ impl StateHandle for ClimbState { character: *ecs_data.character, }; - update.character.action_state = Idle(IdleState); + update.character.action_state = Idle(Some(IdleState)); // Move player update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -78,12 +78,12 @@ impl StateHandle for ClimbState { if let None = ecs_data.physics.on_wall { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost - update.character.move_state = Jump(JumpState); + update.character.move_state = Jump(Some(JumpState)); return update; } else { // Just fall off - update.character.move_state = Fall(FallState); + update.character.move_state = Fall(Some(FallState)); return update; } @@ -91,7 +91,7 @@ impl StateHandle for ClimbState { // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { - update.character.move_state = Stand(StandState); + update.character.move_state = Stand(Some(StandState)); return update; } diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index 78b68cc7f7..09619fae0e 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -1,13 +1,13 @@ use super::{HUMANOID_AIR_ACCEL, HUMANOID_AIR_SPEED}; -use crate::comp::{ClimbState, EcsStateData, GlideState, MoveState::*, StateHandle, StateUpdate}; +use crate::comp::{ClimbState, EcsStateData, GlideState, MoveState::*, StateHandler, StateUpdate}; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; use vek::{Vec2, Vec3}; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct FallState; -impl StateHandle for FallState { +impl StateHandler for FallState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, @@ -44,13 +44,13 @@ impl StateHandle for FallState { // Check to start climbing if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(ClimbState); + update.character.move_state = Climb(Some(ClimbState)); return update; } // Check gliding if ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Glide(GlideState); + update.character.move_state = Glide(Some(GlideState)); return update; } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index 1c95eac184..768adbc0b5 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -1,14 +1,14 @@ use super::{GLIDE_ACCEL, GLIDE_ANTIGRAV, GLIDE_SPEED}; use crate::comp::{ ActionState::*, ClimbState, EcsStateData, FallState, IdleState, MoveState::*, StandState, - StateHandle, StateUpdate, + StateHandler, StateUpdate, }; use vek::{Vec2, Vec3}; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct GlideState; -impl StateHandle for GlideState { +impl StateHandler for GlideState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, @@ -18,8 +18,8 @@ impl StateHandle for GlideState { }; // Defaults for this state - update.character.action_state = Idle(IdleState); - update.character.move_state = Glide(GlideState); + update.character.action_state = Idle(Some(IdleState)); + update.character.move_state = Glide(Some(GlideState)); // Move player according to movement direction vector update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -54,19 +54,19 @@ impl StateHandle for GlideState { // If glide button isn't held, start falling if !ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Fall(FallState); + update.character.move_state = Fall(Some(FallState)); return update; } // If there is a wall in front of character go to climb if let Some(_wall_dir) = ecs_data.physics.on_wall { - update.character.move_state = Climb(ClimbState); + update.character.move_state = Climb(Some(ClimbState)); return update; } // If on ground go to stand if ecs_data.physics.on_ground { - update.character.move_state = Stand(StandState); + update.character.move_state = Stand(Some(StandState)); return update; } diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs index 49f36fe591..5f41308f34 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/comp/states/idle.rs @@ -1,13 +1,13 @@ use super::TEMP_EQUIP_DELAY; use crate::comp::{ - ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandle, StateUpdate, WieldState, + ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, WieldState, }; use std::time::Duration; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct IdleState; -impl StateHandle for IdleState { +impl StateHandler for IdleState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -23,9 +23,9 @@ impl StateHandle for IdleState { && update.character.action_state.is_equip_finished()) { if let Some(Tool { .. }) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { - update.character.action_state = Wield(WieldState { + update.character.action_state = Wield(Some(WieldState { equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) + })) } // else unarmed stuff? diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index e3af3f9253..5581c4d796 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -1,10 +1,10 @@ -use super::{EcsStateData, FallState, MoveState::*, StateHandle, StateUpdate}; +use super::{EcsStateData, FallState, MoveState::*, StateHandler, StateUpdate}; use crate::event::LocalEvent; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct JumpState; -impl StateHandle for JumpState { +impl StateHandler for JumpState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -19,7 +19,7 @@ impl StateHandle for JumpState { .emit(LocalEvent::Jump(*ecs_data.entity)); // Immediately go to falling state after jump impulse - update.character.move_state = Fall(FallState); + update.character.move_state = Fall(Some(FallState)); return update; } } diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index fa56c53694..4b3902673d 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -54,6 +54,8 @@ use super::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, MoveState, MoveState::*, StateUpdate, }; +use std::time::Duration; + /// #### A trait for implementing state `handle()`ing logic. /// _Mimics the typical OOP style state machine pattern where states implement their own behavior, /// exit conditions, and return new states to the state machine upon exit. @@ -70,50 +72,49 @@ use super::{ /// `CharacterState` update `System` passes `EcsStateData` to `ActionState`/`MoveState` `handle()` which matches the character's /// current state to its `handle()` fn, hiding the implementation details, since the System is only concerned with /// how the update flow occurs and is in charge of updating the ECS components. -pub trait StateHandle { +pub trait StateHandler: Default { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; } // Public interface that passes EcsStateData to `StateHandle`s `handle()` fn -impl StateHandle for ActionState { +impl ActionState { /// Passes handle to variant or subvariant handlers - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { Attack(kind) => match kind { - BasicAttack(state) => state.handle(ecs_data), - Charge(state) => state.handle(ecs_data), + BasicAttack(Some(state)) => state.handle(&ecs_data), + Charge(Some(state)) => state.handle(&ecs_data), }, Block(kind) => match kind { - BasicBlock(state) => state.handle(ecs_data), + BasicBlock(Some(state)) => state.handle(&ecs_data), }, Dodge(kind) => match kind { - Roll(state) => state.handle(ecs_data), + Roll(Some(state)) => state.handle(&ecs_data), }, - Wield(state) => state.handle(ecs_data), - Idle(state) => state.handle(ecs_data), + Wield(Some(state)) => state.handle(&ecs_data), + Idle(Some(state)) => state.handle(&ecs_data), + // // All states should be explicitly handled // Do not use default match: _ => {}, } } -} -// Other fn's that relate to individual `ActionState`s -impl ActionState { /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing pub fn overrides_move_state(&self) -> bool { match self { Attack(kind) => match kind { - BasicAttack(state) => false, - Charge(state) => true, + BasicAttack(_) => false, + Charge(_) => true, }, Block(kind) => match kind { - BasicBlock(state) => true, + BasicBlock(_) => true, }, Dodge(kind) => match kind { - Roll(state) => true, + Roll(_) => true, }, - Wield(state) => false, - Idle(state) => false, + Wield(_) => false, + Idle(_) => false, + // // All states should be explicitly handled // Do not use default match: _ => {}, } @@ -125,33 +126,31 @@ impl MoveState { /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing pub fn overrides_action_state(&self) -> bool { match self { - Stand(state) => false, - Run(state) => false, - Jump(state) => false, - Climb(state) => true, - Glide(state) => true, - Swim(state) => false, - Fall(state) => false, - Sit(state) => true, + Stand(_) => false, + Run(_) => false, + Jump(_) => false, + Climb(_) => true, + Glide(_) => true, + Swim(_) => false, + Fall(_) => false, + Sit(_) => true, + // // All states should be explicitly handled // Do not use default match: _ => {}, } } -} -/// Public interface that passes EcsStateData to `StateHandle`s `handle()` fn -impl StateHandle for MoveState { /// Passes handle to variant handlers - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { - Stand(state) => state.handle(&ecs_data), - Run(state) => state.handle(&ecs_data), - Jump(state) => state.handle(&ecs_data), - Climb(state) => state.handle(&ecs_data), - Glide(state) => state.handle(&ecs_data), - Swim(state) => state.handle(&ecs_data), - Fall(state) => state.handle(&ecs_data), - Sit(state) => state.handle(&ecs_data), + Stand(Some(state)) => state.handle(&ecs_data), + Run(Some(state)) => state.handle(&ecs_data), + Jump(Some(state)) => state.handle(&ecs_data), + Climb(Some(state)) => state.handle(&ecs_data), + Glide(Some(state)) => state.handle(&ecs_data), + Swim(Some(state)) => state.handle(&ecs_data), + Fall(Some(state)) => state.handle(&ecs_data), + Sit(Some(state)) => state.handle(&ecs_data), // All states should be explicitly handled // Do not use default match: _ => {}, } diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 8f8ce40192..d7c62fce95 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,6 +1,6 @@ use super::ROLL_SPEED; -use crate::comp::{ActionState::*, DodgeKind::*, EcsStateData, StateHandle, StateUpdate}; -use crate::util::movement_utils::*; +use crate::comp::{ActionState::*, DodgeKind::*, EcsStateData, StateHandler, StateUpdate}; +use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; @@ -10,7 +10,7 @@ pub struct RollState { remaining_duration: Duration, } -impl StateHandle for RollState { +impl StateHandler for RollState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -40,12 +40,12 @@ impl StateHandle for RollState { } // Otherwise, tick down remaining_duration - update.character.action_state = Dodge(Roll(RollState { + update.character.action_state = Dodge(Roll(Some(RollState { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - })); + }))); // Keep rolling return update; diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index bc59b7f472..755e8b8e56 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -1,15 +1,15 @@ use super::{HUMANOID_ACCEL, HUMANOID_SPEED}; use crate::comp::{ - ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandle, + ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandler, StateUpdate, }; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; use vek::vec::{Vec2, Vec3}; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct RunState; -impl StateHandle for RunState { +impl StateHandler for RunState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -46,25 +46,25 @@ impl StateHandle for RunState { // Try to sit if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Sit(SitState); + update.character.move_state = Sit(Some(SitState)); return update; } // Try to climb if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(ClimbState); + update.character.move_state = Climb(Some(ClimbState)); return update; } // Try to jump if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = Jump(JumpState); + update.character.move_state = Jump(Some(JumpState)); return update; } // Try to glide if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Glide(GlideState); + update.character.move_state = Glide(Some(GlideState)); return update; } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index e1c4f5f389..58763c9e0d 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -1,13 +1,13 @@ use crate::comp::{ ActionState::*, EcsStateData, IdleState, JumpState, MoveState::*, RunState, StandState, - StateHandle, StateUpdate, + StateHandler, StateUpdate, }; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct SitState; -impl StateHandle for SitState { +impl StateHandler for SitState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -17,8 +17,8 @@ impl StateHandle for SitState { }; // Prevent action state handling - update.character.action_state = Idle(IdleState); - update.character.move_state = Sit(SitState); + update.character.action_state = Idle(Some(IdleState)); + update.character.move_state = Sit(Some(SitState)); // Try to Fall // ... maybe the ground disappears, @@ -30,19 +30,19 @@ impl StateHandle for SitState { } // Try to jump if ecs_data.inputs.jump.is_pressed() { - update.character.move_state = Jump(JumpState); + update.character.move_state = Jump(Some(JumpState)); return update; } // Try to Run if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = Run(RunState); + update.character.move_state = Run(Some(RunState)); return update; } // Try to Stand if ecs_data.inputs.sit.is_just_pressed() { - update.character.move_state = Stand(StandState); + update.character.move_state = Stand(Some(StandState)); return update; } diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index dc16d73af2..d1c5a95574 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -1,13 +1,13 @@ use crate::comp::{ - ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandle, + ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandler, StateUpdate, }; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct StandState; -impl StateHandle for StandState { +impl StateHandler for StandState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -18,25 +18,25 @@ impl StateHandle for StandState { // Try to sit if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Sit(SitState); + update.character.move_state = Sit(Some(SitState)); return update; } // Try to climb if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(ClimbState); + update.character.move_state = Climb(Some(ClimbState)); return update; } // Try to jump if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = Jump(JumpState); + update.character.move_state = Jump(Some(JumpState)); return update; } // Check gliding if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Glide(GlideState); + update.character.move_state = Glide(Some(GlideState)); return update; } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index ffaf1b2673..87f350cb58 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -1,12 +1,12 @@ use super::{HUMANOID_WATER_ACCEL, HUMANOID_WATER_SPEED}; -use crate::comp::{EcsStateData, MoveState::*, RunState, StandState, StateHandle, StateUpdate}; +use crate::comp::{EcsStateData, MoveState::*, RunState, StandState, StateHandler, StateUpdate}; use crate::sys::phys::GRAVITY; use vek::{Vec2, Vec3}; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct SwimState; -impl StateHandle for SwimState { +impl StateHandler for SwimState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -51,16 +51,16 @@ impl StateHandle for SwimState { // Not on ground if !ecs_data.physics.on_ground { - update.character.move_state = Swim(SwimState); + update.character.move_state = Swim(Some(SwimState)); return update; } // On ground else { // Return to running or standing based on move inputs update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunState) + Run(Some(RunState)) } else { - Stand(StandState) + Stand(Some(StandState)) }; return update; diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index 3037755c3f..ddf91961f4 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,18 +1,18 @@ use crate::comp::{ - AbilityAction, AbilityActionKind::*, ActionState::*, EcsStateData, IdleState, StateHandle, + AbilityAction, AbilityActionKind::*, ActionState::*, EcsStateData, IdleState, StateHandler, StateUpdate, }; -use crate::util::movement_utils::*; +use crate::util::state_utils::*; use std::time::Duration; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct WieldState { /// How long before a new action can be performed /// after equipping pub equip_delay: Duration, } -impl StateHandle for WieldState { +impl StateHandler for WieldState { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -27,29 +27,29 @@ impl StateHandle for WieldState { if ecs_data.inputs.toggle_wield.is_just_pressed() && ecs_data.character.action_state.is_equip_finished() { - update.character.action_state = Idle(IdleState); + update.character.action_state = Idle(Some(IdleState)); return update; } // Try weapon actions if ecs_data.inputs.primary.is_pressed() { - ecs_data - .updater - .insert(*ecs_data.entity, AbilityAction(Primary)); + // ecs_data + // .updater + // .insert(*ecs_data.entity, AbilityAction(Primary)); } else if ecs_data.inputs.secondary.is_pressed() { - ecs_data - .updater - .insert(*ecs_data.entity, AbilityAction(Secondary)); + // ecs_data + // .updater + // .insert(*ecs_data.entity, AbilityAction(Secondary)); } } else { // Equip delay hasn't expired yet // Update wield delay - update.character.action_state = Wield(WieldState { + update.character.action_state = Wield(Some(WieldState { equip_delay: self .equip_delay .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - }); + })); } return update; diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs index ed0b327032..4aa798e1bd 100644 --- a/common/src/sys/ability.rs +++ b/common/src/sys/ability.rs @@ -1,5 +1,8 @@ +#![allow(unused_imports)] +#![allow(dead_code)] use crate::comp::{ AbilityAction, AbilityActionKind, AbilityPool, ActionState::*, AttackKind, CharacterState, + StateHandler, }; use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; @@ -37,27 +40,27 @@ impl<'a> System<'a> for Sys { .join() { match ability_action.0 { - AbilityActionKind::Primary => { - if let Some(attack_kind) = ability_pool.primary { - character.action_state = Attack(attack_kind); - } - } - AbilityActionKind::Secondary => { - if let Some(attack_kind) = ability_pool.secondary { - character.action_state = Attack(attack_kind); - } - } - AbilityActionKind::Block => { - if let Some(block_kind) = ability_pool.block { - character.action_state = Block(block_kind); - } - } - AbilityActionKind::Dodge => { - if let Some(dodge_kind) = ability_pool.dodge { - character.action_state = Dodge(dodge_kind); - } - } - _ => {} + // AbilityActionKind::Primary => { + // if let Some(AttackKind(Some(attack_kind))) = ability_pool.primary { + // character.action_state = Attack(attack_kind::default()); + // } + // } + // AbilityActionKind::Secondary => { + // if let Some(attack_kind) = ability_pool.secondary { + // character.action_state = Attack(attack_kind::default()); + // } + // } + // AbilityActionKind::Block => { + // if let Some(block_kind) = ability_pool.block { + // character.action_state = Block(block_kind::default()); + // } + // } + // AbilityActionKind::Dodge => { + // if let Some(dodge_kind) = ability_pool.dodge { + // character.action_state = Dodge(dodge_kind::default()); + // } + // } + // _ => {} } } } diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 52b1f1e149..23c850b490 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -163,7 +163,7 @@ impl<'a> System<'a> for Sys { inputs.roll.set_state(true); } - if target_character.move_state == Glide(GlideState) + if target_character.move_state == Glide(Some(GlideState)) && target_pos.0.z > pos.0.z + 5.0 { inputs.glide.set_state(true); diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 58baca6e33..82b85f2eb3 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ states::*, Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, - OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitState, StateHandle, + OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitState, StateHandler, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, @@ -102,7 +102,7 @@ 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(entity) { - character.move_state = Sit(SitState); + character.move_state = Sit(Some(SitState)); return; } @@ -111,7 +111,7 @@ impl<'a> System<'a> for Sys { action_overrides.get(entity), character.action_state.overrides_move_state(), ) { - let state_update = character.action_state.handle(&EcsStateData { + let state_update = character.action_state.update(&EcsStateData { entity: &entity, uid, character, @@ -139,7 +139,7 @@ impl<'a> System<'a> for Sys { move_overrides.get(entity), character.move_state.overrides_action_state(), ) { - let state_update = character.move_state.handle(&EcsStateData { + let state_update = character.move_state.update(&EcsStateData { entity: &entity, uid, character, diff --git a/common/src/util/mod.rs b/common/src/util/mod.rs index 37ce1a120a..dc154db236 100644 --- a/common/src/util/mod.rs +++ b/common/src/util/mod.rs @@ -7,7 +7,7 @@ lazy_static::lazy_static! { use vek::{Mat3, Rgb, Rgba, Vec3}; -pub mod movement_utils; +pub mod state_utils; /// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// This is a fast approximation of powf. This should only be used when minor accuracy loss is acceptable. diff --git a/common/src/util/movement_utils.rs b/common/src/util/state_utils.rs similarity index 90% rename from common/src/util/movement_utils.rs rename to common/src/util/state_utils.rs index c9a503535e..02fd2de6f4 100644 --- a/common/src/util/movement_utils.rs +++ b/common/src/util/state_utils.rs @@ -11,11 +11,11 @@ use std::time::Duration; /// ... or Idle if nothing it possible?_ pub fn determine_primary_ability(stats: &Stats) -> ActionState { if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Attack(BasicAttack(BasicAttackState { + Attack(BasicAttack(Some(BasicAttackState { remaining_duration: data.attack_duration(), - })) + }))) } else { - Idle(IdleState) + Idle(Some(IdleState)) } } @@ -24,11 +24,11 @@ pub fn determine_primary_ability(stats: &Stats) -> ActionState { /// ... or Idle if nothing it possible?_ pub fn determine_secondary_ability(stats: &Stats) -> ActionState { if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Block(BasicBlock(BasicBlockState { + Block(BasicBlock(Some(BasicBlockState { active_duration: Duration::default(), - })) + }))) } else { - Idle(IdleState) + Idle(Some(IdleState)) } } @@ -36,18 +36,18 @@ pub fn determine_secondary_ability(stats: &Stats) -> ActionState { pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { // Check if in fluid to go to swimming or back to falling if physics.in_fluid { - Swim(SwimState) + Swim(Some(SwimState)) } else { - Fall(FallState) + Fall(Some(FallState)) } } /// __Returns a `MoveState` based on `move_dir` magnitude__ pub fn determine_stand_or_run(inputs: &ControllerInputs) -> MoveState { // Return to running or standing based on move inputs if inputs.move_dir.magnitude_squared() > 0.0 { - Run(RunState) + Run(Some(RunState)) } else { - Stand(StandState) + Stand(Some(StandState)) } } @@ -72,11 +72,11 @@ pub fn determine_move_from_grounded_state( /// __Returns an ActionState based on whether character has a weapon equipped.__ pub fn attempt_wield(stats: &Stats) -> ActionState { if let Some(Tool { .. }) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Wield(WieldState { + Wield(Some(WieldState { equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - }) + })) } else { - Idle(IdleState) + Idle(Some(IdleState)) } } From 8bf35a197bc4ed585b5477cf03cbd21747c920fc Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 11:26:22 -0800 Subject: [PATCH 015/387] Update weapon .ron --- assets/common/items/weapons/starter_axe.ron | 2 ++ assets/common/items/weapons/starter_bow.ron | 2 ++ assets/common/items/weapons/starter_dagger.ron | 2 ++ assets/common/items/weapons/starter_hammer.ron | 2 ++ assets/common/items/weapons/starter_staff.ron | 2 ++ common/src/comp/states/mod.rs | 1 + 6 files changed, 11 insertions(+) diff --git a/assets/common/items/weapons/starter_axe.ron b/assets/common/items/weapons/starter_axe.ron index 1a02485aa4..9145b4a09a 100644 --- a/assets/common/items/weapons/starter_axe.ron +++ b/assets/common/items/weapons/starter_axe.ron @@ -7,6 +7,8 @@ Item( equip_time_millis: 1000, attack_buildup_millis: 700, attack_recover_millis: 100, + range: 3, + base_damage: 10, ) ), ) diff --git a/assets/common/items/weapons/starter_bow.ron b/assets/common/items/weapons/starter_bow.ron index beaff0229b..724824581a 100644 --- a/assets/common/items/weapons/starter_bow.ron +++ b/assets/common/items/weapons/starter_bow.ron @@ -7,6 +7,8 @@ Item( equip_time_millis: 800, attack_buildup_millis: 0, attack_recover_millis: 800, + range: 3, + base_damage: 10, ) ), ) diff --git a/assets/common/items/weapons/starter_dagger.ron b/assets/common/items/weapons/starter_dagger.ron index 57357db674..5d2c20c32e 100644 --- a/assets/common/items/weapons/starter_dagger.ron +++ b/assets/common/items/weapons/starter_dagger.ron @@ -7,6 +7,8 @@ Item( equip_time_millis: 300, attack_buildup_millis: 100, attack_recover_millis: 400, + range: 3, + base_damage: 10, ) ), ) diff --git a/assets/common/items/weapons/starter_hammer.ron b/assets/common/items/weapons/starter_hammer.ron index df8a369669..be0b2505f8 100644 --- a/assets/common/items/weapons/starter_hammer.ron +++ b/assets/common/items/weapons/starter_hammer.ron @@ -7,6 +7,8 @@ Item( equip_time_millis: 1000, attack_buildup_millis: 700, attack_recover_millis: 100, + range: 3, + base_damage: 10, ) ), ) diff --git a/assets/common/items/weapons/starter_staff.ron b/assets/common/items/weapons/starter_staff.ron index abb161df9c..e275179ded 100644 --- a/assets/common/items/weapons/starter_staff.ron +++ b/assets/common/items/weapons/starter_staff.ron @@ -7,6 +7,8 @@ Item( equip_time_millis: 800, attack_buildup_millis: 400, attack_recover_millis: 300, + range: 3, + base_damage: 10, ) ), ) diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 4b3902673d..e53ec28313 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -151,6 +151,7 @@ impl MoveState { Swim(Some(state)) => state.handle(&ecs_data), Fall(Some(state)) => state.handle(&ecs_data), Sit(Some(state)) => state.handle(&ecs_data), + // // All states should be explicitly handled // Do not use default match: _ => {}, } From 4e5cf63452fcfcf45510f2f741edfde5c24eb8f7 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 14:55:27 -0800 Subject: [PATCH 016/387] Clean Up Systems --- common/src/sys/ability.rs | 4 ++-- common/src/sys/cleanup.rs | 12 ------------ common/src/sys/mod.rs | 14 ++------------ 3 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 common/src/sys/cleanup.rs diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs index 4aa798e1bd..25982ac854 100644 --- a/common/src/sys/ability.rs +++ b/common/src/sys/ability.rs @@ -39,7 +39,7 @@ impl<'a> System<'a> for Sys { ) .join() { - match ability_action.0 { + // match ability_action.0 { // AbilityActionKind::Primary => { // if let Some(AttackKind(Some(attack_kind))) = ability_pool.primary { // character.action_state = Attack(attack_kind::default()); @@ -61,7 +61,7 @@ impl<'a> System<'a> for Sys { // } // } // _ => {} - } + // } } } } diff --git a/common/src/sys/cleanup.rs b/common/src/sys/cleanup.rs deleted file mode 100644 index dd9f03867c..0000000000 --- a/common/src/sys/cleanup.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::comp::Controller; -use specs::{System, WriteStorage}; - -/// This system will allow NPCs to modify their controller -pub struct Sys; -impl<'a> System<'a> for Sys { - type SystemData = WriteStorage<'a, Controller>; - - fn run(&mut self, _controllers: Self::SystemData) { - // TODO: More stuff here - } -} diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index 64b39d750e..eeb7d72d12 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -1,8 +1,6 @@ mod ability; pub mod agent; pub mod character_state; -mod cleanup; -pub mod combat; pub mod controller; pub mod phys; mod projectile; @@ -18,22 +16,14 @@ const CHARACTER_STATE_SYS: &str = "character_state_sys"; const CONTROLLER_SYS: &str = "controller_sys"; const PHYS_SYS: &str = "phys_sys"; const PROJECTILE_SYS: &str = "projectile_sys"; -const COMBAT_SYS: &str = "combat_sys"; const STATS_SYS: &str = "stats_sys"; -const CLEANUP_SYS: &str = "cleanup_sys"; pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(agent::Sys, AGENT_SYS, &[]); dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS]); dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(ability::Sys, ABILITY_SYS, &[CHARACTER_STATE_SYS]); - dispatch_builder.add(combat::Sys, COMBAT_SYS, &[CONTROLLER_SYS]); - dispatch_builder.add(stats::Sys, STATS_SYS, &[COMBAT_SYS]); - dispatch_builder.add( - phys::Sys, - PHYS_SYS, - &[CONTROLLER_SYS, COMBAT_SYS, STATS_SYS], - ); + dispatch_builder.add(stats::Sys, STATS_SYS, &[]); + dispatch_builder.add(phys::Sys, PHYS_SYS, &[CONTROLLER_SYS, STATS_SYS]); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); - dispatch_builder.add(cleanup::Sys, CLEANUP_SYS, &[PHYS_SYS]); } From 542f06eef4fb19e864d896c0d4faa70308e0d126 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 15:17:22 -0800 Subject: [PATCH 017/387] Add new() to states --- common/src/comp/inventory/item.rs | 8 +- common/src/comp/states/basic_attack.rs | 16 +++- common/src/comp/states/basic_block.rs | 6 ++ common/src/comp/states/charge_attack.rs | 14 +++- common/src/comp/states/climb.rs | 4 + common/src/comp/states/fall.rs | 4 + common/src/comp/states/glide.rs | 4 + common/src/comp/states/idle.rs | 10 ++- common/src/comp/states/jump.rs | 4 + common/src/comp/states/mod.rs | 102 +++++++++++++++++++----- common/src/comp/states/roll.rs | 16 +++- common/src/comp/states/run.rs | 4 + common/src/comp/states/sit.rs | 4 + common/src/comp/states/stand.rs | 4 + common/src/comp/states/swim.rs | 4 + common/src/comp/states/wield.rs | 16 +++- 16 files changed, 191 insertions(+), 29 deletions(-) diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index 98547f2b8e..180cbf8b86 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -28,6 +28,12 @@ pub enum ToolKind { Debug(Debug), } +impl Default for ToolKind { + fn default() -> Self { + Self::Axe + } +} + impl ToolData { pub fn equip_time(&self) -> Duration { Duration::from_millis(self.equip_time_millis) @@ -83,7 +89,7 @@ pub enum Ingredient { Grass, } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct ToolData { pub kind: ToolKind, equip_time_millis: u64, diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index b8fbb8a09a..e090334823 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -1,6 +1,6 @@ use crate::comp::{ - ActionState::Attack, AttackKind::BasicAttack, EcsStateData, MoveState, StateHandler, - StateUpdate, ToolData, + ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, MoveState, + StateHandler, StateUpdate, ToolData, }; use crate::util::state_utils::*; use std::time::Duration; @@ -12,6 +12,18 @@ pub struct BasicAttackState { } impl StateHandler for BasicAttackState { + fn new(ecs_data: &EcsStateData) -> Self { + let tool_data = + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + data + } else { + &ToolData::default() + }; + Self { + remaining_duration: tool_data.attack_duration(), + } + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index 6d62a55ada..a18e10ffc5 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -11,6 +11,12 @@ pub struct BasicBlockState { } impl StateHandler for BasicBlockState { + fn new(ecs_data: &EcsStateData) -> Self { + Self { + active_duration: Duration::default(), + } + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index dd6854809d..c13c4853f8 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -1,6 +1,6 @@ use crate::comp::{ ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, - MoveState::Run, RunState, StateHandler, StateUpdate, + ItemKind::Tool, MoveState::Run, RunState, StateHandler, StateUpdate, ToolData, }; use crate::event::ServerEvent; use crate::util::state_utils::*; @@ -16,6 +16,18 @@ pub struct ChargeAttackState { } impl StateHandler for ChargeAttackState { + fn new(ecs_data: &EcsStateData) -> Self { + let tool_data = + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + data + } else { + &ToolData::default() + }; + Self { + remaining_duration: tool_data.attack_duration(), + } + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index e315e7c5e2..4901084947 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -11,6 +11,10 @@ use vek::Lerp; pub struct ClimbState; impl StateHandler for ClimbState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index 09619fae0e..252b208153 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -8,6 +8,10 @@ use vek::{Vec2, Vec3}; pub struct FallState; impl StateHandler for FallState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index 768adbc0b5..77ea626849 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -9,6 +9,10 @@ use vek::{Vec2, Vec3}; pub struct GlideState; impl StateHandler for GlideState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs index 5f41308f34..6acb80357d 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/comp/states/idle.rs @@ -8,6 +8,10 @@ use std::time::Duration; pub struct IdleState; impl StateHandler for IdleState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, @@ -22,10 +26,10 @@ impl StateHandler for IdleState { || (ecs_data.inputs.toggle_wield.is_just_pressed() && update.character.action_state.is_equip_finished()) { - if let Some(Tool { .. }) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { update.character.action_state = Wield(Some(WieldState { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), - })) + equip_delay: data.equip_time(), + })); } // else unarmed stuff? diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index 5581c4d796..f2aea7e393 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -5,6 +5,10 @@ use crate::event::LocalEvent; pub struct JumpState; impl StateHandler for JumpState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index e53ec28313..4a0cac5477 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -54,7 +54,6 @@ use super::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, MoveState, MoveState::*, StateUpdate, }; -use std::time::Duration; /// #### A trait for implementing state `handle()`ing logic. /// _Mimics the typical OOP style state machine pattern where states implement their own behavior, @@ -74,25 +73,54 @@ use std::time::Duration; /// how the update flow occurs and is in charge of updating the ECS components. pub trait StateHandler: Default { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; + fn new(ecs_data: &EcsStateData) -> Self; } -// Public interface that passes EcsStateData to `StateHandle`s `handle()` fn +// fn's relating to individual `ActionState`s +// or passing data from system to handlers impl ActionState { - /// Passes handle to variant or subvariant handlers + /// Passes data to variant or subvariant handlers + /// States contain `Option`s, and will be + /// `None` if state data has not been initialized. So we have to + /// check and intialize new state data if so. pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { Attack(kind) => match kind { - BasicAttack(Some(state)) => state.handle(&ecs_data), - Charge(Some(state)) => state.handle(&ecs_data), + BasicAttack(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| BasicAttackState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Charge(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| ChargeAttackState::new(ecs_data)) + // Call handler + .handle(ecs_data), }, Block(kind) => match kind { - BasicBlock(Some(state)) => state.handle(&ecs_data), + BasicBlock(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| BasicBlockState::new(ecs_data)) + // Call handler + .handle(ecs_data), }, Dodge(kind) => match kind { - Roll(Some(state)) => state.handle(&ecs_data), + Roll(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| RollState::new(ecs_data)) + // Call handler + .handle(ecs_data), }, - Wield(Some(state)) => state.handle(&ecs_data), - Idle(Some(state)) => state.handle(&ecs_data), + Wield(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| WieldState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Idle(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| IdleState::new(ecs_data)) + // Call handler + .handle(ecs_data), // // All states should be explicitly handled // Do not use default match: _ => {}, @@ -121,9 +149,13 @@ impl ActionState { } } -// Other fn's that relate to individual `MoveState`s +// fn's that relate to individual `MoveState`s +// or passing data from system to handlers impl MoveState { - /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing + /// Passes data to variant or subvariant handlers + /// States contain `Option`s, and will be + /// `None` if state data has not been initialized. So we have to + /// check and intialize new state data if so. pub fn overrides_action_state(&self) -> bool { match self { Stand(_) => false, @@ -143,14 +175,46 @@ impl MoveState { /// Passes handle to variant handlers pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { - Stand(Some(state)) => state.handle(&ecs_data), - Run(Some(state)) => state.handle(&ecs_data), - Jump(Some(state)) => state.handle(&ecs_data), - Climb(Some(state)) => state.handle(&ecs_data), - Glide(Some(state)) => state.handle(&ecs_data), - Swim(Some(state)) => state.handle(&ecs_data), - Fall(Some(state)) => state.handle(&ecs_data), - Sit(Some(state)) => state.handle(&ecs_data), + Stand(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| StandState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Run(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| RunState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Jump(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| JumpState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Climb(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| ClimbState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Glide(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| GlideState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Swim(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| SwimState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Fall(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| FallState::new(ecs_data)) + // Call handler + .handle(ecs_data), + Sit(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| SitState::new(ecs_data)) + // Call handler + .handle(ecs_data), // // All states should be explicitly handled // Do not use default match: _ => {}, diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index d7c62fce95..1d4f01fbcc 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,5 +1,7 @@ use super::ROLL_SPEED; -use crate::comp::{ActionState::*, DodgeKind::*, EcsStateData, StateHandler, StateUpdate}; +use crate::comp::{ + ActionState::*, DodgeKind::*, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, +}; use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; @@ -11,6 +13,18 @@ pub struct RollState { } impl StateHandler for RollState { + fn new(ecs_data: &EcsStateData) -> Self { + let tool_data = + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + data + } else { + &ToolData::default() + }; + Self { + remaining_duration: tool_data.attack_duration(), + } + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index 755e8b8e56..94bdf7dc85 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -10,6 +10,10 @@ use vek::vec::{Vec2, Vec3}; pub struct RunState; impl StateHandler for RunState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 58763c9e0d..99f567bdec 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -8,6 +8,10 @@ use crate::util::state_utils::*; pub struct SitState; impl StateHandler for SitState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index d1c5a95574..7c81839f2c 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -8,6 +8,10 @@ use crate::util::state_utils::*; pub struct StandState; impl StateHandler for StandState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index 87f350cb58..ccb3022e5d 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -7,6 +7,10 @@ use vek::{Vec2, Vec3}; pub struct SwimState; impl StateHandler for SwimState { + fn new(ecs_data: &EcsStateData) -> Self { + Self {} + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index ddf91961f4..d2217057e4 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,6 +1,6 @@ use crate::comp::{ - AbilityAction, AbilityActionKind::*, ActionState::*, EcsStateData, IdleState, StateHandler, - StateUpdate, + AbilityAction, AbilityActionKind::*, ActionState::*, EcsStateData, IdleState, ItemKind::Tool, + StateHandler, StateUpdate, ToolData, }; use crate::util::state_utils::*; use std::time::Duration; @@ -13,6 +13,18 @@ pub struct WieldState { } impl StateHandler for WieldState { + fn new(ecs_data: &EcsStateData) -> Self { + let tool_data = + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + data + } else { + &ToolData::default() + }; + Self { + equip_delay: tool_data.equip_time(), + } + } + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, From 5bba0a96fc4e487b469b03a4c6c0c8571357f21d Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 15:21:37 -0800 Subject: [PATCH 018/387] Fix refs --- common/src/comp/inventory/item.rs | 10 +++++----- common/src/comp/states/basic_attack.rs | 4 ++-- common/src/comp/states/charge_attack.rs | 4 ++-- common/src/comp/states/roll.rs | 4 ++-- common/src/comp/states/wield.rs | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index 180cbf8b86..b8a222753b 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -55,7 +55,7 @@ pub enum Debug { Possess, } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Armor { // TODO: Don't make armor be a body part. Wearing enemy's head is funny but also a creepy thing to do. Helmet, @@ -72,7 +72,7 @@ pub enum Armor { } //TODO: Do we even need this? -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Consumable { Apple, Cheese, @@ -83,13 +83,13 @@ pub enum Consumable { PotionMinor, } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Ingredient { Flower, Grass, } -#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct ToolData { pub kind: ToolKind, equip_time_millis: u64, @@ -99,7 +99,7 @@ pub struct ToolData { base_damage: u64, } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum ItemKind { Tool(ToolData), Armor { kind: Armor, power: u32 }, diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index e090334823..5b95693c16 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -14,10 +14,10 @@ pub struct BasicAttackState { impl StateHandler for BasicAttackState { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { data } else { - &ToolData::default() + ToolData::default() }; Self { remaining_duration: tool_data.attack_duration(), diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index c13c4853f8..9e977ab755 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -18,10 +18,10 @@ pub struct ChargeAttackState { impl StateHandler for ChargeAttackState { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { data } else { - &ToolData::default() + ToolData::default() }; Self { remaining_duration: tool_data.attack_duration(), diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 1d4f01fbcc..560fbd7e36 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -15,10 +15,10 @@ pub struct RollState { impl StateHandler for RollState { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { data } else { - &ToolData::default() + ToolData::default() }; Self { remaining_duration: tool_data.attack_duration(), diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index d2217057e4..d2462193a9 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -15,10 +15,10 @@ pub struct WieldState { impl StateHandler for WieldState { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { data } else { - &ToolData::default() + ToolData::default() }; Self { equip_delay: tool_data.equip_time(), From 4e18ffe6c283768af88785040e9ecd29b6dd1a70 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 15:26:04 -0800 Subject: [PATCH 019/387] RUIN the comments --- common/src/comp/states/mod.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 4a0cac5477..8e6ff91049 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -92,34 +92,24 @@ impl ActionState { // Call handler .handle(ecs_data), Charge(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| ChargeAttackState::new(ecs_data)) - // Call handler .handle(ecs_data), }, Block(kind) => match kind { BasicBlock(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| BasicBlockState::new(ecs_data)) - // Call handler .handle(ecs_data), }, Dodge(kind) => match kind { Roll(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| RollState::new(ecs_data)) - // Call handler .handle(ecs_data), }, Wield(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| WieldState::new(ecs_data)) - // Call handler .handle(ecs_data), Idle(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| IdleState::new(ecs_data)) - // Call handler .handle(ecs_data), // // All states should be explicitly handled @@ -181,39 +171,25 @@ impl MoveState { // Call handler .handle(ecs_data), Run(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| RunState::new(ecs_data)) - // Call handler .handle(ecs_data), Jump(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| JumpState::new(ecs_data)) - // Call handler .handle(ecs_data), Climb(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| ClimbState::new(ecs_data)) - // Call handler .handle(ecs_data), Glide(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| GlideState::new(ecs_data)) - // Call handler .handle(ecs_data), Swim(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| SwimState::new(ecs_data)) - // Call handler .handle(ecs_data), Fall(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| FallState::new(ecs_data)) - // Call handler .handle(ecs_data), Sit(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| SitState::new(ecs_data)) - // Call handler .handle(ecs_data), // // All states should be explicitly handled From dc33f6ad6a0eb8cacb3a8999fcea904d935be5e5 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 5 Jan 2020 15:28:20 -0800 Subject: [PATCH 020/387] Ruin them again (the comments) --- common/src/comp/states/mod.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 8e6ff91049..90f0c56834 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -111,7 +111,6 @@ impl ActionState { Idle(opt_state) => opt_state .unwrap_or_else(|| IdleState::new(ecs_data)) .handle(ecs_data), - // // All states should be explicitly handled // Do not use default match: _ => {}, } @@ -132,7 +131,6 @@ impl ActionState { }, Wield(_) => false, Idle(_) => false, - // // All states should be explicitly handled // Do not use default match: _ => {}, } @@ -156,7 +154,6 @@ impl MoveState { Swim(_) => false, Fall(_) => false, Sit(_) => true, - // // All states should be explicitly handled // Do not use default match: _ => {}, } @@ -191,7 +188,6 @@ impl MoveState { Sit(opt_state) => opt_state .unwrap_or_else(|| SitState::new(ecs_data)) .handle(ecs_data), - // // All states should be explicitly handled // Do not use default match: _ => {}, } From 8648641362e55d4d047ed87f4b58b57bc62898ee Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Tue, 7 Jan 2020 07:49:08 -0800 Subject: [PATCH 021/387] Grooming --- common/src/comp/ability.rs | 2 +- common/src/comp/states/basic_attack.rs | 4 +- common/src/comp/states/basic_block.rs | 6 +- common/src/comp/states/charge_attack.rs | 6 +- common/src/comp/states/climb.rs | 57 +++--- common/src/comp/states/fall.rs | 12 +- common/src/comp/states/glide.rs | 53 +++--- common/src/comp/states/idle.rs | 14 +- common/src/comp/states/jump.rs | 6 +- common/src/comp/states/mod.rs | 131 +++++++++---- common/src/comp/states/roll.rs | 3 +- common/src/comp/states/run.rs | 19 +- common/src/comp/states/sit.rs | 17 +- common/src/comp/states/stand.rs | 15 +- common/src/comp/states/swim.rs | 14 +- common/src/comp/states/wield.rs | 4 +- common/src/msg/ecs_packet.rs | 4 + common/src/state.rs | 2 + common/src/sys/ability.rs | 4 +- common/src/sys/character_state.rs | 26 +-- common/src/sys/movement.rs | 236 ------------------------ common/src/util/state_utils.rs | 19 +- voxygen/src/audio/sfx/event_mapper.rs | 48 ++--- voxygen/src/hud/skillbar.rs | 6 +- 24 files changed, 252 insertions(+), 456 deletions(-) delete mode 100644 common/src/sys/movement.rs diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 53c1a0ce4e..baf6fe24af 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -30,5 +30,5 @@ pub struct AbilityPool { } impl Component for AbilityPool { - type Storage = HashMapStorage; + type Storage = FlaggedStorage>; } diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 5b95693c16..725e8acc93 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -1,6 +1,6 @@ use crate::comp::{ - ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, MoveState, - StateHandler, StateUpdate, ToolData, + ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, StateHandler, + StateUpdate, ToolData, }; use crate::util::state_utils::*; use std::time::Duration; diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index a18e10ffc5..053c837015 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -1,9 +1,11 @@ -use super::{BLOCK_ACCEL, BLOCK_SPEED}; use crate::comp::{EcsStateData, StateHandler, StateUpdate}; use crate::util::state_utils::*; use std::time::Duration; use vek::Vec2; +const BLOCK_ACCEL: f32 = 30.0; +const BLOCK_SPEED: f32 = 75.0; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct BasicBlockState { /// How long the blocking state has been active @@ -11,7 +13,7 @@ pub struct BasicBlockState { } impl StateHandler for BasicBlockState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self { active_duration: Duration::default(), } diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index 9e977ab755..ea4420f3f9 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -1,13 +1,13 @@ use crate::comp::{ ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, - ItemKind::Tool, MoveState::Run, RunState, StateHandler, StateUpdate, ToolData, + ItemKind::Tool, MoveState::Run, StateHandler, StateUpdate, ToolData, }; use crate::event::ServerEvent; use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; -use super::CHARGE_SPEED; +const CHARGE_SPEED: f32 = 20.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ChargeAttackState { @@ -37,7 +37,7 @@ impl StateHandler for ChargeAttackState { }; // Prevent move state handling, handled here - update.character.move_state = Run(Some(RunState)); + update.character.move_state = Run(None); // Move player update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index 4901084947..9b1df0a52a 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -1,17 +1,16 @@ -use super::{ - ActionState::*, EcsStateData, FallState, IdleState, JumpState, MoveState::*, StandState, - StateHandler, StateUpdate, -}; -use super::{CLIMB_SPEED, HUMANOID_CLIMB_ACCEL, HUMANOID_SPEED}; +use super::{ActionState::*, EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::sys::phys::GRAVITY; use vek::vec::{Vec2, Vec3}; use vek::Lerp; +const HUMANOID_CLIMB_ACCEL: f32 = 5.0; +const CLIMB_SPEED: f32 = 5.0; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct ClimbState; impl StateHandler for ClimbState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -23,12 +22,33 @@ impl StateHandler for ClimbState { character: *ecs_data.character, }; - update.character.action_state = Idle(Some(IdleState)); + update.character.action_state = Idle(None); + + // If no wall is in front of character ... + if let None = ecs_data.physics.on_wall { + if ecs_data.inputs.jump.is_pressed() { + // They've climbed atop something, give them a boost + update.character.move_state = Jump(None); + + return update; + } else { + // Just fall off + update.character.move_state = Fall(None); + + return update; + } + } + + // Remove climb state on ground, otherwise character will get stuck + if ecs_data.physics.on_ground { + update.character.move_state = Stand(None); + return update; + } // Move player update.vel.0 += Vec2::broadcast(ecs_data.dt.0) * ecs_data.inputs.move_dir - * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { + * if update.vel.0.magnitude_squared() < CLIMB_SPEED.powf(2.0) { HUMANOID_CLIMB_ACCEL } else { 0.0 @@ -78,27 +98,6 @@ impl StateHandler for ClimbState { } } - // If no wall is infront of character ... - if let None = ecs_data.physics.on_wall { - if ecs_data.inputs.jump.is_pressed() { - // They've climbed atop something, give them a boost - update.character.move_state = Jump(Some(JumpState)); - - return update; - } else { - // Just fall off - update.character.move_state = Fall(Some(FallState)); - - return update; - } - } - - // Remove climb state on ground, otherwise character will get stuck - if ecs_data.physics.on_ground { - update.character.move_state = Stand(Some(StandState)); - return update; - } - return update; } } diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index 252b208153..55c72c3e97 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -1,14 +1,16 @@ -use super::{HUMANOID_AIR_ACCEL, HUMANOID_AIR_SPEED}; -use crate::comp::{ClimbState, EcsStateData, GlideState, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::util::state_utils::*; use vek::{Vec2, Vec3}; +const HUMANOID_AIR_ACCEL: f32 = 10.0; +const HUMANOID_AIR_SPEED: f32 = 100.0; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct FallState; impl StateHandler for FallState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -48,13 +50,13 @@ impl StateHandler for FallState { // Check to start climbing if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(Some(ClimbState)); + update.character.move_state = Climb(None); return update; } // Check gliding if ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Glide(Some(GlideState)); + update.character.move_state = Glide(None); return update; } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index 77ea626849..4060b6c4f4 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -1,15 +1,16 @@ -use super::{GLIDE_ACCEL, GLIDE_ANTIGRAV, GLIDE_SPEED}; -use crate::comp::{ - ActionState::*, ClimbState, EcsStateData, FallState, IdleState, MoveState::*, StandState, - StateHandler, StateUpdate, -}; +use crate::comp::{ActionState::*, EcsStateData, MoveState::*, StateHandler, StateUpdate}; use vek::{Vec2, Vec3}; +// Gravity is 9.81 * 4, so this makes gravity equal to .15 +const GLIDE_ANTIGRAV: f32 = crate::sys::phys::GRAVITY * 0.96; +const GLIDE_ACCEL: f32 = 15.0; +const GLIDE_SPEED: f32 = 45.0; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct GlideState; impl StateHandler for GlideState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -22,8 +23,26 @@ impl StateHandler for GlideState { }; // Defaults for this state - update.character.action_state = Idle(Some(IdleState)); - update.character.move_state = Glide(Some(GlideState)); + update.character.action_state = Idle(None); + update.character.move_state = Glide(None); + + // If glide button isn't held, start falling + if !ecs_data.inputs.glide.is_pressed() { + update.character.move_state = Fall(None); + return update; + } + + // If there is a wall in front of character go to climb + if let Some(_wall_dir) = ecs_data.physics.on_wall { + update.character.move_state = Climb(None); + return update; + } + + // If on ground go to stand + if ecs_data.physics.on_ground { + update.character.move_state = Stand(None); + return update; + } // Move player according to movement direction vector update.vel.0 += Vec2::broadcast(ecs_data.dt.0) @@ -56,24 +75,6 @@ impl StateHandler for GlideState { .max(0.2); } - // If glide button isn't held, start falling - if !ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Fall(Some(FallState)); - return update; - } - - // If there is a wall in front of character go to climb - if let Some(_wall_dir) = ecs_data.physics.on_wall { - update.character.move_state = Climb(Some(ClimbState)); - return update; - } - - // If on ground go to stand - if ecs_data.physics.on_ground { - update.character.move_state = Stand(Some(StandState)); - return update; - } - // Otherwise keep gliding return update; } diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs index 6acb80357d..2cfa12ad91 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/comp/states/idle.rs @@ -1,14 +1,10 @@ -use super::TEMP_EQUIP_DELAY; -use crate::comp::{ - ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, WieldState, -}; -use std::time::Duration; +use crate::comp::{ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct IdleState; impl StateHandler for IdleState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -26,10 +22,8 @@ impl StateHandler for IdleState { || (ecs_data.inputs.toggle_wield.is_just_pressed() && update.character.action_state.is_equip_finished()) { - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { - update.character.action_state = Wield(Some(WieldState { - equip_delay: data.equip_time(), - })); + if let Some(Tool(_)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + update.character.action_state = Wield(None); } // else unarmed stuff? diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index f2aea7e393..16bf65b534 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -1,11 +1,11 @@ -use super::{EcsStateData, FallState, MoveState::*, StateHandler, StateUpdate}; +use super::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::event::LocalEvent; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct JumpState; impl StateHandler for JumpState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -23,7 +23,7 @@ impl StateHandler for JumpState { .emit(LocalEvent::Jump(*ecs_data.entity)); // Immediately go to falling state after jump impulse - update.character.move_state = Fall(Some(FallState)); + update.character.move_state = Fall(None); return update; } } diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 90f0c56834..805c8e31dd 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -30,47 +30,106 @@ pub use stand::*; pub use swim::*; pub use wield::*; -// TODO: Attach these to racial components and/or ecs resources -pub const HUMANOID_ACCEL: f32 = 50.0; -pub const HUMANOID_SPEED: f32 = 120.0; -pub const HUMANOID_AIR_ACCEL: f32 = 10.0; -pub const HUMANOID_AIR_SPEED: f32 = 100.0; -pub const HUMANOID_WATER_ACCEL: f32 = 70.0; -pub const HUMANOID_WATER_SPEED: f32 = 120.0; -pub const HUMANOID_CLIMB_ACCEL: f32 = 5.0; -pub const ROLL_SPEED: f32 = 17.0; -pub const CHARGE_SPEED: f32 = 20.0; -pub const GLIDE_ACCEL: f32 = 15.0; -pub const GLIDE_SPEED: f32 = 45.0; -pub const BLOCK_ACCEL: f32 = 30.0; -pub const BLOCK_SPEED: f32 = 75.0; -pub const TEMP_EQUIP_DELAY: u64 = 100; -// Gravity is 9.81 * 4, so this makes gravity equal to .15 -pub const GLIDE_ANTIGRAV: f32 = crate::sys::phys::GRAVITY * 0.96; -pub const CLIMB_SPEED: f32 = 5.0; -pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; - use super::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, MoveState, MoveState::*, StateUpdate, }; -/// #### A trait for implementing state `handle()`ing logic. -/// _Mimics the typical OOP style state machine pattern where states implement their own behavior, -/// exit conditions, and return new states to the state machine upon exit. -/// This is still performant and consistent with ECS data-behavior-separation constraint -/// since trait fn's are syntactic sugar for static fn's that accept their implementor's -/// object type as its first parameter. This allows for several benefits over implementing -/// each state's behavior within the `CharacterState` update `System` itself:_ -/// -/// 1. Less cognitive overhead: State's handling logic is next to the its data, and component (inside the state's .rs file). -/// 2. Separation of concerns (between states): all logic within a state's `handle()` is relevant only to that state. -/// States can be added/editted without concerns of affecting other state's logic. -/// 3. Clearly defined API and pattern: All states accept the same `EcsStateData` struct, which can be added to as necessary, -/// without the need for updating every state's implementation. All states return the same `StateUpdate` component. -/// `CharacterState` update `System` passes `EcsStateData` to `ActionState`/`MoveState` `handle()` which matches the character's -/// current state to its `handle()` fn, hiding the implementation details, since the System is only concerned with -/// how the update flow occurs and is in charge of updating the ECS components. +/// ## A type for implementing State Handling Behavior. +/// +/// Called by state machines' update functions to allow current states to handle updating +/// their parent machine's current state. +/// +/// Structures must implement a `handle()` fn to handle update behavior, and a `new()` for +/// instantiating new instances of a state. `handle()` function recieves `EcsStateData`, a struct +/// of readonly ECS Component data, and returns a `StateUpdate` tuple, with new components that will +/// overwrite an entitie's old components. +/// +/// ## Example Implementation: +/// ``` +/// use crate::comp::{ +/// ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandler, +/// StateUpdate, +/// }; +/// use crate::util::state_utils::* +/// #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +/// pub struct RunState { +/// active_duration: Duration, +/// } +/// +/// impl StateHandler for RunState { +/// fn new(ecs_data: &EcsStateData) -> Self { +/// Self { +/// active_duration: Duration::default(), +/// } +/// } +/// +/// fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { +/// let mut update = StateUpdate { +/// character: *ecs_data.character, +/// pos: *ecs_data.pos, +/// vel: *ecs_data.vel, +/// ori: *ecs_data.ori, +/// }; +/// +/// // Move player according to move_dir +/// update.vel.0 += Vec2::broadcast(ecs_data.dt.0) +/// * ecs_data.inputs.move_dir +/// * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { +/// HUMANOID_ACCEL +/// } else { +/// 0.0 +/// }; +/// +/// // Set direction based on move direction when on the ground +/// let ori_dir = if update.character.action_state.is_attacking() +/// || update.character.action_state.is_blocking() +/// { +/// Vec2::from(ecs_data.inputs.look_dir).normalized() +/// } else { +/// Vec2::from(update.vel.0) +/// }; +/// +/// if ori_dir.magnitude_squared() > 0.0001 +/// && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() +/// > 0.001 +/// { +/// update.ori.0 = +/// vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * ecs_data.dt.0); +/// } +/// +/// // Try to sit +/// if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { +/// update.character.move_state = Sit(Some(SitState)); +/// return update; +/// } +/// +/// // Try to climb +/// if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { +/// update.character.move_state = Climb(Some(ClimbState)); +/// return update; +/// } +/// +/// // Try to jump +/// if can_jump(ecs_data.physics, ecs_data.inputs) { +/// update.character.move_state = Jump(Some(JumpState)); +/// return update; +/// } +/// +/// // Try to glide +/// if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { +/// update.character.move_state = Glide(Some(GlideState)); +/// return update; +/// } +/// +/// // Update based on groundedness +/// update.character.move_state = +/// determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); +/// +/// return update; +/// } +/// } +/// ``` pub trait StateHandler: Default { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; fn new(ecs_data: &EcsStateData) -> Self; diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 560fbd7e36..63e1e29c78 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,4 +1,3 @@ -use super::ROLL_SPEED; use crate::comp::{ ActionState::*, DodgeKind::*, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, }; @@ -6,6 +5,8 @@ use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; +const ROLL_SPEED: f32 = 17.0; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct RollState { /// How long the state has until exitting diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index 94bdf7dc85..598eb5dbb7 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -1,16 +1,15 @@ -use super::{HUMANOID_ACCEL, HUMANOID_SPEED}; -use crate::comp::{ - ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandler, - StateUpdate, -}; +use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::util::state_utils::*; use vek::vec::{Vec2, Vec3}; +const HUMANOID_ACCEL: f32 = 50.0; +const HUMANOID_SPEED: f32 = 120.0; + #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct RunState; impl StateHandler for RunState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -50,25 +49,25 @@ impl StateHandler for RunState { // Try to sit if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Sit(Some(SitState)); + update.character.move_state = Sit(None); return update; } // Try to climb if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(Some(ClimbState)); + update.character.move_state = Climb(None); return update; } // Try to jump if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = Jump(Some(JumpState)); + update.character.move_state = Jump(None); return update; } // Try to glide if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Glide(Some(GlideState)); + update.character.move_state = Glide(None); return update; } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 99f567bdec..2e47c8d4f5 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -1,14 +1,11 @@ -use crate::comp::{ - ActionState::*, EcsStateData, IdleState, JumpState, MoveState::*, RunState, StandState, - StateHandler, StateUpdate, -}; +use crate::comp::{ActionState::*, EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct SitState; impl StateHandler for SitState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -21,8 +18,8 @@ impl StateHandler for SitState { }; // Prevent action state handling - update.character.action_state = Idle(Some(IdleState)); - update.character.move_state = Sit(Some(SitState)); + update.character.action_state = Idle(None); + update.character.move_state = Sit(None); // Try to Fall // ... maybe the ground disappears, @@ -34,19 +31,19 @@ impl StateHandler for SitState { } // Try to jump if ecs_data.inputs.jump.is_pressed() { - update.character.move_state = Jump(Some(JumpState)); + update.character.move_state = Jump(None); return update; } // Try to Run if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = Run(Some(RunState)); + update.character.move_state = Run(None); return update; } // Try to Stand if ecs_data.inputs.sit.is_just_pressed() { - update.character.move_state = Stand(Some(StandState)); + update.character.move_state = Stand(None); return update; } diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index 7c81839f2c..b3372c8721 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -1,14 +1,11 @@ -use crate::comp::{ - ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandler, - StateUpdate, -}; +use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct StandState; impl StateHandler for StandState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -22,25 +19,25 @@ impl StateHandler for StandState { // Try to sit if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Sit(Some(SitState)); + update.character.move_state = Sit(None); return update; } // Try to climb if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(Some(ClimbState)); + update.character.move_state = Climb(None); return update; } // Try to jump if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = Jump(Some(JumpState)); + update.character.move_state = Jump(None); return update; } // Check gliding if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Glide(Some(GlideState)); + update.character.move_state = Glide(None); return update; } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index ccb3022e5d..29d1512bfe 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -1,13 +1,15 @@ -use super::{HUMANOID_WATER_ACCEL, HUMANOID_WATER_SPEED}; -use crate::comp::{EcsStateData, MoveState::*, RunState, StandState, StateHandler, StateUpdate}; +use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::sys::phys::GRAVITY; use vek::{Vec2, Vec3}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct SwimState; +const HUMANOID_WATER_ACCEL: f32 = 70.0; +const HUMANOID_WATER_SPEED: f32 = 120.0; + impl StateHandler for SwimState { - fn new(ecs_data: &EcsStateData) -> Self { + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } @@ -55,16 +57,16 @@ impl StateHandler for SwimState { // Not on ground if !ecs_data.physics.on_ground { - update.character.move_state = Swim(Some(SwimState)); + update.character.move_state = Swim(None); return update; } // On ground else { // Return to running or standing based on move inputs update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(Some(RunState)) + Run(None) } else { - Stand(Some(StandState)) + Stand(None) }; return update; diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index d2462193a9..06f55afb1c 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,8 +1,6 @@ use crate::comp::{ - AbilityAction, AbilityActionKind::*, ActionState::*, EcsStateData, IdleState, ItemKind::Tool, - StateHandler, StateUpdate, ToolData, + ActionState::*, EcsStateData, IdleState, ItemKind::Tool, StateHandler, StateUpdate, ToolData, }; -use crate::util::state_utils::*; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 7f4a4f792b..6ee78280c3 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -36,6 +36,8 @@ sphynx::sum_type! { OverrideAction(comp::OverrideAction), OverrideMove(comp::OverrideMove), OverrideState(comp::OverrideState), + AbilityAction(comp::AbilityAction), + AbilityPool(comp::AbilityPool), } } // Automatically derive From for EcsCompPhantom @@ -62,6 +64,8 @@ sphynx::sum_type! { OverrideAction(PhantomData), OverrideMove(PhantomData), OverrideState(PhantomData), + AbilityAction(PhantomData), + AbilityPool(PhantomData), } } impl sphynx::CompPacket for EcsCompPacket { diff --git a/common/src/state.rs b/common/src/state.rs index b3aa25af8e..bf4b7e9814 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -123,6 +123,8 @@ impl State { // TODO: Split up registering into server and client (e.g. move EventBus to the server) fn setup_sphynx_world(ecs: &mut sphynx::World) { // Register server -> all clients synced components. + ecs.register_synced::(); + ecs.register_synced::(); ecs.register_synced::(); ecs.register_synced::(); ecs.register_synced::(); diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs index 25982ac854..99b173c89d 100644 --- a/common/src/sys/ability.rs +++ b/common/src/sys/ability.rs @@ -25,13 +25,13 @@ impl<'a> System<'a> for Sys { &mut self, ( entities, - updater, + _updater, mut character_state_storage, ability_action_storage, ability_pool_storage, ): Self::SystemData, ) { - for (entity, mut character, ability_action, ability_pool) in ( + for (_entity, mut _character, _ability_action, _ability_pool) in ( &entities, &mut character_state_storage, &ability_action_storage, diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 82b85f2eb3..54ce8de3dd 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,8 +1,7 @@ use crate::{ comp::{ - states::*, Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, - OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, SitState, StateHandler, - Stats, Vel, + Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, + OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -11,18 +10,11 @@ use crate::{ use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; use sphynx::{Uid, UidAllocator}; -/// # Character State System -/// #### Updates tuples of ( `CharacterState`, `Pos`, `Vel`, and `Ori` ) in parallel. -/// _Each update for a single character involves first passing an `EcsStateData` struct of ECS components -/// to the character's `MoveState`, then the character's `ActionState`. State update logic is -/// is encapsulated in state's `handle()` fn, impl'd by the `StateHandle` trait. `handle()` fn's -/// return a `StateUpdate` tuple containing new ( `CharacterState`, `Pos`, `Vel`, and `Ori` ) components. -/// Since `handle()` accepts readonly components, component updates are contained within this system and ECS -/// behavior constraints are satisfied._ +/// ## Character State System +/// #### Calls updates to `CharacterState`s. Acts on tuples of ( `CharacterState`, `Pos`, `Vel`, and `Ori` ). /// -/// _This mimics the typical OOP style state machine pattern, but remains performant -/// under ECS since trait fn's are syntactic sugar for static fn's that accept their implementor's -/// object type as its first parameter. See `StateHandle` for more information._ +/// _System forms `EcsStateData` tuples and passes those to `ActionState` `update()` fn, +/// then does the same for `MoveState` `update`_ pub struct Sys; impl<'a> System<'a> for Sys { @@ -102,14 +94,14 @@ 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(entity) { - character.move_state = Sit(Some(SitState)); + character.move_state = Sit(None); return; } // Determine new action if character can act if let (None, false) = ( action_overrides.get(entity), - character.action_state.overrides_move_state(), + character.move_state.overrides_action_state(), ) { let state_update = character.action_state.update(&EcsStateData { entity: &entity, @@ -137,7 +129,7 @@ impl<'a> System<'a> for Sys { // Determine new move state if character can move if let (None, false) = ( move_overrides.get(entity), - character.move_state.overrides_action_state(), + character.action_state.overrides_move_state(), ) { let state_update = character.move_state.update(&EcsStateData { entity: &entity, diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs deleted file mode 100644 index 9b8da17f1b..0000000000 --- a/common/src/sys/movement.rs +++ /dev/null @@ -1,236 +0,0 @@ -use super::phys::GRAVITY; -use crate::{ - comp::{ - CharacterState, Controller, Mounting, MoveState::*, Ori, PhysicsState, Pos, RunState, - StandState, Stats, Vel, - }, - event::{EventBus, ServerEvent}, - state::DeltaTime, - terrain::TerrainGrid, -}; -use specs::prelude::*; -use sphynx::Uid; -use std::time::Duration; -use vek::*; - -pub const ROLL_DURATION: Duration = Duration::from_millis(600); - -const HUMANOID_ACCEL: f32 = 50.0; -const HUMANOID_SPEED: f32 = 120.0; -const HUMANOID_AIR_ACCEL: f32 = 10.0; -const HUMANOID_AIR_SPEED: f32 = 100.0; -const HUMANOID_WATER_ACCEL: f32 = 70.0; -const HUMANOID_WATER_SPEED: f32 = 120.0; -const HUMANOID_CLIMB_ACCEL: f32 = 5.0; -const ROLL_SPEED: f32 = 17.0; -const CHARGE_SPEED: f32 = 20.0; -const GLIDE_ACCEL: f32 = 15.0; -const GLIDE_SPEED: f32 = 45.0; -const BLOCK_ACCEL: f32 = 30.0; -const BLOCK_SPEED: f32 = 75.0; -// Gravity is 9.81 * 4, so this makes gravity equal to .15 -const GLIDE_ANTIGRAV: f32 = GRAVITY * 0.96; -const CLIMB_SPEED: f32 = 5.0; - -pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; - -/// # Movement System -/// #### Applies forces, calculates new positions and velocities,7 -/// #### based on Controller(Inputs) and CharacterState. -/// ---- -/// -/// **Writes:** -/// Pos, Vel, Ori -/// -/// **Reads:** -/// Uid, Stats, Controller, PhysicsState, CharacterState, Mounting -pub struct Sys; -impl<'a> System<'a> for Sys { - type SystemData = ( - Entities<'a>, - ReadExpect<'a, TerrainGrid>, - Read<'a, EventBus>, - Read<'a, DeltaTime>, - WriteStorage<'a, Pos>, - WriteStorage<'a, Vel>, - WriteStorage<'a, Ori>, - ReadStorage<'a, Uid>, - ReadStorage<'a, Stats>, - ReadStorage<'a, Controller>, - ReadStorage<'a, PhysicsState>, - ReadStorage<'a, CharacterState>, - ReadStorage<'a, Mounting>, - ); - - fn run( - &mut self, - ( - entities, - _terrain, - _server_bus, - dt, - mut positions, - mut velocities, - mut orientations, - uids, - stats, - controllers, - physics_states, - character_states, - mountings, - ): Self::SystemData, - ) { - // Apply movement inputs - for ( - _entity, - mut _pos, - mut vel, - mut ori, - _uid, - stats, - controller, - physics, - character, - mount, - ) in ( - &entities, - &mut positions, - &mut velocities, - &mut orientations, - &uids, - &stats, - &controllers, - &physics_states, - &character_states, - mountings.maybe(), - ) - .join() - { - // if character.movement == Run(RunState) || character.movement == Stand(StandState) { - // continue; - // } - - // if stats.is_dead { - // continue; - // } - - // if mount.is_some() { - // continue; - // } - - // let inputs = &controller.inputs; - - // if character.action.is_roll() { - // vel.0 = Vec3::new(0.0, 0.0, vel.0.z) - // + (vel.0 * Vec3::new(1.0, 1.0, 0.0) - // + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) - // .try_normalized() - // .unwrap_or_default() - // * ROLL_SPEED; - // } else if character.action.is_charge() { - // vel.0 = Vec3::new(0.0, 0.0, vel.0.z) - // + (vel.0 * Vec3::new(1.0, 1.0, 0.0) - // + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) - // .try_normalized() - // .unwrap_or_default() - // * CHARGE_SPEED; - // } else if character.action.is_block() { - // vel.0 += Vec2::broadcast(dt.0) - // * inputs.move_dir - // * match physics.on_ground { - // true if vel.0.magnitude_squared() < BLOCK_SPEED.powf(2.0) => BLOCK_ACCEL, - // _ => 0.0, - // } - // } else { - // // Move player according to move_dir - // vel.0 += Vec2::broadcast(dt.0) - // * inputs.move_dir - // * match (physics.on_ground, &character.movement) { - // (true, Run(_)) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { - // HUMANOID_ACCEL - // } - // (false, Climb) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => { - // HUMANOID_CLIMB_ACCEL - // } - // (false, Glide) if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) => { - // GLIDE_ACCEL - // } - // (false, Fall) | (false, Jump) - // if vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) => - // { - // HUMANOID_AIR_ACCEL - // } - // (false, Swim) - // if vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) => - // { - // HUMANOID_WATER_ACCEL - // } - // _ => 0.0, - // }; - // } - - // // Set direction based on move direction when on the ground - // let ori_dir = if - // //character.action.is_wield() || - // character.action.is_attack() || character.action.is_block() { - // Vec2::from(inputs.look_dir).normalized() - // } else if let (Climb, Some(wall_dir)) = (character.movement, physics.on_wall) { - // if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { - // Vec2::from(wall_dir).normalized() - // } else { - // Vec2::from(vel.0) - // } - // } else { - // Vec2::from(vel.0) - // }; - - // if ori_dir.magnitude_squared() > 0.0001 - // && (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() - // > 0.001 - // { - // ori.0 = vek::ops::Slerp::slerp( - // ori.0, - // ori_dir.into(), - // if physics.on_ground { 9.0 } else { 2.0 } * dt.0, - // ); - // } - - // // Glide - // if character.movement == Glide - // && Vec2::::from(vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) - // && vel.0.z < 0.0 - // { - // let lift = GLIDE_ANTIGRAV + vel.0.z.abs().powf(2.0) * 0.15; - // vel.0.z += dt.0 - // * lift - // * (Vec2::::from(vel.0).magnitude() * 0.075) - // .min(1.0) - // .max(0.2); - // } - - // // Climb - // if let (true, Some(_wall_dir)) = ( - // (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) - // && vel.0.z <= CLIMB_SPEED, - // physics.on_wall, - // ) { - // if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() { - // vel.0 -= dt.0 * vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); - // } else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() { - // vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); - // } else { - // vel.0.z = vel.0.z + dt.0 * GRAVITY * 1.5; - // vel.0 = Lerp::lerp( - // vel.0, - // Vec3::zero(), - // 30.0 * dt.0 / (1.0 - vel.0.z.min(0.0) * 5.0), - // ); - // } - // } - - // if character.movement == Swim && inputs.jump.is_pressed() { - // vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); - // } - } - } -} diff --git a/common/src/util/state_utils.rs b/common/src/util/state_utils.rs index 02fd2de6f4..e303e102e5 100644 --- a/common/src/util/state_utils.rs +++ b/common/src/util/state_utils.rs @@ -1,8 +1,7 @@ -use crate::comp::TEMP_EQUIP_DELAY; use crate::comp::{ ActionState, ActionState::*, AttackKind::*, BasicAttackState, BasicBlockState, BlockKind::*, Body, ControllerInputs, FallState, IdleState, ItemKind::Tool, MoveState, MoveState::*, - PhysicsState, RunState, StandState, Stats, SwimState, ToolData, WieldState, + PhysicsState, RunState, StandState, Stats, SwimState, WieldState, }; use std::time::Duration; @@ -23,7 +22,7 @@ pub fn determine_primary_ability(stats: &Stats) -> ActionState { /// and returns the corresponding `ActionState` /// ... or Idle if nothing it possible?_ pub fn determine_secondary_ability(stats: &Stats) -> ActionState { - if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(_data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { Block(BasicBlock(Some(BasicBlockState { active_duration: Duration::default(), }))) @@ -32,7 +31,7 @@ pub fn determine_secondary_ability(stats: &Stats) -> ActionState { } } -/// __Returns a `MoveState` based on `in_fluid` condition__ +/// _Returns a `MoveState` based on `in_fluid` condition_ pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { // Check if in fluid to go to swimming or back to falling if physics.in_fluid { @@ -41,7 +40,7 @@ pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { Fall(Some(FallState)) } } -/// __Returns a `MoveState` based on `move_dir` magnitude__ +/// _Returns a `MoveState` based on `move_dir` magnitude_ pub fn determine_stand_or_run(inputs: &ControllerInputs) -> MoveState { // Return to running or standing based on move inputs if inputs.move_dir.magnitude_squared() > 0.0 { @@ -51,7 +50,7 @@ pub fn determine_stand_or_run(inputs: &ControllerInputs) -> MoveState { } } -/// __Returns a `MoveState` based on `on_ground` state.__ +/// _Returns a `MoveState` based on `on_ground` state._ /// /// _`FallState`, or `SwimState` if not `on_ground`, /// `StandState` or `RunState` if is `on_ground`_ @@ -69,11 +68,11 @@ pub fn determine_move_from_grounded_state( } } -/// __Returns an ActionState based on whether character has a weapon equipped.__ +/// _Returns an ActionState based on whether character has a weapon equipped._ pub fn attempt_wield(stats: &Stats) -> ActionState { - if let Some(Tool { .. }) = stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { Wield(Some(WieldState { - equip_delay: Duration::from_millis(TEMP_EQUIP_DELAY), + equip_delay: data.equip_time(), })) } else { Idle(Some(IdleState)) @@ -82,7 +81,7 @@ pub fn attempt_wield(stats: &Stats) -> ActionState { pub fn can_climb(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { if let (true, Some(_wall_dir)) = ( - inputs.climb.is_pressed() | inputs.climb_down.is_pressed() && body.is_humanoid(), + (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) && body.is_humanoid(), physics.on_wall, ) { true diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 11285bb637..46c32fd7d5 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -277,10 +277,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Stand(StandState), - action_state: ActionState::Idle(IdleState), - action_disabled_this_tick: false, - move_disabled_this_tick: false, + move_state: MoveState::Stand(None), + action_state: ActionState::Idle(None), }, SfxEvent::Idle, &stats, @@ -295,10 +293,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Run(RunState), - action_state: ActionState::Idle(IdleState), - action_disabled_this_tick: false, - move_disabled_this_tick: false, + move_state: MoveState::Run(None), + action_state: ActionState::Idle(None), }, SfxEvent::Idle, &stats, @@ -313,10 +309,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - action_state: ActionState::Dodge(Roll(RollState::default())), - move_state: MoveState::Run(RunState), - action_disabled_this_tick: false, - move_disabled_this_tick: true, + action_state: ActionState::Dodge(Roll(None)), + move_state: MoveState::Run(None), }, SfxEvent::Run, &stats, @@ -331,10 +325,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Fall(FallState), - action_state: ActionState::Idle(IdleState), - action_disabled_this_tick: false, - move_disabled_this_tick: false, + move_state: MoveState::Fall((None)), + action_state: ActionState::Idle((None)), }, SfxEvent::Idle, &stats, @@ -349,10 +341,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Glide(GlideState), - action_state: ActionState::Idle(IdleState), - action_disabled_this_tick: true, - move_disabled_this_tick: false, + move_state: MoveState::Glide(None), + action_state: ActionState::Idle(None), }, SfxEvent::Jump, &stats, @@ -367,10 +357,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Glide(GlideState), - action_state: ActionState::Idle(IdleState), - action_disabled_this_tick: true, - move_disabled_this_tick: false, + move_state: MoveState::Glide(None), + action_state: ActionState::Idle(None), }, SfxEvent::Glide, &stats, @@ -385,10 +373,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Fall(FallState), - action_state: ActionState::Idle(IdleState), - move_disabled_this_tick: false, - action_disabled_this_tick: false, + move_state: MoveState::Fall(None), + action_state: ActionState::Idle(None), }, SfxEvent::Glide, &stats, @@ -408,10 +394,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Stand(StandState), - action_state: ActionState::Attack(BasicAttack(BasicAttackState::default())), - move_disabled_this_tick: false, - action_disabled_this_tick: false, + move_state: MoveState::Stand(None), + action_state: ActionState::Attack(BasicAttack(None)), }, SfxEvent::Idle, &stats, diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 8e6d3855c6..d9d4fff5eb 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -1,9 +1,9 @@ use super::{ - img_ids::Imgs, BarNumbers, Fonts, ShortcutNumbers, XpBar, CRITICAL_HP_COLOR, - /*FOCUS_COLOR, RAGE_COLOR,*/ HP_COLOR, LOW_HP_COLOR, MANA_COLOR, TEXT_COLOR, XP_COLOR, + img_ids::Imgs, BarNumbers, Fonts, ShortcutNumbers, XpBar, CRITICAL_HP_COLOR, HP_COLOR, + LOW_HP_COLOR, MANA_COLOR, TEXT_COLOR, XP_COLOR, }; use crate::GlobalState; -use common::comp::{item::Debug, item::ToolData, item::ToolKind, Equipment, ItemKind, Stats}; +use common::comp::{item::Debug, item::ToolData, item::ToolKind, ItemKind, Stats}; use conrod_core::{ color, widget::{self, Button, Image, Rectangle, Text}, From 8cdf06e3e2a10c65001c07e5b00073d246fd0f9b Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Wed, 8 Jan 2020 05:17:36 -0800 Subject: [PATCH 022/387] Swim pulsing --- common/src/comp/controller.rs | 5 ++++ common/src/comp/states/mod.rs | 51 ++++++---------------------------- common/src/comp/states/swim.rs | 9 +++++- 3 files changed, 21 insertions(+), 44 deletions(-) diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index 1bfc01dcad..f3155a3fd3 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -69,6 +69,11 @@ impl Input { (self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION) } + // Whether input has been pressed for longer than `threshold` + pub fn is_long_press(&self, threshold: Duration) -> bool { + (self.is_pressed() && self.duration >= threshold) + } + /// Handles logic of updating state of Input pub fn set_state(&mut self, new_state: bool) { // Only update if state switches diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 805c8e31dd..2d29505272 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -47,11 +47,8 @@ use super::{ /// /// ## Example Implementation: /// ``` -/// use crate::comp::{ -/// ClimbState, EcsStateData, GlideState, JumpState, MoveState::*, SitState, StateHandler, -/// StateUpdate, -/// }; -/// use crate::util::state_utils::* +/// use crate::util::state_utils::*; +/// /// #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] /// pub struct RunState { /// active_duration: Duration, @@ -72,7 +69,7 @@ use super::{ /// ori: *ecs_data.ori, /// }; /// -/// // Move player according to move_dir +/// // Update player's Vel /// update.vel.0 += Vec2::broadcast(ecs_data.dt.0) /// * ecs_data.inputs.move_dir /// * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { @@ -81,50 +78,18 @@ use super::{ /// 0.0 /// }; /// -/// // Set direction based on move direction when on the ground -/// let ori_dir = if update.character.action_state.is_attacking() -/// || update.character.action_state.is_blocking() -/// { -/// Vec2::from(ecs_data.inputs.look_dir).normalized() -/// } else { -/// Vec2::from(update.vel.0) -/// }; -/// -/// if ori_dir.magnitude_squared() > 0.0001 -/// && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() -/// > 0.001 -/// { -/// update.ori.0 = -/// vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * ecs_data.dt.0); -/// } -/// -/// // Try to sit -/// if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { -/// update.character.move_state = Sit(Some(SitState)); -/// return update; -/// } -/// -/// // Try to climb -/// if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { -/// update.character.move_state = Climb(Some(ClimbState)); -/// return update; -/// } +/// // -- snip -- +/// // Other updates; checks for gliding, climbing, etc. /// /// // Try to jump -/// if can_jump(ecs_data.physics, ecs_data.inputs) { -/// update.character.move_state = Jump(Some(JumpState)); -/// return update; -/// } -/// -/// // Try to glide -/// if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { -/// update.character.move_state = Glide(Some(GlideState)); +/// if state_utils::can_jump(ecs_data.physics, ecs_data.inputs) { +/// update.character.move_state = Jump(None); /// return update; /// } /// /// // Update based on groundedness /// update.character.move_state = -/// determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); +/// state_utils::determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); /// /// return update; /// } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index 29d1512bfe..1d739a7aec 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -1,5 +1,6 @@ use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::sys::phys::GRAVITY; +use std::time::Duration; use vek::{Vec2, Vec3}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -50,7 +51,13 @@ impl StateHandler for SwimState { ); } - if ecs_data.inputs.jump.is_pressed() && !ecs_data.inputs.jump.is_held_down() { + // Force players to press jump in a slow rhythmic fashion to swim up + if ecs_data.inputs.jump.is_pressed() + && !ecs_data + .inputs + .jump + .is_long_press(Duration::from_millis(600)) + { update.vel.0.z = (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); } From 5527d83a0e3dc8c58dfab1633ec6f49738159be9 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Wed, 8 Jan 2020 08:56:36 -0800 Subject: [PATCH 023/387] Update mod imports --- common/src/comp/character_state.rs | 36 ++++++------- common/src/comp/states/basic_attack.rs | 6 +-- common/src/comp/states/basic_block.rs | 4 +- common/src/comp/states/charge_attack.rs | 6 +-- common/src/comp/states/climb.rs | 4 +- common/src/comp/states/fall.rs | 4 +- common/src/comp/states/glide.rs | 4 +- common/src/comp/states/idle.rs | 4 +- common/src/comp/states/jump.rs | 4 +- common/src/comp/states/mod.rs | 72 ++++++++++--------------- common/src/comp/states/roll.rs | 6 +-- common/src/comp/states/run.rs | 4 +- common/src/comp/states/sit.rs | 4 +- common/src/comp/states/stand.rs | 4 +- common/src/comp/states/swim.rs | 4 +- common/src/comp/states/wield.rs | 10 ++-- common/src/sys/agent.rs | 5 +- 17 files changed, 82 insertions(+), 99 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 0a2d340a44..a12e737ead 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -38,20 +38,20 @@ pub struct StateUpdate { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum MoveState { - Stand(Option), - Run(Option), - Sit(Option), - Jump(Option), - Fall(Option), - Glide(Option), - Swim(Option), - Climb(Option), + Stand(Option), + Run(Option), + Sit(Option), + Jump(Option), + Fall(Option), + Glide(Option), + Swim(Option), + Climb(Option), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum ActionState { - Idle(Option), - Wield(Option), + Idle(Option), + Wield(Option), Attack(AttackKind), Block(BlockKind), Dodge(DodgeKind), @@ -60,24 +60,24 @@ pub enum ActionState { #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum AttackKind { - BasicAttack(Option), - Charge(Option), + BasicAttack(Option), + Charge(Option), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum BlockKind { - BasicBlock(Option), + BasicBlock(Option), } #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum DodgeKind { - Roll(Option), + Roll(Option), } impl ActionState { pub fn is_equip_finished(&self) -> bool { match self { - Wield(Some(WieldState { equip_delay })) => *equip_delay == Duration::default(), + Wield(Some(wield::State { equip_delay })) => *equip_delay == Duration::default(), _ => true, } } @@ -85,7 +85,7 @@ impl ActionState { /// Returns the current `equip_delay` if in `WieldState`, otherwise `Duration::default()` pub fn get_delay(&self) -> Duration { match self { - Wield(Some(WieldState { equip_delay })) => *equip_delay, + Wield(Some(wield::State { equip_delay })) => *equip_delay, _ => Duration::default(), } } @@ -164,8 +164,8 @@ impl CharacterState { impl Default for CharacterState { fn default() -> Self { Self { - move_state: MoveState::Fall(Some(FallState)), - action_state: ActionState::Idle(Some(IdleState)), + move_state: MoveState::Fall(None), + action_state: ActionState::Idle(None), } } } diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 725e8acc93..95b45ae968 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -6,12 +6,12 @@ use crate::util::state_utils::*; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct BasicAttackState { +pub struct State { /// How long the state has until exitting pub remaining_duration: Duration, } -impl StateHandler for BasicAttackState { +impl StateHandler for State { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { @@ -40,7 +40,7 @@ impl StateHandler for BasicAttackState { } // Otherwise, tick down remaining_duration, and keep rolling - update.character.action_state = Attack(BasicAttack(Some(BasicAttackState { + update.character.action_state = Attack(BasicAttack(Some(State { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index 053c837015..cc59682bd9 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -7,12 +7,12 @@ const BLOCK_ACCEL: f32 = 30.0; const BLOCK_SPEED: f32 = 75.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct BasicBlockState { +pub struct State { /// How long the blocking state has been active pub active_duration: Duration, } -impl StateHandler for BasicBlockState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self { active_duration: Duration::default(), diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index ea4420f3f9..040ae971d7 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -10,12 +10,12 @@ use vek::Vec3; const CHARGE_SPEED: f32 = 20.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct ChargeAttackState { +pub struct State { /// How long the state has until exitting pub remaining_duration: Duration, } -impl StateHandler for ChargeAttackState { +impl StateHandler for State { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { @@ -76,7 +76,7 @@ impl StateHandler for ChargeAttackState { } // Tick remaining-duration and keep charging - update.character.action_state = Attack(Charge(Some(ChargeAttackState { + update.character.action_state = Attack(Charge(Some(State { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index 9b1df0a52a..d5f6801433 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -7,9 +7,9 @@ const HUMANOID_CLIMB_ACCEL: f32 = 5.0; const CLIMB_SPEED: f32 = 5.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct ClimbState; +pub struct State; -impl StateHandler for ClimbState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index 55c72c3e97..8882b948c0 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -7,9 +7,9 @@ const HUMANOID_AIR_ACCEL: f32 = 10.0; const HUMANOID_AIR_SPEED: f32 = 100.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct FallState; +pub struct State; -impl StateHandler for FallState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index 4060b6c4f4..47c2ecb7b5 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -7,9 +7,9 @@ const GLIDE_ACCEL: f32 = 15.0; const GLIDE_SPEED: f32 = 45.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct GlideState; +pub struct State; -impl StateHandler for GlideState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs index 2cfa12ad91..3498d912bf 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/comp/states/idle.rs @@ -1,9 +1,9 @@ use crate::comp::{ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct IdleState; +pub struct State; -impl StateHandler for IdleState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index 16bf65b534..3cb2a5aacd 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -2,9 +2,9 @@ use super::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::event::LocalEvent; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct JumpState; +pub struct State; -impl StateHandler for JumpState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index 2d29505272..b064026210 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -1,34 +1,18 @@ // Module declarations -mod basic_attack; -mod basic_block; -mod charge_attack; -mod climb; -mod fall; -mod glide; -mod idle; -mod jump; -mod roll; -mod run; -mod sit; -mod stand; -mod swim; -mod wield; - -// Reexports -pub use basic_attack::*; -pub use basic_block::*; -pub use charge_attack::*; -pub use climb::*; -pub use fall::*; -pub use glide::*; -pub use idle::*; -pub use jump::*; -pub use roll::*; -pub use run::*; -pub use sit::*; -pub use stand::*; -pub use swim::*; -pub use wield::*; +pub mod basic_attack; +pub mod basic_block; +pub mod charge_attack; +pub mod climb; +pub mod fall; +pub mod glide; +pub mod idle; +pub mod jump; +pub mod roll; +pub mod run; +pub mod sit; +pub mod stand; +pub mod swim; +pub mod wield; use super::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, @@ -112,28 +96,28 @@ impl ActionState { Attack(kind) => match kind { BasicAttack(opt_state) => opt_state // If data hasn't been initialized, initialize a new one - .unwrap_or_else(|| BasicAttackState::new(ecs_data)) + .unwrap_or_else(|| basic_attack::State::new(ecs_data)) // Call handler .handle(ecs_data), Charge(opt_state) => opt_state - .unwrap_or_else(|| ChargeAttackState::new(ecs_data)) + .unwrap_or_else(|| charge_attack::State::new(ecs_data)) .handle(ecs_data), }, Block(kind) => match kind { BasicBlock(opt_state) => opt_state - .unwrap_or_else(|| BasicBlockState::new(ecs_data)) + .unwrap_or_else(|| basic_block::State::new(ecs_data)) .handle(ecs_data), }, Dodge(kind) => match kind { Roll(opt_state) => opt_state - .unwrap_or_else(|| RollState::new(ecs_data)) + .unwrap_or_else(|| roll::State::new(ecs_data)) .handle(ecs_data), }, Wield(opt_state) => opt_state - .unwrap_or_else(|| WieldState::new(ecs_data)) + .unwrap_or_else(|| wield::State::new(ecs_data)) .handle(ecs_data), Idle(opt_state) => opt_state - .unwrap_or_else(|| IdleState::new(ecs_data)) + .unwrap_or_else(|| idle::State::new(ecs_data)) .handle(ecs_data), // All states should be explicitly handled // Do not use default match: _ => {}, @@ -188,29 +172,29 @@ impl MoveState { match self { Stand(opt_state) => opt_state // If data hasn't been initialized, initialize a new one - .unwrap_or_else(|| StandState::new(ecs_data)) + .unwrap_or_else(|| stand::State::new(ecs_data)) // Call handler .handle(ecs_data), Run(opt_state) => opt_state - .unwrap_or_else(|| RunState::new(ecs_data)) + .unwrap_or_else(|| run::State::new(ecs_data)) .handle(ecs_data), Jump(opt_state) => opt_state - .unwrap_or_else(|| JumpState::new(ecs_data)) + .unwrap_or_else(|| jump::State::new(ecs_data)) .handle(ecs_data), Climb(opt_state) => opt_state - .unwrap_or_else(|| ClimbState::new(ecs_data)) + .unwrap_or_else(|| climb::State::new(ecs_data)) .handle(ecs_data), Glide(opt_state) => opt_state - .unwrap_or_else(|| GlideState::new(ecs_data)) + .unwrap_or_else(|| glide::State::new(ecs_data)) .handle(ecs_data), Swim(opt_state) => opt_state - .unwrap_or_else(|| SwimState::new(ecs_data)) + .unwrap_or_else(|| swim::State::new(ecs_data)) .handle(ecs_data), Fall(opt_state) => opt_state - .unwrap_or_else(|| FallState::new(ecs_data)) + .unwrap_or_else(|| fall::State::new(ecs_data)) .handle(ecs_data), Sit(opt_state) => opt_state - .unwrap_or_else(|| SitState::new(ecs_data)) + .unwrap_or_else(|| sit::State::new(ecs_data)) .handle(ecs_data), // All states should be explicitly handled // Do not use default match: _ => {}, diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 63e1e29c78..3947a0e565 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -8,12 +8,12 @@ use vek::Vec3; const ROLL_SPEED: f32 = 17.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct RollState { +pub struct State { /// How long the state has until exitting remaining_duration: Duration, } -impl StateHandler for RollState { +impl StateHandler for State { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { @@ -55,7 +55,7 @@ impl StateHandler for RollState { } // Otherwise, tick down remaining_duration - update.character.action_state = Dodge(Roll(Some(RollState { + update.character.action_state = Dodge(Roll(Some(State { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index 598eb5dbb7..a2ca009956 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -6,9 +6,9 @@ const HUMANOID_ACCEL: f32 = 50.0; const HUMANOID_SPEED: f32 = 120.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct RunState; +pub struct State; -impl StateHandler for RunState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 2e47c8d4f5..032cc4a27d 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -2,9 +2,9 @@ use crate::comp::{ActionState::*, EcsStateData, MoveState::*, StateHandler, Stat use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct SitState; +pub struct State; -impl StateHandler for SitState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index b3372c8721..9536cc7a61 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -2,9 +2,9 @@ use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct StandState; +pub struct State; -impl StateHandler for StandState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index 1d739a7aec..8ccecc2b70 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -4,12 +4,12 @@ use std::time::Duration; use vek::{Vec2, Vec3}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct SwimState; +pub struct State; const HUMANOID_WATER_ACCEL: f32 = 70.0; const HUMANOID_WATER_SPEED: f32 = 120.0; -impl StateHandler for SwimState { +impl StateHandler for State { fn new(_ecs_data: &EcsStateData) -> Self { Self {} } diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index 06f55afb1c..bcf9e0d582 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,16 +1,16 @@ use crate::comp::{ - ActionState::*, EcsStateData, IdleState, ItemKind::Tool, StateHandler, StateUpdate, ToolData, + ActionState::*, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, }; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct WieldState { +pub struct State { /// How long before a new action can be performed /// after equipping pub equip_delay: Duration, } -impl StateHandler for WieldState { +impl StateHandler for State { fn new(ecs_data: &EcsStateData) -> Self { let tool_data = if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { @@ -37,7 +37,7 @@ impl StateHandler for WieldState { if ecs_data.inputs.toggle_wield.is_just_pressed() && ecs_data.character.action_state.is_equip_finished() { - update.character.action_state = Idle(Some(IdleState)); + update.character.action_state = Idle(None); return update; } @@ -54,7 +54,7 @@ impl StateHandler for WieldState { } else { // Equip delay hasn't expired yet // Update wield delay - update.character.action_state = Wield(Some(WieldState { + update.character.action_state = Wield(Some(State { equip_delay: self .equip_delay .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 23c850b490..c1118c0ce4 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,5 @@ use crate::comp::{ - Agent, CharacterState, Controller, ControllerInputs, GlideState, MountState, MoveState::Glide, - Pos, Stats, + Agent, CharacterState, Controller, ControllerInputs, MountState, MoveState::Glide, Pos, Stats, }; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; @@ -163,7 +162,7 @@ impl<'a> System<'a> for Sys { inputs.roll.set_state(true); } - if target_character.move_state == Glide(Some(GlideState)) + if target_character.move_state == Glide(None) && target_pos.0.z > pos.0.z + 5.0 { inputs.glide.set_state(true); From de36e75264a8aa590b44093b6a8b1f1fd2cbce77 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Wed, 8 Jan 2020 11:31:42 -0800 Subject: [PATCH 024/387] Fix imports, update matches --- client/src/lib.rs | 2 +- common/src/comp/character_state.rs | 40 +++++++++---------------- common/src/comp/states/climb.rs | 10 +++---- common/src/comp/states/fall.rs | 19 ++++++------ common/src/comp/states/glide.rs | 12 ++++---- common/src/comp/states/idle.rs | 4 +-- common/src/comp/states/jump.rs | 4 +-- common/src/comp/states/roll.rs | 3 +- common/src/comp/states/run.rs | 23 +++++++-------- common/src/comp/states/sit.rs | 12 ++++---- common/src/comp/states/stand.rs | 10 +++---- common/src/comp/states/swim.rs | 21 +++++++------- common/src/comp/states/wield.rs | 8 ++--- common/src/util/state_utils.rs | 42 ++++++++++----------------- server/src/sys/entity_sync.rs | 2 +- voxygen/src/audio/sfx/event_mapper.rs | 9 +++--- voxygen/src/scene/figure/cache.rs | 9 +++--- voxygen/src/scene/figure/mod.rs | 23 ++++++++------- voxygen/src/session.rs | 11 +++---- 19 files changed, 120 insertions(+), 144 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index ce8fb7182d..f7b3e34c5c 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -360,7 +360,7 @@ impl Client { { if last_character_states .get(entity) - .map(|&l| !client_character_state.is_same_state(&l.0)) + .map(|&l| !client_character_state.equals(&l.0)) .unwrap_or(true) { let _ = last_character_states diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index a12e737ead..1c0091decd 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -110,20 +110,18 @@ impl ActionState { _ => false, } } - - pub fn is_wielding(&self) -> bool { - if let Wield(_) = self { - true - } else { - false - } + /// Compares `action_state`s for shallow equality (does not check internal struct equality) + pub fn equals(&self, other: &Self) -> bool { + // Check if state is the same without looking at the inner data + std::mem::discriminant(&self) == std::mem::discriminant(&other) } - pub fn is_idling(&self) -> bool { - if let Idle(_) = self { - true - } else { - false - } +} + +impl MoveState { + /// Compares `move_state`s for shallow equality (does not check internal struct equality) + pub fn equals(&self, other: &Self) -> bool { + // Check if state is the same without looking at the inner data + std::mem::discriminant(&self) == std::mem::discriminant(&other) } } @@ -142,22 +140,10 @@ pub struct CharacterState { } impl CharacterState { - /// Compares `move_state`s for shallow equality (does not check internal struct equality) - pub fn is_same_move_state(&self, other: &Self) -> bool { - // Check if state is the same without looking at the inner data - std::mem::discriminant(&self.move_state) == std::mem::discriminant(&other.move_state) - } - - /// Compares `action_state`s for shallow equality (does not check internal struct equality) - pub fn is_same_action_state(&self, other: &Self) -> bool { - // Check if state is the same without looking at the inner data - std::mem::discriminant(&self.action_state) == std::mem::discriminant(&other.action_state) - } - /// Compares both `move_state`s and `action_state`a for shallow equality /// (does not check internal struct equality) - pub fn is_same_state(&self, other: &Self) -> bool { - self.is_same_move_state(other) && self.is_same_action_state(other) + pub fn equals(&self, other: &Self) -> bool { + self.move_state.equals(&other.move_state) && self.action_state.equals(&other.action_state) } } diff --git a/common/src/comp/states/climb.rs b/common/src/comp/states/climb.rs index d5f6801433..09450d4160 100644 --- a/common/src/comp/states/climb.rs +++ b/common/src/comp/states/climb.rs @@ -1,4 +1,4 @@ -use super::{ActionState::*, EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use super::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::sys::phys::GRAVITY; use vek::vec::{Vec2, Vec3}; use vek::Lerp; @@ -22,18 +22,18 @@ impl StateHandler for State { character: *ecs_data.character, }; - update.character.action_state = Idle(None); + update.character.action_state = ActionState::Idle(None); // If no wall is in front of character ... if let None = ecs_data.physics.on_wall { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost - update.character.move_state = Jump(None); + update.character.move_state = MoveState::Jump(None); return update; } else { // Just fall off - update.character.move_state = Fall(None); + update.character.move_state = MoveState::Fall(None); return update; } @@ -41,7 +41,7 @@ impl StateHandler for State { // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { - update.character.move_state = Stand(None); + update.character.move_state = MoveState::Stand(None); return update; } diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index 8882b948c0..e94215c3ff 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -1,4 +1,4 @@ -use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::util::state_utils::*; use vek::{Vec2, Vec3}; @@ -32,13 +32,12 @@ impl StateHandler for State { }; // Set orientation vector based on direction of movement when on the ground - let ori_dir = if update.character.action_state.is_attacking() - || update.character.action_state.is_blocking() - { - Vec2::from(ecs_data.inputs.look_dir).normalized() - } else { - Vec2::from(update.vel.0) - }; + let ori_dir = + if let ActionState::Attack(_) | ActionState::Block(_) = update.character.action_state { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; if ori_dir.magnitude_squared() > 0.0001 && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() @@ -50,13 +49,13 @@ impl StateHandler for State { // Check to start climbing if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(None); + update.character.move_state = MoveState::Climb(None); return update; } // Check gliding if ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Glide(None); + update.character.move_state = MoveState::Glide(None); return update; } diff --git a/common/src/comp/states/glide.rs b/common/src/comp/states/glide.rs index 47c2ecb7b5..f436fddca4 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/comp/states/glide.rs @@ -1,4 +1,4 @@ -use crate::comp::{ActionState::*, EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; use vek::{Vec2, Vec3}; // Gravity is 9.81 * 4, so this makes gravity equal to .15 @@ -23,24 +23,24 @@ impl StateHandler for State { }; // Defaults for this state - update.character.action_state = Idle(None); - update.character.move_state = Glide(None); + update.character.action_state = ActionState::Idle(None); + update.character.move_state = MoveState::Glide(None); // If glide button isn't held, start falling if !ecs_data.inputs.glide.is_pressed() { - update.character.move_state = Fall(None); + update.character.move_state = MoveState::Fall(None); return update; } // If there is a wall in front of character go to climb if let Some(_wall_dir) = ecs_data.physics.on_wall { - update.character.move_state = Climb(None); + update.character.move_state = MoveState::Climb(None); return update; } // If on ground go to stand if ecs_data.physics.on_ground { - update.character.move_state = Stand(None); + update.character.move_state = MoveState::Stand(None); return update; } diff --git a/common/src/comp/states/idle.rs b/common/src/comp/states/idle.rs index 3498d912bf..46af0a47fb 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/comp/states/idle.rs @@ -1,4 +1,4 @@ -use crate::comp::{ActionState::Wield, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; @@ -23,7 +23,7 @@ impl StateHandler for State { && update.character.action_state.is_equip_finished()) { if let Some(Tool(_)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { - update.character.action_state = Wield(None); + update.character.action_state = ActionState::Wield(None); } // else unarmed stuff? diff --git a/common/src/comp/states/jump.rs b/common/src/comp/states/jump.rs index 3cb2a5aacd..f8c784e546 100644 --- a/common/src/comp/states/jump.rs +++ b/common/src/comp/states/jump.rs @@ -1,4 +1,4 @@ -use super::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use super::{EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::event::LocalEvent; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -23,7 +23,7 @@ impl StateHandler for State { .emit(LocalEvent::Jump(*ecs_data.entity)); // Immediately go to falling state after jump impulse - update.character.move_state = Fall(None); + update.character.move_state = MoveState::Fall(None); return update; } } diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 3947a0e565..0a509c1fe8 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,5 +1,6 @@ use crate::comp::{ - ActionState::*, DodgeKind::*, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, + ActionState::Dodge, DodgeKind::Roll, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, + ToolData, }; use crate::util::state_utils::*; use std::time::Duration; diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index a2ca009956..15d8109769 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -1,4 +1,4 @@ -use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::util::state_utils::*; use vek::vec::{Vec2, Vec3}; @@ -31,13 +31,12 @@ impl StateHandler for State { }; // Set direction based on move direction when on the ground - let ori_dir = if update.character.action_state.is_attacking() - || update.character.action_state.is_blocking() - { - Vec2::from(ecs_data.inputs.look_dir).normalized() - } else { - Vec2::from(update.vel.0) - }; + let ori_dir = + if let ActionState::Attack(_) | ActionState::Block(_) = update.character.action_state { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; if ori_dir.magnitude_squared() > 0.0001 && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() @@ -49,25 +48,25 @@ impl StateHandler for State { // Try to sit if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Sit(None); + update.character.move_state = MoveState::Sit(None); return update; } // Try to climb if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(None); + update.character.move_state = MoveState::Climb(None); return update; } // Try to jump if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = Jump(None); + update.character.move_state = MoveState::Jump(None); return update; } // Try to glide if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Glide(None); + update.character.move_state = MoveState::Glide(None); return update; } diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 032cc4a27d..3de7e3fa41 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -1,4 +1,4 @@ -use crate::comp::{ActionState::*, EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -18,8 +18,8 @@ impl StateHandler for State { }; // Prevent action state handling - update.character.action_state = Idle(None); - update.character.move_state = Sit(None); + update.character.action_state = ActionState::Idle(None); + update.character.move_state = MoveState::Sit(None); // Try to Fall // ... maybe the ground disappears, @@ -31,19 +31,19 @@ impl StateHandler for State { } // Try to jump if ecs_data.inputs.jump.is_pressed() { - update.character.move_state = Jump(None); + update.character.move_state = MoveState::Jump(None); return update; } // Try to Run if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = Run(None); + update.character.move_state = MoveState::Run(None); return update; } // Try to Stand if ecs_data.inputs.sit.is_just_pressed() { - update.character.move_state = Stand(None); + update.character.move_state = MoveState::Stand(None); return update; } diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index 9536cc7a61..9b392567d5 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -1,4 +1,4 @@ -use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -19,25 +19,25 @@ impl StateHandler for State { // Try to sit if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Sit(None); + update.character.move_state = MoveState::Sit(None); return update; } // Try to climb if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Climb(None); + update.character.move_state = MoveState::Climb(None); return update; } // Try to jump if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = Jump(None); + update.character.move_state = MoveState::Jump(None); return update; } // Check gliding if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = Glide(None); + update.character.move_state = MoveState::Glide(None); return update; } diff --git a/common/src/comp/states/swim.rs b/common/src/comp/states/swim.rs index 8ccecc2b70..1b48b0f02f 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/comp/states/swim.rs @@ -1,4 +1,4 @@ -use crate::comp::{EcsStateData, MoveState::*, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; use crate::sys::phys::GRAVITY; use std::time::Duration; use vek::{Vec2, Vec3}; @@ -32,13 +32,12 @@ impl StateHandler for State { }; // Set direction based on move direction when on the ground - let ori_dir = if update.character.action_state.is_attacking() - || update.character.action_state.is_blocking() - { - Vec2::from(ecs_data.inputs.look_dir).normalized() - } else { - Vec2::from(update.vel.0) - }; + let ori_dir = + if let ActionState::Attack(_) | ActionState::Block(_) = update.character.action_state { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; if ori_dir.magnitude_squared() > 0.0001 && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() @@ -64,16 +63,16 @@ impl StateHandler for State { // Not on ground if !ecs_data.physics.on_ground { - update.character.move_state = Swim(None); + update.character.move_state = MoveState::Swim(None); return update; } // On ground else { // Return to running or standing based on move inputs update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - Run(None) + MoveState::Run(None) } else { - Stand(None) + MoveState::Stand(None) }; return update; diff --git a/common/src/comp/states/wield.rs b/common/src/comp/states/wield.rs index bcf9e0d582..651736c8f9 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/comp/states/wield.rs @@ -1,6 +1,4 @@ -use crate::comp::{ - ActionState::*, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, -}; +use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData}; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -37,7 +35,7 @@ impl StateHandler for State { if ecs_data.inputs.toggle_wield.is_just_pressed() && ecs_data.character.action_state.is_equip_finished() { - update.character.action_state = Idle(None); + update.character.action_state = ActionState::Idle(None); return update; } @@ -54,7 +52,7 @@ impl StateHandler for State { } else { // Equip delay hasn't expired yet // Update wield delay - update.character.action_state = Wield(Some(State { + update.character.action_state = ActionState::Wield(Some(State { equip_delay: self .equip_delay .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/util/state_utils.rs b/common/src/util/state_utils.rs index e303e102e5..b4dc42806c 100644 --- a/common/src/util/state_utils.rs +++ b/common/src/util/state_utils.rs @@ -1,33 +1,25 @@ use crate::comp::{ - ActionState, ActionState::*, AttackKind::*, BasicAttackState, BasicBlockState, BlockKind::*, - Body, ControllerInputs, FallState, IdleState, ItemKind::Tool, MoveState, MoveState::*, - PhysicsState, RunState, StandState, Stats, SwimState, WieldState, + ActionState, ActionState::*, AttackKind::*, BlockKind::*, Body, ControllerInputs, + ItemKind::Tool, MoveState, MoveState::*, PhysicsState, Stats, }; -use std::time::Duration; /// _Determines what ability a player has selected for their primary ability, -/// and returns the corresponding `ActionState` -/// ... or Idle if nothing it possible?_ +/// and returns the corresponding `ActionState` or Idle if nothing_ pub fn determine_primary_ability(stats: &Stats) -> ActionState { - if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Attack(BasicAttack(Some(BasicAttackState { - remaining_duration: data.attack_duration(), - }))) + if let Some(Tool(_)) = stats.equipment.main.as_ref().map(|i| &i.kind) { + Attack(BasicAttack(None)) } else { - Idle(Some(IdleState)) + Idle(None) } } /// _Determines what ability a player has selected for their primary ability, -/// and returns the corresponding `ActionState` -/// ... or Idle if nothing it possible?_ +/// and returns the corresponding `ActionState` or Idle if nothing_ pub fn determine_secondary_ability(stats: &Stats) -> ActionState { - if let Some(Tool(_data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Block(BasicBlock(Some(BasicBlockState { - active_duration: Duration::default(), - }))) + if let Some(Tool(_)) = stats.equipment.main.as_ref().map(|i| &i.kind) { + Block(BasicBlock(None)) } else { - Idle(Some(IdleState)) + Idle(None) } } @@ -35,18 +27,18 @@ pub fn determine_secondary_ability(stats: &Stats) -> ActionState { pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { // Check if in fluid to go to swimming or back to falling if physics.in_fluid { - Swim(Some(SwimState)) + Swim(None) } else { - Fall(Some(FallState)) + Fall(None) } } /// _Returns a `MoveState` based on `move_dir` magnitude_ pub fn determine_stand_or_run(inputs: &ControllerInputs) -> MoveState { // Return to running or standing based on move inputs if inputs.move_dir.magnitude_squared() > 0.0 { - Run(Some(RunState)) + Run(None) } else { - Stand(Some(StandState)) + Stand(None) } } @@ -71,11 +63,9 @@ pub fn determine_move_from_grounded_state( /// _Returns an ActionState based on whether character has a weapon equipped._ pub fn attempt_wield(stats: &Stats) -> ActionState { if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Wield(Some(WieldState { - equip_delay: data.equip_time(), - })) + Wield(None) } else { - Idle(Some(IdleState)) + Idle(None) } } diff --git a/server/src/sys/entity_sync.rs b/server/src/sys/entity_sync.rs index a0d79fcb91..cb6c812353 100644 --- a/server/src/sys/entity_sync.rs +++ b/server/src/sys/entity_sync.rs @@ -238,7 +238,7 @@ impl<'a> System<'a> for Sys { if let Some(&character_state) = character_state { if last_character_state .get(entity) - .map(|&l| !character_state.is_same_state(&l.0)) + .map(|&l| !character_state.equals(&l.0)) .unwrap_or(true) { let _ = last_character_state.insert(entity, Last(character_state)); diff --git a/voxygen/src/audio/sfx/event_mapper.rs b/voxygen/src/audio/sfx/event_mapper.rs index 46c32fd7d5..e8fc1f01ba 100644 --- a/voxygen/src/audio/sfx/event_mapper.rs +++ b/voxygen/src/audio/sfx/event_mapper.rs @@ -5,9 +5,8 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use client::Client; use common::{ comp::{ - ActionState, AttackKind::*, BasicAttackState, Body, CharacterState, DodgeKind::*, - FallState, GlideState, IdleState, ItemKind, MoveState, Pos, RollState, RunState, - StandState, Stats, SwordKind::*, ToolData, ToolKind::*, + ActionState, AttackKind::*, Body, CharacterState, DodgeKind::*, ItemKind, MoveState, Pos, + Stats, SwordKind::*, ToolData, ToolKind::*, }, event::{EventBus, SfxEvent, SfxEventItem}, }; @@ -325,8 +324,8 @@ mod tests { let result = SfxEventMapper::map_character_event( &CharacterState { - move_state: MoveState::Fall((None)), - action_state: ActionState::Idle((None)), + move_state: MoveState::Fall(None), + action_state: ActionState::Idle(None), }, SfxEvent::Idle, &stats, diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 797dead31d..b8dacc5ee1 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -161,10 +161,11 @@ impl FigureModelCache { }, if camera_mode != CameraMode::FirstPerson || character_state - .map(|cs| { - cs.action_state.is_attacking() - || cs.action_state.is_blocking() - || cs.action_state.is_wielding() + .map(|cs| match cs.action_state { + ActionState::Attack(_) + | ActionState::Block(_) + | ActionState::Wield(_) => true, + _ => false, }) .unwrap_or_default() { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index c104a58df0..36ecdbaa3f 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -189,10 +189,13 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } - if !character.is_same_action_state(&last_character.0) { + if !character + .action_state + .equals(&last_character.0.action_state) + { state.action_time = 0.0; } @@ -332,7 +335,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -389,7 +392,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -444,7 +447,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -499,7 +502,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -554,7 +557,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -609,7 +612,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -664,7 +667,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } @@ -719,7 +722,7 @@ impl FigureMgr { _ => continue, }; - if !character.is_same_move_state(&last_character.0) { + if !character.move_state.equals(&last_character.0.move_state) { state.move_state_time = 0.0; } diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 52cc3efbbe..e489ff4b31 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -10,7 +10,7 @@ use client::{self, Client, Event::Chat}; use common::{ clock::Clock, comp, - comp::{Pos, Vel}, + comp::{ActionState, Pos, Vel}, msg::ClientState, terrain::{Block, BlockKind}, vol::ReadVol, @@ -201,10 +201,11 @@ impl PlayState for SessionState { .state() .read_storage::() .get(client.entity()) - .map(|cs| { - cs.action_state.is_wielding() - || cs.action_state.is_blocking() - || cs.action_state.is_attacking() + .map(|cs| match cs.action_state { + ActionState::Attack(_) + | ActionState::Block(_) + | ActionState::Wield(_) => true, + _ => false, }) .unwrap_or(false) { From 563e50b67d5a320c85370ce2aec366920450e15b Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Thu, 9 Jan 2020 08:23:20 -0800 Subject: [PATCH 025/387] Move utils file --- common/src/comp/states/basic_attack.rs | 2 +- common/src/comp/states/basic_block.rs | 2 +- common/src/comp/states/charge_attack.rs | 2 +- common/src/comp/states/fall.rs | 2 +- common/src/comp/states/mod.rs | 3 ++- common/src/comp/states/roll.rs | 2 +- common/src/comp/states/run.rs | 2 +- common/src/comp/states/sit.rs | 2 +- common/src/comp/states/stand.rs | 2 +- common/src/{util/state_utils.rs => comp/states/utils.rs} | 2 +- common/src/util/mod.rs | 2 -- 11 files changed, 11 insertions(+), 12 deletions(-) rename common/src/{util/state_utils.rs => comp/states/utils.rs} (97%) diff --git a/common/src/comp/states/basic_attack.rs b/common/src/comp/states/basic_attack.rs index 95b45ae968..eae687b2ad 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/comp/states/basic_attack.rs @@ -1,8 +1,8 @@ +use super::utils::*; use crate::comp::{ ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, }; -use crate::util::state_utils::*; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] diff --git a/common/src/comp/states/basic_block.rs b/common/src/comp/states/basic_block.rs index cc59682bd9..0c395a005e 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/comp/states/basic_block.rs @@ -1,5 +1,5 @@ +use super::utils::*; use crate::comp::{EcsStateData, StateHandler, StateUpdate}; -use crate::util::state_utils::*; use std::time::Duration; use vek::Vec2; diff --git a/common/src/comp/states/charge_attack.rs b/common/src/comp/states/charge_attack.rs index 040ae971d7..e437709f4f 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/comp/states/charge_attack.rs @@ -1,9 +1,9 @@ +use super::utils::*; use crate::comp::{ ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, ItemKind::Tool, MoveState::Run, StateHandler, StateUpdate, ToolData, }; use crate::event::ServerEvent; -use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; diff --git a/common/src/comp/states/fall.rs b/common/src/comp/states/fall.rs index e94215c3ff..debabb5585 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/comp/states/fall.rs @@ -1,6 +1,6 @@ use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; -use crate::util::state_utils::*; +use super::utils::*; use vek::{Vec2, Vec3}; const HUMANOID_AIR_ACCEL: f32 = 10.0; diff --git a/common/src/comp/states/mod.rs b/common/src/comp/states/mod.rs index b064026210..35dc2cca21 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/comp/states/mod.rs @@ -12,6 +12,7 @@ pub mod run; pub mod sit; pub mod stand; pub mod swim; +pub mod utils; pub mod wield; use super::{ @@ -31,7 +32,7 @@ use super::{ /// /// ## Example Implementation: /// ``` -/// use crate::util::state_utils::*; +/// use super::utils::*; /// /// #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] /// pub struct RunState { diff --git a/common/src/comp/states/roll.rs b/common/src/comp/states/roll.rs index 0a509c1fe8..e081b0b98e 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/comp/states/roll.rs @@ -1,8 +1,8 @@ +use super::utils::*; use crate::comp::{ ActionState::Dodge, DodgeKind::Roll, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData, }; -use crate::util::state_utils::*; use std::time::Duration; use vek::Vec3; diff --git a/common/src/comp/states/run.rs b/common/src/comp/states/run.rs index 15d8109769..e863ea8c80 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/comp/states/run.rs @@ -1,5 +1,5 @@ +use super::utils::*; use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; -use crate::util::state_utils::*; use vek::vec::{Vec2, Vec3}; const HUMANOID_ACCEL: f32 = 50.0; diff --git a/common/src/comp/states/sit.rs b/common/src/comp/states/sit.rs index 3de7e3fa41..24a2b11f48 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/comp/states/sit.rs @@ -1,5 +1,5 @@ +use super::utils::*; use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; -use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; diff --git a/common/src/comp/states/stand.rs b/common/src/comp/states/stand.rs index 9b392567d5..fd0dce5bb3 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/comp/states/stand.rs @@ -1,5 +1,5 @@ +use super::utils::*; use crate::comp::{EcsStateData, MoveState, StateHandler, StateUpdate}; -use crate::util::state_utils::*; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; diff --git a/common/src/util/state_utils.rs b/common/src/comp/states/utils.rs similarity index 97% rename from common/src/util/state_utils.rs rename to common/src/comp/states/utils.rs index b4dc42806c..b458596d15 100644 --- a/common/src/util/state_utils.rs +++ b/common/src/comp/states/utils.rs @@ -62,7 +62,7 @@ pub fn determine_move_from_grounded_state( /// _Returns an ActionState based on whether character has a weapon equipped._ pub fn attempt_wield(stats: &Stats) -> ActionState { - if let Some(Tool(data)) = stats.equipment.main.as_ref().map(|i| &i.kind) { + if let Some(Tool(_)) = stats.equipment.main.as_ref().map(|i| &i.kind) { Wield(None) } else { Idle(None) diff --git a/common/src/util/mod.rs b/common/src/util/mod.rs index dc154db236..01eebd1e19 100644 --- a/common/src/util/mod.rs +++ b/common/src/util/mod.rs @@ -7,8 +7,6 @@ lazy_static::lazy_static! { use vek::{Mat3, Rgb, Rgba, Vec3}; -pub mod state_utils; - /// TODO: Move these to a named utils folder. Are they even being used? I couldnt find references. /// This is a fast approximation of powf. This should only be used when minor accuracy loss is acceptable. #[inline(always)] From 1816d4b8052818d7d7c9c865a0e30ad0296a32ba Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sun, 12 Jan 2020 15:06:52 -0800 Subject: [PATCH 026/387] Move states/ to common/src/ --- common/src/comp/character_state.rs | 2 +- common/src/comp/mod.rs | 2 -- common/src/lib.rs | 1 + common/src/{comp => }/states/basic_attack.rs | 6 ++++-- common/src/{comp => }/states/basic_block.rs | 3 ++- common/src/{comp => }/states/charge_attack.rs | 3 ++- common/src/{comp => }/states/climb.rs | 0 common/src/{comp => }/states/fall.rs | 3 ++- common/src/{comp => }/states/glide.rs | 3 ++- common/src/{comp => }/states/idle.rs | 3 ++- common/src/{comp => }/states/jump.rs | 0 common/src/{comp => }/states/mod.rs | 2 +- common/src/{comp => }/states/roll.rs | 4 ++-- common/src/{comp => }/states/run.rs | 3 ++- common/src/{comp => }/states/sit.rs | 3 ++- common/src/{comp => }/states/stand.rs | 3 ++- common/src/{comp => }/states/swim.rs | 3 ++- common/src/{comp => }/states/utils.rs | 0 common/src/{comp => }/states/wield.rs | 3 ++- common/src/sys/ability.rs | 2 +- 20 files changed, 30 insertions(+), 19 deletions(-) rename common/src/{comp => }/states/basic_attack.rs (95%) rename common/src/{comp => }/states/basic_block.rs (94%) rename common/src/{comp => }/states/charge_attack.rs (96%) rename common/src/{comp => }/states/climb.rs (100%) rename common/src/{comp => }/states/fall.rs (95%) rename common/src/{comp => }/states/glide.rs (96%) rename common/src/{comp => }/states/idle.rs (95%) rename common/src/{comp => }/states/jump.rs (100%) rename common/src/{comp => }/states/mod.rs (99%) rename common/src/{comp => }/states/roll.rs (97%) rename common/src/{comp => }/states/run.rs (96%) rename common/src/{comp => }/states/sit.rs (93%) rename common/src/{comp => }/states/stand.rs (94%) rename common/src/{comp => }/states/swim.rs (96%) rename common/src/{comp => }/states/utils.rs (100%) rename common/src/{comp => }/states/wield.rs (97%) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 1c0091decd..9f4c342139 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,5 +1,5 @@ use self::ActionState::*; -use super::states::*; +use crate::states::*; use crate::{ comp::{Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, event::{EventBus, LocalEvent, ServerEvent}, diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 26a02bdef6..32f61832b5 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -11,7 +11,6 @@ mod location; mod phys; mod player; pub mod projectile; -pub mod states; mod stats; mod visual; @@ -40,6 +39,5 @@ pub use location::Waypoint; pub use phys::{ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; pub use player::Player; pub use projectile::Projectile; -pub use states::*; pub use stats::{Equipment, Exp, HealthChange, HealthSource, Level, Stats}; pub use visual::LightEmitter; diff --git a/common/src/lib.rs b/common/src/lib.rs index eab693848d..230448ef3c 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -20,6 +20,7 @@ pub mod pathfinding; pub mod ray; pub mod region; pub mod state; +pub mod states; pub mod sys; pub mod terrain; pub mod util; diff --git a/common/src/comp/states/basic_attack.rs b/common/src/states/basic_attack.rs similarity index 95% rename from common/src/comp/states/basic_attack.rs rename to common/src/states/basic_attack.rs index eae687b2ad..7ff7f1f4be 100644 --- a/common/src/comp/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -1,8 +1,10 @@ use super::utils::*; use crate::comp::{ - ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, StateHandler, - StateUpdate, ToolData, + ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, StateUpdate, + ToolData, }; +use crate::states::StateHandler; + use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] diff --git a/common/src/comp/states/basic_block.rs b/common/src/states/basic_block.rs similarity index 94% rename from common/src/comp/states/basic_block.rs rename to common/src/states/basic_block.rs index 0c395a005e..a71e0cb078 100644 --- a/common/src/comp/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -1,5 +1,6 @@ use super::utils::*; -use crate::comp::{EcsStateData, StateHandler, StateUpdate}; +use crate::comp::{EcsStateData, StateUpdate}; +use crate::states::StateHandler; use std::time::Duration; use vek::Vec2; diff --git a/common/src/comp/states/charge_attack.rs b/common/src/states/charge_attack.rs similarity index 96% rename from common/src/comp/states/charge_attack.rs rename to common/src/states/charge_attack.rs index e437709f4f..bbe20d082d 100644 --- a/common/src/comp/states/charge_attack.rs +++ b/common/src/states/charge_attack.rs @@ -1,9 +1,10 @@ use super::utils::*; use crate::comp::{ ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, - ItemKind::Tool, MoveState::Run, StateHandler, StateUpdate, ToolData, + ItemKind::Tool, MoveState::Run, StateUpdate, ToolData, }; use crate::event::ServerEvent; +use crate::states::StateHandler; use std::time::Duration; use vek::Vec3; diff --git a/common/src/comp/states/climb.rs b/common/src/states/climb.rs similarity index 100% rename from common/src/comp/states/climb.rs rename to common/src/states/climb.rs diff --git a/common/src/comp/states/fall.rs b/common/src/states/fall.rs similarity index 95% rename from common/src/comp/states/fall.rs rename to common/src/states/fall.rs index debabb5585..35f3870823 100644 --- a/common/src/comp/states/fall.rs +++ b/common/src/states/fall.rs @@ -1,6 +1,7 @@ -use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; use super::utils::*; +use crate::states::StateHandler; use vek::{Vec2, Vec3}; const HUMANOID_AIR_ACCEL: f32 = 10.0; diff --git a/common/src/comp/states/glide.rs b/common/src/states/glide.rs similarity index 96% rename from common/src/comp/states/glide.rs rename to common/src/states/glide.rs index f436fddca4..8058ddaa8c 100644 --- a/common/src/comp/states/glide.rs +++ b/common/src/states/glide.rs @@ -1,4 +1,5 @@ -use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::states::StateHandler; use vek::{Vec2, Vec3}; // Gravity is 9.81 * 4, so this makes gravity equal to .15 diff --git a/common/src/comp/states/idle.rs b/common/src/states/idle.rs similarity index 95% rename from common/src/comp/states/idle.rs rename to common/src/states/idle.rs index 46af0a47fb..b64795c67e 100644 --- a/common/src/comp/states/idle.rs +++ b/common/src/states/idle.rs @@ -1,5 +1,6 @@ -use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateUpdate}; +use crate::states::StateHandler; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; diff --git a/common/src/comp/states/jump.rs b/common/src/states/jump.rs similarity index 100% rename from common/src/comp/states/jump.rs rename to common/src/states/jump.rs diff --git a/common/src/comp/states/mod.rs b/common/src/states/mod.rs similarity index 99% rename from common/src/comp/states/mod.rs rename to common/src/states/mod.rs index 35dc2cca21..78d650f9b3 100644 --- a/common/src/comp/states/mod.rs +++ b/common/src/states/mod.rs @@ -15,7 +15,7 @@ pub mod swim; pub mod utils; pub mod wield; -use super::{ +use crate::comp::{ ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, MoveState, MoveState::*, StateUpdate, }; diff --git a/common/src/comp/states/roll.rs b/common/src/states/roll.rs similarity index 97% rename from common/src/comp/states/roll.rs rename to common/src/states/roll.rs index e081b0b98e..1600e009d1 100644 --- a/common/src/comp/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,8 +1,8 @@ use super::utils::*; use crate::comp::{ - ActionState::Dodge, DodgeKind::Roll, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, - ToolData, + ActionState::Dodge, DodgeKind::Roll, EcsStateData, ItemKind::Tool, StateUpdate, ToolData, }; +use crate::states::StateHandler; use std::time::Duration; use vek::Vec3; diff --git a/common/src/comp/states/run.rs b/common/src/states/run.rs similarity index 96% rename from common/src/comp/states/run.rs rename to common/src/states/run.rs index e863ea8c80..5b2f880738 100644 --- a/common/src/comp/states/run.rs +++ b/common/src/states/run.rs @@ -1,5 +1,6 @@ use super::utils::*; -use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::states::StateHandler; use vek::vec::{Vec2, Vec3}; const HUMANOID_ACCEL: f32 = 50.0; diff --git a/common/src/comp/states/sit.rs b/common/src/states/sit.rs similarity index 93% rename from common/src/comp/states/sit.rs rename to common/src/states/sit.rs index 24a2b11f48..e92f35a2e0 100644 --- a/common/src/comp/states/sit.rs +++ b/common/src/states/sit.rs @@ -1,5 +1,6 @@ use super::utils::*; -use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::states::StateHandler; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; diff --git a/common/src/comp/states/stand.rs b/common/src/states/stand.rs similarity index 94% rename from common/src/comp/states/stand.rs rename to common/src/states/stand.rs index fd0dce5bb3..e772c560d0 100644 --- a/common/src/comp/states/stand.rs +++ b/common/src/states/stand.rs @@ -1,5 +1,6 @@ use super::utils::*; -use crate::comp::{EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{EcsStateData, MoveState, StateUpdate}; +use crate::states::StateHandler; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; diff --git a/common/src/comp/states/swim.rs b/common/src/states/swim.rs similarity index 96% rename from common/src/comp/states/swim.rs rename to common/src/states/swim.rs index 1b48b0f02f..16b0e1406b 100644 --- a/common/src/comp/states/swim.rs +++ b/common/src/states/swim.rs @@ -1,4 +1,5 @@ -use crate::comp::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::states::StateHandler; use crate::sys::phys::GRAVITY; use std::time::Duration; use vek::{Vec2, Vec3}; diff --git a/common/src/comp/states/utils.rs b/common/src/states/utils.rs similarity index 100% rename from common/src/comp/states/utils.rs rename to common/src/states/utils.rs diff --git a/common/src/comp/states/wield.rs b/common/src/states/wield.rs similarity index 97% rename from common/src/comp/states/wield.rs rename to common/src/states/wield.rs index 651736c8f9..7d91706b3f 100644 --- a/common/src/comp/states/wield.rs +++ b/common/src/states/wield.rs @@ -1,4 +1,5 @@ -use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateHandler, StateUpdate, ToolData}; +use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; +use crate::states::StateHandler; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs index 99b173c89d..f4569f0b0b 100644 --- a/common/src/sys/ability.rs +++ b/common/src/sys/ability.rs @@ -2,8 +2,8 @@ #![allow(dead_code)] use crate::comp::{ AbilityAction, AbilityActionKind, AbilityPool, ActionState::*, AttackKind, CharacterState, - StateHandler, }; +use crate::states::StateHandler; use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; From 71a39c36777b99279d3969d3559bfd0349cf5fb8 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Sun, 12 Jan 2020 15:14:08 -0800 Subject: [PATCH 027/387] Update update return statements --- common/src/states/basic_attack.rs | 2 +- common/src/states/basic_block.rs | 2 +- common/src/states/charge_attack.rs | 2 +- common/src/states/climb.rs | 2 +- common/src/states/fall.rs | 2 +- common/src/states/glide.rs | 2 +- common/src/states/idle.rs | 2 +- common/src/states/jump.rs | 2 +- common/src/states/mod.rs | 4 ++-- common/src/states/roll.rs | 2 +- common/src/states/run.rs | 2 +- common/src/states/sit.rs | 2 +- common/src/states/stand.rs | 2 +- common/src/states/swim.rs | 4 ++-- common/src/states/wield.rs | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index 7ff7f1f4be..99e44201d6 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -49,6 +49,6 @@ impl StateHandler for State { .unwrap_or_default(), }))); - return update; + update } } diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index a71e0cb078..4952691d72 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -43,6 +43,6 @@ impl StateHandler for State { return update; } - return update; + update } } diff --git a/common/src/states/charge_attack.rs b/common/src/states/charge_attack.rs index bbe20d082d..c5f11ffc1e 100644 --- a/common/src/states/charge_attack.rs +++ b/common/src/states/charge_attack.rs @@ -84,6 +84,6 @@ impl StateHandler for State { .unwrap_or_default(), }))); - return update; + update } } diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index 09450d4160..a42175e874 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -98,6 +98,6 @@ impl StateHandler for State { } } - return update; + update } } diff --git a/common/src/states/fall.rs b/common/src/states/fall.rs index 35f3870823..0ee2ae18f7 100644 --- a/common/src/states/fall.rs +++ b/common/src/states/fall.rs @@ -64,6 +64,6 @@ impl StateHandler for State { update.character.move_state = determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - return update; + update } } diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index 8058ddaa8c..4fc0b8bb0f 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -77,6 +77,6 @@ impl StateHandler for State { } // Otherwise keep gliding - return update; + update } } diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index b64795c67e..c9c18aa690 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -30,6 +30,6 @@ impl StateHandler for State { // else unarmed stuff? } - return update; + update } } diff --git a/common/src/states/jump.rs b/common/src/states/jump.rs index f8c784e546..13fcd80e81 100644 --- a/common/src/states/jump.rs +++ b/common/src/states/jump.rs @@ -24,6 +24,6 @@ impl StateHandler for State { // Immediately go to falling state after jump impulse update.character.move_state = MoveState::Fall(None); - return update; + update } } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 78d650f9b3..1bed45136f 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -69,14 +69,14 @@ use crate::comp::{ /// // Try to jump /// if state_utils::can_jump(ecs_data.physics, ecs_data.inputs) { /// update.character.move_state = Jump(None); -/// return update; +/// update /// } /// /// // Update based on groundedness /// update.character.move_state = /// state_utils::determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); /// -/// return update; +/// update /// } /// } /// ``` diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 1600e009d1..1f3391ae9b 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -64,6 +64,6 @@ impl StateHandler for State { }))); // Keep rolling - return update; + update } } diff --git a/common/src/states/run.rs b/common/src/states/run.rs index 5b2f880738..366ae80dab 100644 --- a/common/src/states/run.rs +++ b/common/src/states/run.rs @@ -75,6 +75,6 @@ impl StateHandler for State { update.character.move_state = determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - return update; + update } } diff --git a/common/src/states/sit.rs b/common/src/states/sit.rs index e92f35a2e0..47b8fb9aff 100644 --- a/common/src/states/sit.rs +++ b/common/src/states/sit.rs @@ -49,6 +49,6 @@ impl StateHandler for State { } // No move has occurred, keep sitting - return update; + update } } diff --git a/common/src/states/stand.rs b/common/src/states/stand.rs index e772c560d0..3068f9e993 100644 --- a/common/src/states/stand.rs +++ b/common/src/states/stand.rs @@ -46,6 +46,6 @@ impl StateHandler for State { update.character.move_state = determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - return update; + update } } diff --git a/common/src/states/swim.rs b/common/src/states/swim.rs index 16b0e1406b..675e7b0478 100644 --- a/common/src/states/swim.rs +++ b/common/src/states/swim.rs @@ -65,7 +65,7 @@ impl StateHandler for State { // Not on ground if !ecs_data.physics.on_ground { update.character.move_state = MoveState::Swim(None); - return update; + update } // On ground else { @@ -76,7 +76,7 @@ impl StateHandler for State { MoveState::Stand(None) }; - return update; + update } } } diff --git a/common/src/states/wield.rs b/common/src/states/wield.rs index 7d91706b3f..508e400113 100644 --- a/common/src/states/wield.rs +++ b/common/src/states/wield.rs @@ -61,6 +61,6 @@ impl StateHandler for State { })); } - return update; + update } } From 5959d2a5c7ed7e5a50f928f40ee455de3eeeb917 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Thu, 16 Jan 2020 05:28:45 -0800 Subject: [PATCH 028/387] Fix SFX and Assets --- assets/common/items/weapons/hammer_1.ron | 12 ++++++--- assets/common/items/weapons/staff_1.ron | 10 ++++++-- assets/voxygen/audio/sfx.ron | 15 +++-------- common/src/comp/character_state.rs | 2 +- common/src/comp/controller.rs | 2 +- common/src/event.rs | 10 ++++++-- common/src/msg/ecs_packet.rs | 25 +++++++++++++++++++ common/src/sys/character_state.rs | 2 +- common/src/sys/controller.rs | 1 - common/src/sys/mod.rs | 8 +----- .../src/audio/sfx/event_mapper/movement.rs | 16 +++++++----- voxygen/src/hud/skillbar.rs | 1 - 12 files changed, 67 insertions(+), 37 deletions(-) diff --git a/assets/common/items/weapons/hammer_1.ron b/assets/common/items/weapons/hammer_1.ron index badb1732cc..13862f88c2 100644 --- a/assets/common/items/weapons/hammer_1.ron +++ b/assets/common/items/weapons/hammer_1.ron @@ -2,7 +2,13 @@ Item( name: "Crude Mallet", description: "Breaks bones like sticks and stones.", kind: Tool( - kind: Hammer, - power: 20, - ), + ToolData ( + kind: Hammer, + equip_time_millis: 1000, + attack_buildup_millis: 700, + attack_recover_millis: 100, + range: 3, + base_damage: 10, + ) + ) ) diff --git a/assets/common/items/weapons/staff_1.ron b/assets/common/items/weapons/staff_1.ron index 59e41d09ed..cb1bc62358 100644 --- a/assets/common/items/weapons/staff_1.ron +++ b/assets/common/items/weapons/staff_1.ron @@ -2,7 +2,13 @@ Item( name: "Humble Stick", description: "Walking stick with a sharpened end.", kind: Tool( - kind: Hammer, - power: 6, + ToolData ( + kind: Staff, + equip_time_millis: 800, + attack_buildup_millis: 400, + attack_recover_millis: 300, + range: 3, + base_damage: 10, + ) ), ) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index a4b560db4b..f7cbb166c7 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -23,26 +23,17 @@ ], threshold: 0.5, ), - ( - trigger: Attack(Sword(Rapier)), + Attack(Melee): ( files: [ "voxygen.audio.sfx.weapon.sword", ], threshold: 0.5, ), - ( - trigger: Attack(Hammer), - files: [ - "voxygen.audio.sfx.weapon.sword", - ], - threshold: 0.5, - ), - ( - trigger: Attack(Bow), + Attack(Bow): ( files: [ "voxygen.audio.sfx.weapon.bow", ], threshold: 0.5, ), - ], + } ) \ No newline at end of file diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 9f4c342139..2eef455fd4 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -4,12 +4,12 @@ use crate::{ comp::{Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, + sync::Uid, }; use serde::Deserialize; use serde::Serialize; use specs::LazyUpdate; use specs::{Component, Entity, FlaggedStorage, HashMapStorage, NullStorage}; -use sphynx::Uid; use std::time::Duration; pub struct EcsStateData<'a> { diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index 0ef19b369b..0db076fb8d 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -69,7 +69,7 @@ impl Input { (self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION) } - // Whether input has been pressed for longer than `threshold` + /// Whether input has been pressed for longer than `threshold` pub fn is_long_press(&self, threshold: Duration) -> bool { (self.is_pressed() && self.duration >= threshold) } diff --git a/common/src/event.rs b/common/src/event.rs index e2fed9f153..803fe06362 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -20,7 +20,13 @@ impl SfxEventItem { Self { sfx, pos: None } } } - +#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] +/// Which Kind of Attack Sfx to play, +pub enum AttackSFX { + // Decouples attack sfx assets from attack kinds + Melee, + Bow, +} #[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] pub enum SfxEvent { Idle, @@ -42,7 +48,7 @@ pub enum SfxEvent { LevelUp, LightLantern, ExtinguishLantern, - Attack(ToolKind), + Attack(AttackSFX), AttackWolf, } diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 4043d2c895..9809115c45 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -70,6 +70,11 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Mass(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::OverrideAction(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::OverrideMove(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::OverrideState(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::AbilityAction(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::AbilityPool(comp) => sync::handle_insert(comp, entity, world), } } fn apply_modify(self, entity: specs::Entity, world: &specs::World) { @@ -87,6 +92,11 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Mass(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::OverrideAction(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::OverrideMove(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::OverrideState(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::AbilityAction(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::AbilityPool(comp) => sync::handle_modify(comp, entity, world), } } fn apply_remove(phantom: Self::Phantom, entity: specs::Entity, world: &specs::World) { @@ -106,6 +116,21 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPhantom::Mass(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Gravity(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Sticky(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::OverrideAction(_) => { + sync::handle_remove::(entity, world) + } + EcsCompPhantom::OverrideMove(_) => { + sync::handle_remove::(entity, world) + } + EcsCompPhantom::OverrideState(_) => { + sync::handle_remove::(entity, world) + } + EcsCompPhantom::AbilityAction(_) => { + sync::handle_remove::(entity, world) + } + EcsCompPhantom::AbilityPool(_) => { + sync::handle_remove::(entity, world) + } } } } diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 54ce8de3dd..258abe8cee 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -5,10 +5,10 @@ use crate::{ }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, + sync::{Uid, UidAllocator}, }; use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; -use sphynx::{Uid, UidAllocator}; /// ## Character State System /// #### Calls updates to `CharacterState`s. Acts on tuples of ( `CharacterState`, `Pos`, `Vel`, and `Ori` ). diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index 0a0cc83966..a5e1cb8ccd 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -8,7 +8,6 @@ use specs::{ saveload::{Marker, MarkerAllocator}, Entities, Join, Read, ReadStorage, System, WriteStorage, }; -use sphynx::{Uid, UidAllocator}; /// # Controller System /// #### Responsible for validating and updating controller inputs diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index c95d54b6e6..f8b2fa5627 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -3,7 +3,6 @@ pub mod agent; pub mod character_state; pub mod controller; mod mount; -pub mod movement; pub mod phys; mod projectile; mod stats; @@ -18,7 +17,6 @@ pub const AGENT_SYS: &str = "agent_sys"; pub const CONTROLLER_SYS: &str = "controller_sys"; pub const MOUNT_SYS: &str = "mount_sys"; pub const PHYS_SYS: &str = "phys_sys"; -pub const MOVEMENT_SYS: &str = "movement_sys"; pub const PROJECTILE_SYS: &str = "projectile_sys"; pub const STATS_SYS: &str = "stats_sys"; pub const CLEANUP_SYS: &str = "cleanup_sys"; @@ -30,10 +28,6 @@ pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(stats::Sys, STATS_SYS, &[]); dispatch_builder.add(ability::Sys, ABILITY_SYS, &[CHARACTER_STATE_SYS]); - dispatch_builder.add( - phys::Sys, - PHYS_SYS, - &[CONTROLLER_SYS, MOUNT_SYS, MOVEMENT_SYS, STATS_SYS], - ); + dispatch_builder.add(phys::Sys, PHYS_SYS, &[CONTROLLER_SYS, MOUNT_SYS, STATS_SYS]); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); } diff --git a/voxygen/src/audio/sfx/event_mapper/movement.rs b/voxygen/src/audio/sfx/event_mapper/movement.rs index 67d884953f..fda1239ba9 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement.rs @@ -126,8 +126,12 @@ impl MovementEventMapper { /// as opening or closing the glider. These methods translate those entity states with some additional /// data into more specific `SfxEvent`'s which we attach sounds to fn map_movement_event(current_event: &CharacterState, previous_event: SfxEvent) -> SfxEvent { - match (current_event.movement, current_event.action, previous_event) { - (_, ActionState::Roll(_), _) => SfxEvent::Roll, + match ( + current_event.move_state, + current_event.action_state, + previous_event, + ) { + (_, ActionState::Dodge(_), _) => SfxEvent::Roll, (MoveState::Climb(_), ..) => SfxEvent::Climb, (MoveState::Swim(_), ..) => SfxEvent::Swim, (MoveState::Run(_), ..) => SfxEvent::Run, @@ -290,8 +294,8 @@ mod tests { fn maps_land_on_ground_to_run() { let result = MovementEventMapper::map_movement_event( &CharacterState { - movement: MovementState::Stand, - action: ActionState::Idle, + move_state: MoveState::Stand(None), + action_state: ActionState::Idle(None), }, SfxEvent::Fall, ); @@ -342,8 +346,8 @@ mod tests { fn maps_glider_close_when_landing() { let result = MovementEventMapper::map_movement_event( &CharacterState { - movement: MoveState::Stand(None), - action: ActionState::Idle(None), + move_state: MoveState::Stand(None), + action_state: ActionState::Idle(None), }, SfxEvent::Glide, ); diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index f65b28496b..771ce9c725 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -119,7 +119,6 @@ impl<'a> Skillbar<'a> { fonts, stats, energy, - global_state, current_resource: ResourceType::Mana, common: widget::CommonBuilder::default(), pulse, From 976eface66a67b254ceb284cabd78bb524b691c1 Mon Sep 17 00:00:00 2001 From: AdamWhitehurst Date: Fri, 17 Jan 2020 08:39:21 -0800 Subject: [PATCH 029/387] Update from MR comments --- common/src/comp/character_state.rs | 20 +--------------- common/src/comp/mod.rs | 2 +- common/src/event.rs | 1 - common/src/msg/ecs_packet.rs | 21 ----------------- common/src/state.rs | 3 --- common/src/states/mod.rs | 23 ++++--------------- common/src/sys/agent.rs | 4 +--- common/src/sys/character_state.rs | 23 ++++--------------- .../src/audio/sfx/event_mapper/movement.rs | 8 ++----- 9 files changed, 15 insertions(+), 90 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 2eef455fd4..5fd75a0924 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -9,7 +9,7 @@ use crate::{ use serde::Deserialize; use serde::Serialize; use specs::LazyUpdate; -use specs::{Component, Entity, FlaggedStorage, HashMapStorage, NullStorage}; +use specs::{Component, Entity, FlaggedStorage, HashMapStorage}; use std::time::Duration; pub struct EcsStateData<'a> { @@ -159,21 +159,3 @@ impl Default for CharacterState { impl Component for CharacterState { type Storage = FlaggedStorage>; } - -#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct OverrideState; -impl Component for OverrideState { - type Storage = FlaggedStorage>; -} - -#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct OverrideAction; -impl Component for OverrideAction { - type Storage = FlaggedStorage>; -} - -#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct OverrideMove; -impl Component for OverrideMove { - type Storage = FlaggedStorage>; -} diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 4dcc7d7172..6457cdee37 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -25,7 +25,7 @@ pub use body::{ }; pub use character_state::{ ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, EcsStateData, MoveState, - OverrideAction, OverrideMove, OverrideState, StateUpdate, + StateUpdate, }; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, diff --git a/common/src/event.rs b/common/src/event.rs index 803fe06362..04f393d38c 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -1,5 +1,4 @@ use crate::{comp, sync::Uid}; -use comp::item::ToolKind; use parking_lot::Mutex; use serde::Deserialize; use specs::Entity as EcsEntity; diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 9809115c45..f918cbb344 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -21,9 +21,6 @@ sum_type! { Mass(comp::Mass), Gravity(comp::Gravity), Sticky(comp::Sticky), - OverrideAction(comp::OverrideAction), - OverrideMove(comp::OverrideMove), - OverrideState(comp::OverrideState), AbilityAction(comp::AbilityAction), AbilityPool(comp::AbilityPool), } @@ -46,9 +43,6 @@ sum_type! { Mass(PhantomData), Gravity(PhantomData), Sticky(PhantomData), - OverrideAction(PhantomData), - OverrideMove(PhantomData), - OverrideState(PhantomData), AbilityAction(PhantomData), AbilityPool(PhantomData), } @@ -70,9 +64,6 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Mass(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world), - EcsCompPacket::OverrideAction(comp) => sync::handle_insert(comp, entity, world), - EcsCompPacket::OverrideMove(comp) => sync::handle_insert(comp, entity, world), - EcsCompPacket::OverrideState(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::AbilityAction(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_insert(comp, entity, world), } @@ -92,9 +83,6 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Mass(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world), - EcsCompPacket::OverrideAction(comp) => sync::handle_modify(comp, entity, world), - EcsCompPacket::OverrideMove(comp) => sync::handle_modify(comp, entity, world), - EcsCompPacket::OverrideState(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::AbilityAction(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_modify(comp, entity, world), } @@ -116,15 +104,6 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPhantom::Mass(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Gravity(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Sticky(_) => sync::handle_remove::(entity, world), - EcsCompPhantom::OverrideAction(_) => { - sync::handle_remove::(entity, world) - } - EcsCompPhantom::OverrideMove(_) => { - sync::handle_remove::(entity, world) - } - EcsCompPhantom::OverrideState(_) => { - sync::handle_remove::(entity, world) - } EcsCompPhantom::AbilityAction(_) => { sync::handle_remove::(entity, world) } diff --git a/common/src/state.rs b/common/src/state.rs index d5d8e1cf21..430b86bb52 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -110,9 +110,6 @@ impl State { ecs.register::(); ecs.register::(); ecs.register::(); - ecs.register::(); - ecs.register::(); - ecs.register::(); ecs.register::(); ecs.register::(); ecs.register::(); diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 1bed45136f..d95186eaf9 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -32,7 +32,7 @@ use crate::comp::{ /// /// ## Example Implementation: /// ``` -/// use super::utils::*; +/// use crate::states::utils; /// /// #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] /// pub struct RunState { @@ -54,27 +54,12 @@ use crate::comp::{ /// ori: *ecs_data.ori, /// }; /// -/// // Update player's Vel -/// update.vel.0 += Vec2::broadcast(ecs_data.dt.0) -/// * ecs_data.inputs.move_dir -/// * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { -/// HUMANOID_ACCEL -/// } else { -/// 0.0 -/// }; -/// /// // -- snip -- -/// // Other updates; checks for gliding, climbing, etc. -/// -/// // Try to jump -/// if state_utils::can_jump(ecs_data.physics, ecs_data.inputs) { -/// update.character.move_state = Jump(None); -/// update -/// } +/// // Updates; checks for gliding, climbing, etc. /// /// // Update based on groundedness /// update.character.move_state = -/// state_utils::determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); +/// utils::determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); /// /// update /// } @@ -125,6 +110,7 @@ impl ActionState { } } + // TODO: remove when we split up character states into SingleAction and MultiAction enum variants /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing pub fn overrides_move_state(&self) -> bool { match self { @@ -149,6 +135,7 @@ impl ActionState { // fn's that relate to individual `MoveState`s // or passing data from system to handlers impl MoveState { + // TODO: remove when we split up character states into SingleAction and MultiAction enum variants /// Passes data to variant or subvariant handlers /// States contain `Option`s, and will be /// `None` if state data has not been initialized. So we have to diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 98460e3248..272462f3f6 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,6 +1,4 @@ -use crate::comp::{ - Agent, CharacterState, Controller, ControllerInputs, MountState, MoveState::Glide, Pos, Stats, -}; +use crate::comp::{Agent, CharacterState, Controller, MountState, MoveState::Glide, Pos, Stats}; use crate::hierarchical::ChunkPath; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 258abe8cee..151b0a3791 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, - OverrideAction, OverrideMove, OverrideState, PhysicsState, Pos, Stats, Vel, + Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, PhysicsState, + Pos, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -35,9 +35,6 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, PhysicsState>, ReadStorage<'a, Uid>, ReadStorage<'a, Mounting>, - ReadStorage<'a, OverrideState>, - ReadStorage<'a, OverrideMove>, - ReadStorage<'a, OverrideAction>, ); fn run( &mut self, @@ -58,12 +55,9 @@ impl<'a> System<'a> for Sys { physics_states, uids, mountings, - state_overrides, - move_overrides, - action_overrides, ): Self::SystemData, ) { - for (entity, uid, mut character, pos, vel, ori, controller, stats, body, physics, ()) in ( + for (entity, uid, mut character, pos, vel, ori, controller, stats, body, physics) in ( &entities, &uids, &mut character_states, @@ -74,7 +68,6 @@ impl<'a> System<'a> for Sys { &stats, &bodies, &physics_states, - !&state_overrides, ) .join() { @@ -99,10 +92,7 @@ impl<'a> System<'a> for Sys { } // Determine new action if character can act - if let (None, false) = ( - action_overrides.get(entity), - character.move_state.overrides_action_state(), - ) { + if !character.move_state.overrides_action_state() { let state_update = character.action_state.update(&EcsStateData { entity: &entity, uid, @@ -127,10 +117,7 @@ impl<'a> System<'a> for Sys { } // Determine new move state if character can move - if let (None, false) = ( - move_overrides.get(entity), - character.action_state.overrides_move_state(), - ) { + if !character.action_state.overrides_move_state() { let state_update = character.move_state.update(&EcsStateData { entity: &entity, uid, diff --git a/voxygen/src/audio/sfx/event_mapper/movement.rs b/voxygen/src/audio/sfx/event_mapper/movement.rs index fda1239ba9..eecf6d7752 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement.rs @@ -4,10 +4,7 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use client::Client; use common::{ - comp::{ - ActionState, AttackKind::*, Body, CharacterState, DodgeKind::*, ItemKind, MoveState, Pos, - Stats, SwordKind::*, ToolData, ToolKind::*, - }, + comp::{ActionState, Body, CharacterState, MoveState, Pos}, event::{EventBus, SfxEvent, SfxEventItem}, }; use hashbrown::HashMap; @@ -157,8 +154,7 @@ impl MovementEventMapper { mod tests { use super::*; use common::{ - assets, - comp::{ActionState, MoveState, Stats}, + comp::{ActionState, CharacterState, DodgeKind::*, MoveState}, event::SfxEvent, }; use std::time::{Duration, Instant}; From 7353ab3432fd32783fc8e38cd2c3c1733ce1ecb7 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 18 Jan 2020 05:13:25 -0800 Subject: [PATCH 030/387] Undo sfx changes --- .gitignore | 3 +++ assets/voxygen/audio/sfx.ron | 12 ------------ common/src/event.rs | 10 ++-------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 4422efb240..0769e0f20c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ todo.txt # direnv /.envrc *.bat + +# Mac +.DS_Store \ No newline at end of file diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index f7cbb166c7..8310f26c09 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -23,17 +23,5 @@ ], threshold: 0.5, ), - Attack(Melee): ( - files: [ - "voxygen.audio.sfx.weapon.sword", - ], - threshold: 0.5, - ), - Attack(Bow): ( - files: [ - "voxygen.audio.sfx.weapon.bow", - ], - threshold: 0.5, - ), } ) \ No newline at end of file diff --git a/common/src/event.rs b/common/src/event.rs index 04f393d38c..5251358ace 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -19,13 +19,7 @@ impl SfxEventItem { Self { sfx, pos: None } } } -#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] -/// Which Kind of Attack Sfx to play, -pub enum AttackSFX { - // Decouples attack sfx assets from attack kinds - Melee, - Bow, -} + #[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] pub enum SfxEvent { Idle, @@ -47,7 +41,7 @@ pub enum SfxEvent { LevelUp, LightLantern, ExtinguishLantern, - Attack(AttackSFX), + Attack, AttackWolf, } From 7b558b45421044a14c8a369a612600c8542b601b Mon Sep 17 00:00:00 2001 From: timokoesters Date: Tue, 21 Jan 2020 23:54:32 +0100 Subject: [PATCH 031/387] refactor: combine actionstate and movestate --- common/src/comp/ability.rs | 8 +- common/src/comp/character_state.rs | 150 ++--- common/src/comp/mod.rs | 5 +- common/src/states/climb.rs | 17 +- common/src/states/glide.rs | 25 +- common/src/states/idle.rs | 22 +- common/src/states/mod.rs | 136 +---- common/src/states/roll.rs | 15 +- common/src/states/run.rs | 80 --- common/src/states/sit.rs | 38 +- common/src/states/stand.rs | 6 - common/src/states/utils.rs | 93 +++- common/src/states/wielded.rs | 43 ++ common/src/states/{wield.rs => wielding.rs} | 31 +- common/src/sys/ability.rs | 4 +- common/src/sys/agent.rs | 12 +- common/src/sys/character_state.rs | 74 +-- .../src/audio/sfx/event_mapper/movement.rs | 128 +---- voxygen/src/menu/char_selection/scene.rs | 1 - voxygen/src/scene/figure/cache.rs | 24 +- voxygen/src/scene/figure/mod.rs | 525 ++++++++++-------- voxygen/src/scene/mod.rs | 2 +- voxygen/src/session.rs | 8 +- 23 files changed, 614 insertions(+), 833 deletions(-) delete mode 100644 common/src/states/run.rs create mode 100644 common/src/states/wielded.rs rename common/src/states/{wield.rs => wielding.rs} (55%) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index baf6fe24af..8dc488a620 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -23,10 +23,10 @@ impl Component for AbilityAction { #[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)] pub struct AbilityPool { - pub primary: Option, - pub secondary: Option, - pub block: Option, - pub dodge: Option, + pub primary: Option, + pub secondary: Option, + pub block: Option, + pub dodge: Option, } impl Component for AbilityPool { diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 5fd75a0924..4bd65127a6 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,4 +1,3 @@ -use self::ActionState::*; use crate::states::*; use crate::{ comp::{Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, @@ -10,7 +9,6 @@ use serde::Deserialize; use serde::Serialize; use specs::LazyUpdate; use specs::{Component, Entity, FlaggedStorage, HashMapStorage}; -use std::time::Duration; pub struct EcsStateData<'a> { pub entity: &'a Entity, @@ -36,123 +34,95 @@ pub struct StateUpdate { pub ori: Ori, } -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum MoveState { - Stand(Option), - Run(Option), - Sit(Option), - Jump(Option), - Fall(Option), - Glide(Option), - Swim(Option), - Climb(Option), -} - -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum ActionState { +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub enum CharacterState { Idle(Option), - Wield(Option), - Attack(AttackKind), - Block(BlockKind), - Dodge(DodgeKind), - // Interact?, -} - -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum AttackKind { - BasicAttack(Option), - Charge(Option), -} - -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum BlockKind { - BasicBlock(Option), -} - -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum DodgeKind { + Climb(Option), + Sit(Option), + Wielding(Option), + Wielded(Option), + //BasicAttack(Option), + //BasicBlock(Option), + //Charge(Option), Roll(Option), + Glide(Option), } -impl ActionState { - pub fn is_equip_finished(&self) -> bool { +impl CharacterState { + pub fn is_attack(&self) -> bool { match self { - Wield(Some(wield::State { equip_delay })) => *equip_delay == Duration::default(), - _ => true, - } - } - - /// Returns the current `equip_delay` if in `WieldState`, otherwise `Duration::default()` - pub fn get_delay(&self) -> Duration { - match self { - Wield(Some(wield::State { equip_delay })) => *equip_delay, - _ => Duration::default(), - } - } - - pub fn is_attacking(&self) -> bool { - match self { - Attack(_) => true, + //CharacterState::BasicAttack(_) => true, _ => false, } } - pub fn is_blocking(&self) -> bool { + pub fn is_block(&self) -> bool { match self { - Block(_) => true, + //CharacterState::BasicBlock(_) => true, _ => false, } } - pub fn is_dodging(&self) -> bool { + pub fn is_dodge(&self) -> bool { match self { - Dodge(_) => true, + CharacterState::Roll(_) => true, _ => false, } } + /// Compares `action_state`s for shallow equality (does not check internal struct equality) pub fn equals(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data std::mem::discriminant(&self) == std::mem::discriminant(&other) } -} -impl MoveState { - /// Compares `move_state`s for shallow equality (does not check internal struct equality) - pub fn equals(&self, other: &Self) -> bool { - // Check if state is the same without looking at the inner data - std::mem::discriminant(&self) == std::mem::discriminant(&other) - } -} - -/// __A concurrent state machine that allows for separate `ActionState`s and `MoveState`s.__ -#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct CharacterState { - /// __How the character is currently moving, e.g. Running, Standing, Falling.__ - /// - /// _Primarily `handle()`s updating `Pos`, `Vel`, `Ori`, and lower body animations. - pub move_state: MoveState, - - /// __How the character is currently acting, e.g. Wielding, Attacking, Dodging.__ - /// - /// _Primarily `handle()`s how character interacts with world, and upper body animations. - pub action_state: ActionState, -} - -impl CharacterState { - /// Compares both `move_state`s and `action_state`a for shallow equality - /// (does not check internal struct equality) - pub fn equals(&self, other: &Self) -> bool { - self.move_state.equals(&other.move_state) && self.action_state.equals(&other.action_state) + /// Passes data to variant or subvariant handlers + /// States contain `Option`s, and will be + /// `None` if state data has not been initialized. So we have to + /// check and intialize new state data if so. + pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { + match self { + CharacterState::Idle(opt_state) => opt_state + .unwrap_or_else(|| idle::State::new(ecs_data)) + .handle(ecs_data), + CharacterState::Climb(opt_state) => opt_state + .unwrap_or_else(|| climb::State::new(ecs_data)) + .handle(ecs_data), + CharacterState::Sit(opt_state) => opt_state + .unwrap_or_else(|| sit::State::new(ecs_data)) + .handle(ecs_data), + CharacterState::Wielding(opt_state) => opt_state + .unwrap_or_else(|| wielding::State::new(ecs_data)) + .handle(ecs_data), + CharacterState::Wielded(opt_state) => opt_state + .unwrap_or_else(|| wielded::State::new(ecs_data)) + .handle(ecs_data), + /*CharacterState::BasicAttack(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one + .unwrap_or_else(|| basic_attack::State::new(ecs_data)) + // Call handler + .handle(ecs_data), + CharacterState::Charge(opt_state) => opt_state + .unwrap_or_else(|| charge_attack::State::new(ecs_data)) + .handle(ecs_data), + CharacterState::BasicBlock(opt_state) => opt_state + .unwrap_or_else(|| basic_block::State::new(ecs_data)) + .handle(ecs_data),*/ + CharacterState::Roll(opt_state) => opt_state + .unwrap_or_else(|| roll::State::new(ecs_data)) + .handle(ecs_data), + CharacterState::Glide(opt_state) => opt_state + .unwrap_or_else(|| glide::State::new(ecs_data)) + .handle(ecs_data), + // All states should be explicitly handled + // Do not use default match: _ => {}, + } } } impl Default for CharacterState { fn default() -> Self { - Self { - move_state: MoveState::Fall(None), - action_state: ActionState::Idle(None), - } + Self::Idle(None) } } diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 6457cdee37..4b346e6ca6 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -23,10 +23,7 @@ pub use body::{ biped_large, bird_medium, bird_small, dragon, fish_medium, fish_small, humanoid, object, quadruped_medium, quadruped_small, Body, }; -pub use character_state::{ - ActionState, AttackKind, BlockKind, CharacterState, DodgeKind, EcsStateData, MoveState, - StateUpdate, -}; +pub use character_state::{CharacterState, EcsStateData, StateUpdate}; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, Mounting, diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index a42175e874..7db0631a6d 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -1,4 +1,5 @@ -use super::{ActionState, EcsStateData, MoveState, StateHandler, StateUpdate}; +use crate::comp::{CharacterState, EcsStateData, StateUpdate}; +use crate::states::StateHandler; use crate::sys::phys::GRAVITY; use vek::vec::{Vec2, Vec3}; use vek::Lerp; @@ -22,27 +23,20 @@ impl StateHandler for State { character: *ecs_data.character, }; - update.character.action_state = ActionState::Idle(None); - // If no wall is in front of character ... if let None = ecs_data.physics.on_wall { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost - update.character.move_state = MoveState::Jump(None); - - return update; + //TODO: JUMP EVENT } else { // Just fall off - update.character.move_state = MoveState::Fall(None); - - return update; + update.character = CharacterState::Idle(None); } } // Remove climb state on ground, otherwise character will get stuck if ecs_data.physics.on_ground { - update.character.move_state = MoveState::Stand(None); - return update; + update.character = CharacterState::Idle(None); } // Move player @@ -65,6 +59,7 @@ impl StateHandler for State { Vec2::from(update.vel.0) }; + // Smooth orientation if ori_dir.magnitude_squared() > 0.0001 && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index 4fc0b8bb0f..f848cd6ee6 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -1,4 +1,4 @@ -use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::comp::{CharacterState, EcsStateData, StateUpdate}; use crate::states::StateHandler; use vek::{Vec2, Vec3}; @@ -16,6 +16,7 @@ impl StateHandler for State { } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + dbg!(); let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, @@ -23,26 +24,14 @@ impl StateHandler for State { character: *ecs_data.character, }; - // Defaults for this state - update.character.action_state = ActionState::Idle(None); - update.character.move_state = MoveState::Glide(None); - - // If glide button isn't held, start falling - if !ecs_data.inputs.glide.is_pressed() { - update.character.move_state = MoveState::Fall(None); - return update; + // If glide button isn't held or player is on ground, end glide + if !ecs_data.inputs.glide.is_pressed() || ecs_data.physics.on_ground { + update.character = CharacterState::Idle(None); } // If there is a wall in front of character go to climb - if let Some(_wall_dir) = ecs_data.physics.on_wall { - update.character.move_state = MoveState::Climb(None); - return update; - } - - // If on ground go to stand - if ecs_data.physics.on_ground { - update.character.move_state = MoveState::Stand(None); - return update; + if let Some(_) = ecs_data.physics.on_wall { + update.character = CharacterState::Climb(None); } // Move player according to movement direction vector diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index c9c18aa690..541285dad4 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -1,4 +1,5 @@ -use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateUpdate}; +use super::utils::*; +use crate::comp::{EcsStateData, StateUpdate}; use crate::states::StateHandler; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -17,18 +18,13 @@ impl StateHandler for State { ori: *ecs_data.ori, }; - // Try to wield - if ecs_data.inputs.primary.is_pressed() - || ecs_data.inputs.secondary.is_pressed() - || (ecs_data.inputs.toggle_wield.is_just_pressed() - && update.character.action_state.is_equip_finished()) - { - if let Some(Tool(_)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { - update.character.action_state = ActionState::Wield(None); - } - - // else unarmed stuff? - } + handle_move_dir(ecs_data, &mut update); + handle_wield(ecs_data, &mut update); + handle_sit(ecs_data, &mut update); + handle_climb(ecs_data, &mut update); + handle_roll(ecs_data, &mut update); + //handle_jump(ecs_data, &mut update); + handle_glide(ecs_data, &mut update); update } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index d95186eaf9..a794626c10 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -1,24 +1,14 @@ // Module declarations -pub mod basic_attack; -pub mod basic_block; -pub mod charge_attack; pub mod climb; -pub mod fall; pub mod glide; pub mod idle; -pub mod jump; pub mod roll; -pub mod run; pub mod sit; -pub mod stand; -pub mod swim; pub mod utils; -pub mod wield; +pub mod wielded; +pub mod wielding; -use crate::comp::{ - ActionState, ActionState::*, AttackKind::*, BlockKind::*, DodgeKind::*, EcsStateData, - MoveState, MoveState::*, StateUpdate, -}; +use crate::comp::{EcsStateData, StateUpdate}; /// ## A type for implementing State Handling Behavior. /// @@ -69,123 +59,3 @@ pub trait StateHandler: Default { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; fn new(ecs_data: &EcsStateData) -> Self; } - -// fn's relating to individual `ActionState`s -// or passing data from system to handlers -impl ActionState { - /// Passes data to variant or subvariant handlers - /// States contain `Option`s, and will be - /// `None` if state data has not been initialized. So we have to - /// check and intialize new state data if so. - pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { - match self { - Attack(kind) => match kind { - BasicAttack(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one - .unwrap_or_else(|| basic_attack::State::new(ecs_data)) - // Call handler - .handle(ecs_data), - Charge(opt_state) => opt_state - .unwrap_or_else(|| charge_attack::State::new(ecs_data)) - .handle(ecs_data), - }, - Block(kind) => match kind { - BasicBlock(opt_state) => opt_state - .unwrap_or_else(|| basic_block::State::new(ecs_data)) - .handle(ecs_data), - }, - Dodge(kind) => match kind { - Roll(opt_state) => opt_state - .unwrap_or_else(|| roll::State::new(ecs_data)) - .handle(ecs_data), - }, - Wield(opt_state) => opt_state - .unwrap_or_else(|| wield::State::new(ecs_data)) - .handle(ecs_data), - Idle(opt_state) => opt_state - .unwrap_or_else(|| idle::State::new(ecs_data)) - .handle(ecs_data), - // All states should be explicitly handled - // Do not use default match: _ => {}, - } - } - - // TODO: remove when we split up character states into SingleAction and MultiAction enum variants - /// Returns whether a given `ActionState` overrides `MoveState` `handle()`ing - pub fn overrides_move_state(&self) -> bool { - match self { - Attack(kind) => match kind { - BasicAttack(_) => false, - Charge(_) => true, - }, - Block(kind) => match kind { - BasicBlock(_) => true, - }, - Dodge(kind) => match kind { - Roll(_) => true, - }, - Wield(_) => false, - Idle(_) => false, - // All states should be explicitly handled - // Do not use default match: _ => {}, - } - } -} - -// fn's that relate to individual `MoveState`s -// or passing data from system to handlers -impl MoveState { - // TODO: remove when we split up character states into SingleAction and MultiAction enum variants - /// Passes data to variant or subvariant handlers - /// States contain `Option`s, and will be - /// `None` if state data has not been initialized. So we have to - /// check and intialize new state data if so. - pub fn overrides_action_state(&self) -> bool { - match self { - Stand(_) => false, - Run(_) => false, - Jump(_) => false, - Climb(_) => true, - Glide(_) => true, - Swim(_) => false, - Fall(_) => false, - Sit(_) => true, - // All states should be explicitly handled - // Do not use default match: _ => {}, - } - } - - /// Passes handle to variant handlers - pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { - match self { - Stand(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one - .unwrap_or_else(|| stand::State::new(ecs_data)) - // Call handler - .handle(ecs_data), - Run(opt_state) => opt_state - .unwrap_or_else(|| run::State::new(ecs_data)) - .handle(ecs_data), - Jump(opt_state) => opt_state - .unwrap_or_else(|| jump::State::new(ecs_data)) - .handle(ecs_data), - Climb(opt_state) => opt_state - .unwrap_or_else(|| climb::State::new(ecs_data)) - .handle(ecs_data), - Glide(opt_state) => opt_state - .unwrap_or_else(|| glide::State::new(ecs_data)) - .handle(ecs_data), - Swim(opt_state) => opt_state - .unwrap_or_else(|| swim::State::new(ecs_data)) - .handle(ecs_data), - Fall(opt_state) => opt_state - .unwrap_or_else(|| fall::State::new(ecs_data)) - .handle(ecs_data), - Sit(opt_state) => opt_state - .unwrap_or_else(|| sit::State::new(ecs_data)) - .handle(ecs_data), - // All states should be explicitly handled - // Do not use default match: _ => {}, - } - } -} diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 1f3391ae9b..9979d6308d 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,7 +1,5 @@ use super::utils::*; -use crate::comp::{ - ActionState::Dodge, DodgeKind::Roll, EcsStateData, ItemKind::Tool, StateUpdate, ToolData, -}; +use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; use crate::states::StateHandler; use std::time::Duration; use vek::Vec3; @@ -48,20 +46,13 @@ impl StateHandler for State { .unwrap_or_default() * ROLL_SPEED; - // Check if roll duration has expired - if self.remaining_duration == Duration::default() { - // If so, go back to wielding or idling - update.character.action_state = attempt_wield(ecs_data.stats); - return update; - } - // Otherwise, tick down remaining_duration - update.character.action_state = Dodge(Roll(Some(State { + update.character = CharacterState::Roll(Some(State { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - }))); + })); // Keep rolling update diff --git a/common/src/states/run.rs b/common/src/states/run.rs deleted file mode 100644 index 366ae80dab..0000000000 --- a/common/src/states/run.rs +++ /dev/null @@ -1,80 +0,0 @@ -use super::utils::*; -use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; -use crate::states::StateHandler; -use vek::vec::{Vec2, Vec3}; - -const HUMANOID_ACCEL: f32 = 50.0; -const HUMANOID_SPEED: f32 = 120.0; - -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State; - -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } - - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - }; - - // Move player according to move_dir - update.vel.0 += Vec2::broadcast(ecs_data.dt.0) - * ecs_data.inputs.move_dir - * if update.vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) { - HUMANOID_ACCEL - } else { - 0.0 - }; - - // Set direction based on move direction when on the ground - let ori_dir = - if let ActionState::Attack(_) | ActionState::Block(_) = update.character.action_state { - Vec2::from(ecs_data.inputs.look_dir).normalized() - } else { - Vec2::from(update.vel.0) - }; - - if ori_dir.magnitude_squared() > 0.0001 - && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() - > 0.001 - { - update.ori.0 = - vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * ecs_data.dt.0); - } - - // Try to sit - if can_sit(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = MoveState::Sit(None); - return update; - } - - // Try to climb - if can_climb(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = MoveState::Climb(None); - return update; - } - - // Try to jump - if can_jump(ecs_data.physics, ecs_data.inputs) { - update.character.move_state = MoveState::Jump(None); - return update; - } - - // Try to glide - if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = MoveState::Glide(None); - return update; - } - - // Update based on groundedness - update.character.move_state = - determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); - - update - } -} diff --git a/common/src/states/sit.rs b/common/src/states/sit.rs index 47b8fb9aff..f6a392acb8 100644 --- a/common/src/states/sit.rs +++ b/common/src/states/sit.rs @@ -1,5 +1,5 @@ use super::utils::*; -use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::comp::{CharacterState, EcsStateData, StateUpdate}; use crate::states::StateHandler; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -18,37 +18,17 @@ impl StateHandler for State { ori: *ecs_data.ori, }; - // Prevent action state handling - update.character.action_state = ActionState::Idle(None); - update.character.move_state = MoveState::Sit(None); + //handle_jump(ecs_data, &mut update); + handle_wield(ecs_data, &mut update); - // Try to Fall - // ... maybe the ground disappears, - // suddenly maybe a water spell appears. - // Can't hurt to be safe :shrug: - if !ecs_data.physics.on_ground { - update.character.move_state = determine_fall_or_swim(ecs_data.physics); - return update; - } - // Try to jump - if ecs_data.inputs.jump.is_pressed() { - update.character.move_state = MoveState::Jump(None); - return update; + // Try to Fall/Stand up/Move + if !ecs_data.physics.on_ground + || ecs_data.inputs.sit.is_just_pressed() + || ecs_data.inputs.move_dir.magnitude_squared() > 0.0 + { + update.character = CharacterState::Idle(None); } - // Try to Run - if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - update.character.move_state = MoveState::Run(None); - return update; - } - - // Try to Stand - if ecs_data.inputs.sit.is_just_pressed() { - update.character.move_state = MoveState::Stand(None); - return update; - } - - // No move has occurred, keep sitting update } } diff --git a/common/src/states/stand.rs b/common/src/states/stand.rs index 3068f9e993..37dd3c4bbe 100644 --- a/common/src/states/stand.rs +++ b/common/src/states/stand.rs @@ -36,12 +36,6 @@ impl StateHandler for State { return update; } - // Check gliding - if can_glide(ecs_data.physics, ecs_data.inputs, ecs_data.body) { - update.character.move_state = MoveState::Glide(None); - return update; - } - // Else update based on groundedness update.character.move_state = determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index b458596d15..8ae5410587 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,8 +1,10 @@ use crate::comp::{ - ActionState, ActionState::*, AttackKind::*, BlockKind::*, Body, ControllerInputs, - ItemKind::Tool, MoveState, MoveState::*, PhysicsState, Stats, + Body, CharacterState, ControllerInputs, EcsStateData, ItemKind::Tool, PhysicsState, + StateUpdate, Stats, }; +use vek::vec::{Vec2, Vec3}; +/* /// _Determines what ability a player has selected for their primary ability, /// and returns the corresponding `ActionState` or Idle if nothing_ pub fn determine_primary_ability(stats: &Stats) -> ActionState { @@ -102,4 +104,91 @@ pub fn can_jump(physics: &PhysicsState, inputs: &ControllerInputs) -> bool { } else { false } +}*/ + +pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { + let (accel, speed): (f32, f32) = if ecs_data.physics.on_ground { + let accel = 50.0; + let speed = 120.0; + (accel, speed) + } else { + let accel = 10.0; + let speed = 100.0; + (accel, speed) + }; + + // Move player according to move_dir + update.vel.0 += Vec2::broadcast(ecs_data.dt.0) + * ecs_data.inputs.move_dir + * if update.vel.0.magnitude_squared() < speed.powf(2.0) { + accel + } else { + 0.0 + }; + + // Set direction based on move direction + let ori_dir = if update.character.is_attack() || update.character.is_block() { + Vec2::from(ecs_data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; + + // Smooth orientation + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * ecs_data.dt.0); + } +} + +pub fn handle_wield(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if ecs_data.inputs.primary.is_pressed() || ecs_data.inputs.secondary.is_pressed() { + if let Some(Tool(_)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { + update.character = CharacterState::Wielding(None); + } + } +} + +pub fn handle_sit(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if ecs_data.inputs.sit.is_pressed() && ecs_data.physics.on_ground && ecs_data.body.is_humanoid() + { + update.character = CharacterState::Sit(None); + } +} + +pub fn handle_climb(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if (ecs_data.inputs.climb.is_pressed() || ecs_data.inputs.climb_down.is_pressed()) + && ecs_data.physics.on_wall.is_some() + && ecs_data.body.is_humanoid() + { + update.character = CharacterState::Climb(None); + } +} + +pub fn handle_roll(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if ecs_data.inputs.roll.is_pressed() + && ecs_data.physics.on_ground + && ecs_data.body.is_humanoid() + { + update.character = CharacterState::Roll(None); + } +} + +pub fn handle_unwield(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if let CharacterState::Wielded(_) = update.character { + if ecs_data.inputs.toggle_wield.is_pressed() { + update.character = CharacterState::Idle(None); + } + } +} + +pub fn handle_glide(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if ecs_data.inputs.glide.is_pressed() + && !ecs_data.physics.on_ground + && ecs_data.body.is_humanoid() + { + dbg!(); + update.character = CharacterState::Glide(None); + } } diff --git a/common/src/states/wielded.rs b/common/src/states/wielded.rs new file mode 100644 index 0000000000..27800331b3 --- /dev/null +++ b/common/src/states/wielded.rs @@ -0,0 +1,43 @@ +use super::utils::*; +use crate::comp::{EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; +use crate::states::StateHandler; +use std::time::Duration; + +#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct State { + /// How long before a new action can be performed + /// after equipping + pub equip_delay: Duration, +} + +impl StateHandler for State { + fn new(ecs_data: &EcsStateData) -> Self { + let tool_data = + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { + data + } else { + ToolData::default() + }; + Self { + equip_delay: tool_data.equip_time(), + } + } + + fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + let mut update = StateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + }; + + handle_move_dir(&ecs_data, &mut update); + handle_sit(&ecs_data, &mut update); + handle_roll(&ecs_data, &mut update); + handle_climb(&ecs_data, &mut update); + handle_glide(&ecs_data, &mut update); + handle_unwield(&ecs_data, &mut update); + + update + } +} diff --git a/common/src/states/wield.rs b/common/src/states/wielding.rs similarity index 55% rename from common/src/states/wield.rs rename to common/src/states/wielding.rs index 508e400113..32e97b8bb4 100644 --- a/common/src/states/wield.rs +++ b/common/src/states/wielding.rs @@ -1,4 +1,5 @@ -use crate::comp::{ActionState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; +use super::utils::*; +use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; use crate::states::StateHandler; use std::time::Duration; @@ -17,6 +18,7 @@ impl StateHandler for State { } else { ToolData::default() }; + Self { equip_delay: tool_data.equip_time(), } @@ -30,30 +32,15 @@ impl StateHandler for State { ori: *ecs_data.ori, }; - // Only act once equip_delay has expired - if self.equip_delay == Duration::default() { - // Toggle Weapons - if ecs_data.inputs.toggle_wield.is_just_pressed() - && ecs_data.character.action_state.is_equip_finished() - { - update.character.action_state = ActionState::Idle(None); - return update; - } + handle_move_dir(&ecs_data, &mut update); - // Try weapon actions - if ecs_data.inputs.primary.is_pressed() { - // ecs_data - // .updater - // .insert(*ecs_data.entity, AbilityAction(Primary)); - } else if ecs_data.inputs.secondary.is_pressed() { - // ecs_data - // .updater - // .insert(*ecs_data.entity, AbilityAction(Secondary)); - } + if self.equip_delay == Duration::default() { + // Wield delay has expired + update.character = CharacterState::Wielded(None); } else { - // Equip delay hasn't expired yet + // Wield delay hasn't expired yet // Update wield delay - update.character.action_state = ActionState::Wield(Some(State { + update.character = CharacterState::Wielding(Some(State { equip_delay: self .equip_delay .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs index f4569f0b0b..07aaa21bd1 100644 --- a/common/src/sys/ability.rs +++ b/common/src/sys/ability.rs @@ -1,8 +1,6 @@ #![allow(unused_imports)] #![allow(dead_code)] -use crate::comp::{ - AbilityAction, AbilityActionKind, AbilityPool, ActionState::*, AttackKind, CharacterState, -}; +use crate::comp::{AbilityAction, AbilityActionKind, AbilityPool, CharacterState}; use crate::states::StateHandler; use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 272462f3f6..649dc86100 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -1,4 +1,4 @@ -use crate::comp::{Agent, CharacterState, Controller, MountState, MoveState::Glide, Pos, Stats}; +use crate::comp::{Agent, CharacterState, Controller, MountState, Pos, Stats}; use crate::hierarchical::ChunkPath; use crate::pathfinding::WorldPath; use crate::terrain::TerrainGrid; @@ -167,11 +167,11 @@ impl<'a> System<'a> for Sys { inputs.roll.set_state(true); } - if target_character.move_state == Glide(None) - && target_pos.0.z > pos.0.z + 5.0 - { - inputs.glide.set_state(true); - inputs.jump.set_state(true); + if let CharacterState::Glide(_) = target_character { + if target_pos.0.z > pos.0.z + 5.0 { + inputs.glide.set_state(true); + inputs.jump.set_state(true); + } } } else { choose_new = true; diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 151b0a3791..c36aae2a1d 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - Body, CharacterState, Controller, EcsStateData, Mounting, MoveState::*, Ori, PhysicsState, - Pos, Stats, Vel, + Body, CharacterState, Controller, EcsStateData, Mounting, Ori, PhysicsState, Pos, Stats, + Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -87,59 +87,31 @@ 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(entity) { - character.move_state = Sit(None); + *character = CharacterState::Sit(None); return; } - // Determine new action if character can act - if !character.move_state.overrides_action_state() { - let state_update = character.action_state.update(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); + let state_update = character.update(&EcsStateData { + entity: &entity, + uid, + character, + pos, + vel, + ori, + dt: &dt, + inputs, + stats, + body, + physics, + updater: &updater, + server_bus: &server_bus, + local_bus: &local_bus, + }); - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } - - // Determine new move state if character can move - if !character.action_state.overrides_move_state() { - let state_update = character.move_state.update(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, - }); - - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - } + *character = state_update.character; + *pos = state_update.pos; + *vel = state_update.vel; + *ori = state_update.ori; } } } diff --git a/voxygen/src/audio/sfx/event_mapper/movement.rs b/voxygen/src/audio/sfx/event_mapper/movement.rs index eecf6d7752..5026b9c8a6 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement.rs @@ -4,7 +4,7 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use client::Client; use common::{ - comp::{ActionState, Body, CharacterState, MoveState, Pos}, + comp::{Body, CharacterState, Pos}, event::{EventBus, SfxEvent, SfxEventItem}, }; use hashbrown::HashMap; @@ -123,28 +123,21 @@ impl MovementEventMapper { /// as opening or closing the glider. These methods translate those entity states with some additional /// data into more specific `SfxEvent`'s which we attach sounds to fn map_movement_event(current_event: &CharacterState, previous_event: SfxEvent) -> SfxEvent { - match ( - current_event.move_state, - current_event.action_state, - previous_event, - ) { - (_, ActionState::Dodge(_), _) => SfxEvent::Roll, - (MoveState::Climb(_), ..) => SfxEvent::Climb, - (MoveState::Swim(_), ..) => SfxEvent::Swim, - (MoveState::Run(_), ..) => SfxEvent::Run, - (MoveState::Jump(_), ..) => SfxEvent::Jump, - (MoveState::Fall(_), _, SfxEvent::Glide) => SfxEvent::GliderClose, - (MoveState::Stand(_), _, SfxEvent::Fall) => SfxEvent::Run, - (MoveState::Fall(_), _, SfxEvent::Jump) => SfxEvent::Idle, - (MoveState::Fall(_), _, _) => SfxEvent::Fall, - (MoveState::Glide(_), _, previous_event) => { + match (current_event, previous_event) { + (CharacterState::Roll(_), _) => SfxEvent::Roll, + (CharacterState::Climb(_), _) => SfxEvent::Climb, + (CharacterState::Idle(_), _) => SfxEvent::Run, + (CharacterState::Idle(_), SfxEvent::Glide) => SfxEvent::GliderClose, + (CharacterState::Idle(_), SfxEvent::Fall) => SfxEvent::Run, + (CharacterState::Idle(_), SfxEvent::Jump) => SfxEvent::Idle, + (CharacterState::Glide(_), previous_event) => { if previous_event != SfxEvent::GliderOpen && previous_event != SfxEvent::Glide { SfxEvent::GliderOpen } else { SfxEvent::Glide } } - (MoveState::Stand(_), _, SfxEvent::Glide) => SfxEvent::GliderClose, + (CharacterState::Idle(_), SfxEvent::Glide) => SfxEvent::GliderClose, _ => SfxEvent::Idle, } } @@ -153,10 +146,7 @@ impl MovementEventMapper { #[cfg(test)] mod tests { use super::*; - use common::{ - comp::{ActionState, CharacterState, DodgeKind::*, MoveState}, - event::SfxEvent, - }; + use common::{comp::CharacterState, event::SfxEvent}; use std::time::{Duration, Instant}; #[test] @@ -236,118 +226,50 @@ mod tests { #[test] fn maps_idle() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Stand(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Idle, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Idle(None), SfxEvent::Idle); assert_eq!(result, SfxEvent::Idle); } - #[test] - fn maps_run() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Run(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Idle, - ); - - assert_eq!(result, SfxEvent::Run); - } - #[test] fn maps_roll() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - action_state: ActionState::Dodge(Roll(None)), - move_state: MoveState::Run(None), - }, - SfxEvent::Run, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Roll(None), SfxEvent::Run); assert_eq!(result, SfxEvent::Roll); } - #[test] - fn maps_fall() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Fall(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Fall, - ); - - assert_eq!(result, SfxEvent::Fall); - } - #[test] fn maps_land_on_ground_to_run() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Stand(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Fall, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Idle(None), SfxEvent::Fall); assert_eq!(result, SfxEvent::Run); } #[test] fn maps_glider_open() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Glide(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Jump, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Glide(None), SfxEvent::Jump); assert_eq!(result, SfxEvent::GliderOpen); } #[test] fn maps_glide() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Glide(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Glide, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Glide(None), SfxEvent::Glide); assert_eq!(result, SfxEvent::Glide); } #[test] fn maps_glider_close_when_closing_mid_flight() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Fall(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Glide, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Idle(None), SfxEvent::Glide); assert_eq!(result, SfxEvent::GliderClose); } #[test] fn maps_glider_close_when_landing() { - let result = MovementEventMapper::map_movement_event( - &CharacterState { - move_state: MoveState::Stand(None), - action_state: ActionState::Idle(None), - }, - SfxEvent::Glide, - ); - + let result = + MovementEventMapper::map_movement_event(&CharacterState::Idle(None), SfxEvent::Glide); assert_eq!(result, SfxEvent::GliderClose); } } diff --git a/voxygen/src/menu/char_selection/scene.rs b/voxygen/src/menu/char_selection/scene.rs index e5712f956e..78013154b2 100644 --- a/voxygen/src/menu/char_selection/scene.rs +++ b/voxygen/src/menu/char_selection/scene.rs @@ -168,7 +168,6 @@ impl Scene { Rgba::broadcast(1.0), 1.0 / 60.0, // TODO: Use actual deltatime here? 1.0, - 1.0, 0, true, ); diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index b8dacc5ee1..b681c3df1c 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -6,7 +6,7 @@ use crate::{ }; use common::{ assets::watch::ReloadIndicator, - comp::{ActionState, Body, CharacterState, Equipment, MoveState}, + comp::{Body, CharacterState, Equipment}, }; use hashbrown::HashMap; use std::mem::{discriminant, Discriminant}; @@ -24,15 +24,13 @@ enum FigureKey { #[derive(PartialEq, Eq, Hash, Clone)] struct CharacterStateCacheKey { - move_state: Discriminant, - action: Discriminant, + state: Discriminant, // TODO: Can this be simplified? } impl From<&CharacterState> for CharacterStateCacheKey { fn from(cs: &CharacterState) -> Self { Self { - move_state: discriminant(&cs.move_state), - action: discriminant(&cs.action_state), + state: discriminant(&cs), } } } @@ -132,17 +130,14 @@ impl FigureModelCache { }, if camera_mode == CameraMode::FirstPerson && character_state - .map(|cs| cs.action_state.is_dodging()) + .map(|cs| cs.is_dodge()) .unwrap_or_default() { None } else { Some(humanoid_armor_hand_spec.mesh_left_hand(&body)) }, - if character_state - .map(|cs| cs.action_state.is_dodging()) - .unwrap_or_default() - { + if character_state.map(|cs| cs.is_dodge()).unwrap_or_default() { None } else { Some(humanoid_armor_hand_spec.mesh_right_hand(&body)) @@ -161,10 +156,11 @@ impl FigureModelCache { }, if camera_mode != CameraMode::FirstPerson || character_state - .map(|cs| match cs.action_state { - ActionState::Attack(_) - | ActionState::Block(_) - | ActionState::Wield(_) => true, + .map(|cs| match cs { + //CharacterState::BasicAttack(_) // TODO: enable + //| CharacterState::BasicBlock(_) + CharacterState::Wielding(_) + | CharacterState::Wielded(_) => true, _ => false, }) .unwrap_or_default() diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index bfb89b9b7d..29dd93927a 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -18,8 +18,7 @@ use crate::{ use client::Client; use common::{ comp::{ - ActionState::*, AttackKind::*, Body, CharacterState, ItemKind, Last, MoveState::*, Ori, - Pos, Scale, Stats, ToolData, Vel, + Body, CharacterState, ItemKind, Last, Ori, PhysicsState, Pos, Scale, Stats, ToolData, Vel, }, terrain::TerrainChunk, vol::RectRasterableVol, @@ -80,14 +79,16 @@ impl FigureMgr { .get(client.entity()) .map_or(Vec3::zero(), |pos| pos.0); - for (entity, pos, ori, scale, body, character, last_character, stats) in ( + for (entity, pos, vel, ori, scale, body, character, last_character, physics, stats) in ( &ecs.entities(), &ecs.read_storage::(), + &ecs.read_storage::(), &ecs.read_storage::(), ecs.read_storage::().maybe(), &ecs.read_storage::(), ecs.read_storage::().maybe(), ecs.read_storage::>().maybe(), + &ecs.read_storage::(), ecs.read_storage::().maybe(), ) .join() @@ -328,8 +329,7 @@ impl FigureMgr { ) .1; - let mut move_state_animation_rate = 1.0; - let mut action_animation_rate = 1.0; + let mut state_animation_rate = 1.0; let vel = ecs .read_storage::() @@ -357,121 +357,142 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; - } - if !character - .action_state - .equals(&last_character.0.action_state) - { - state.action_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match &character.move_state { - Stand(_) => anim::character::StandAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::character::StandAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::character::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::character::RunAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, state.last_ori, time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) | Fall(_) => anim::character::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::character::JumpAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Glide(_) => anim::character::GlidingAnimation::update_skeleton( - &CharacterSkeleton::new(), - (active_tool_kind, vel.0, ori.0, state.last_ori, time), - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Swim(_) => anim::character::SwimAnimation::update_skeleton( + // Swim + (_, _, true) => anim::character::SwimAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0.magnitude(), ori.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Climb(_) => anim::character::ClimbAnimation::update_skeleton( - &CharacterSkeleton::new(), - (active_tool_kind, vel.0, ori.0, time), - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Sit(_) => anim::character::SitAnimation::update_skeleton( - &CharacterSkeleton::new(), - (active_tool_kind, time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), }; - let target_bones = match (&character.move_state, &character.action_state) { - (Stand(_), Wield { .. }) => { + let target_bones = match &character { + CharacterState::Roll(_) => anim::character::RollAnimation::update_skeleton( + &target_base, + (active_tool_kind, ori.0, state.last_ori, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ), + CharacterState::Wielding(_) => { anim::character::CidleAnimation::update_skeleton( &target_base, (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ) } - (Stand(_), Block { .. }) => { + CharacterState::Wielded(_) => { + anim::character::CidleAnimation::update_skeleton( + &target_base, + (active_tool_kind, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + /*CharacterState::Block(_) => { anim::character::BlockIdleAnimation::update_skeleton( &target_base, (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ) } - (_, Attack(kind)) => match kind { - Charge(_) => anim::character::ChargeAnimation::update_skeleton( + CharacterState::Charge(_) => { + anim::character::ChargeAnimation::update_skeleton( &target_base, (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, - ), - BasicAttack(_) => anim::character::AttackAnimation::update_skeleton( + ) + } + CharacterState::BasicAttack(_) => { + anim::character::AttackAnimation::update_skeleton( &target_base, (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, - ), - }, - (_, Wield(_)) => anim::character::WieldAnimation::update_skeleton( - &target_base, - (active_tool_kind, vel.0.magnitude(), time), - state.action_time, - &mut action_animation_rate, - skeleton_attr, - ), - (_, Dodge(_)) => anim::character::RollAnimation::update_skeleton( - &target_base, - (active_tool_kind, ori.0, state.last_ori, time), - state.action_time, - &mut action_animation_rate, - skeleton_attr, - ), - (_, Block(_)) => anim::character::BlockAnimation::update_skeleton( - &target_base, + ) + }*/ + CharacterState::Wielding(_) => { + anim::character::WieldAnimation::update_skeleton( + &target_base, + (active_tool_kind, vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + CharacterState::Wielded(_) => { + anim::character::WieldAnimation::update_skeleton( + &target_base, + (active_tool_kind, vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + CharacterState::Glide(_) => { + anim::character::GlidingAnimation::update_skeleton( + &target_base, + (active_tool_kind, vel.0, ori.0, state.last_ori, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + CharacterState::Climb(_) => { + anim::character::ClimbAnimation::update_skeleton( + &CharacterSkeleton::new(), + (active_tool_kind, vel.0, ori.0, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + CharacterState::Sit(_) => anim::character::SitAnimation::update_skeleton( + &CharacterSkeleton::new(), (active_tool_kind, time), - state.action_time, - &mut action_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), _ => target_base, @@ -486,8 +507,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -505,30 +525,41 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::quadruped_small::IdleAnimation::update_skeleton( - &QuadrupedSmallSkeleton::new(), - time, - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Run(_) => anim::quadruped_small::RunAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => { + anim::quadruped_small::IdleAnimation::update_skeleton( + &QuadrupedSmallSkeleton::new(), + time, + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + // Running + (true, true, false) => { + anim::quadruped_small::RunAnimation::update_skeleton( + &QuadrupedSmallSkeleton::new(), + (vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + // In air + (false, _, false) => anim::quadruped_small::JumpAnimation::update_skeleton( &QuadrupedSmallSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Jump(_) => anim::quadruped_small::JumpAnimation::update_skeleton( - &QuadrupedSmallSkeleton::new(), - (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -545,8 +576,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -564,32 +594,45 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::quadruped_medium::IdleAnimation::update_skeleton( - &QuadrupedMediumSkeleton::new(), - time, - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Run(_) => anim::quadruped_medium::RunAnimation::update_skeleton( - &QuadrupedMediumSkeleton::new(), - (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), - Jump(_) => anim::quadruped_medium::JumpAnimation::update_skeleton( - &QuadrupedMediumSkeleton::new(), - (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, - skeleton_attr, - ), + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => { + anim::quadruped_medium::IdleAnimation::update_skeleton( + &QuadrupedMediumSkeleton::new(), + time, + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + // Running + (true, true, false) => { + anim::quadruped_medium::RunAnimation::update_skeleton( + &QuadrupedMediumSkeleton::new(), + (vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } + // In air + (false, _, false) => { + anim::quadruped_medium::JumpAnimation::update_skeleton( + &QuadrupedMediumSkeleton::new(), + (vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } // TODO! _ => state.skeleton_mut().clone(), @@ -604,8 +647,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -621,30 +663,37 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::bird_medium::IdleAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::bird_medium::IdleAnimation::update_skeleton( &BirdMediumSkeleton::new(), time, - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::bird_medium::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::bird_medium::RunAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) => anim::bird_medium::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::bird_medium::JumpAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -661,8 +710,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -678,30 +726,37 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::fish_medium::IdleAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::fish_medium::IdleAnimation::update_skeleton( &FishMediumSkeleton::new(), time, - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::fish_medium::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::fish_medium::RunAnimation::update_skeleton( &FishMediumSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) => anim::fish_medium::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::fish_medium::JumpAnimation::update_skeleton( &FishMediumSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -718,8 +773,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -735,30 +789,37 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::dragon::IdleAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::dragon::IdleAnimation::update_skeleton( &DragonSkeleton::new(), time, - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::dragon::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::dragon::RunAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) => anim::dragon::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::dragon::JumpAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -775,8 +836,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -792,30 +852,37 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::bird_small::IdleAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::bird_small::IdleAnimation::update_skeleton( &BirdSmallSkeleton::new(), time, - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::bird_small::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::bird_small::RunAnimation::update_skeleton( &BirdSmallSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) => anim::bird_small::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::bird_small::JumpAnimation::update_skeleton( &BirdSmallSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -832,8 +899,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -849,30 +915,37 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::fish_small::IdleAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::fish_small::IdleAnimation::update_skeleton( &FishSmallSkeleton::new(), time, - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::fish_small::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::fish_small::RunAnimation::update_skeleton( &FishSmallSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) => anim::fish_small::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::fish_small::JumpAnimation::update_skeleton( &FishSmallSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -889,8 +962,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -906,30 +978,37 @@ impl FigureMgr { _ => continue, }; - if !character.move_state.equals(&last_character.0.move_state) { - state.move_state_time = 0.0; + if !character.equals(&last_character.0) { + state.state_time = 0.0; } - let target_base = match character.move_state { - Stand(_) => anim::biped_large::IdleAnimation::update_skeleton( + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > 0.001, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::biped_large::IdleAnimation::update_skeleton( &BipedLargeSkeleton::new(), time, - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Run(_) => anim::biped_large::RunAnimation::update_skeleton( + // Running + (true, true, false) => anim::biped_large::RunAnimation::update_skeleton( &BipedLargeSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), - Jump(_) => anim::biped_large::JumpAnimation::update_skeleton( + // In air + (false, _, false) => anim::biped_large::JumpAnimation::update_skeleton( &BipedLargeSkeleton::new(), (vel.0.magnitude(), time), - state.move_state_time, - &mut move_state_animation_rate, + state.state_time, + &mut state_animation_rate, skeleton_attr, ), @@ -946,8 +1025,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -967,8 +1045,7 @@ impl FigureMgr { scale, col, dt, - move_state_animation_rate, - action_animation_rate, + state_animation_rate, lpindex, true, ); @@ -1163,8 +1240,7 @@ impl FigureMgr { pub struct FigureState { bone_consts: Consts, locals: Consts, - move_state_time: f64, - action_time: f64, + state_time: f64, skeleton: S, pos: Vec3, ori: Vec3, @@ -1180,8 +1256,7 @@ impl FigureState { .create_consts(&skeleton.compute_matrices()) .unwrap(), locals: renderer.create_consts(&[FigureLocals::default()]).unwrap(), - move_state_time: 0.0, - action_time: 0.0, + state_time: 0.0, skeleton, pos: Vec3::zero(), ori: Vec3::zero(), @@ -1200,8 +1275,7 @@ impl FigureState { scale: f32, col: Rgba, dt: f32, - move_state_rate: f32, - action_rate: f32, + state_animation_rate: f32, lpindex: u8, visible: bool, ) { @@ -1219,8 +1293,7 @@ impl FigureState { self.ori = ori; } - self.move_state_time += (dt * move_state_rate) as f64; - self.action_time += (dt * action_rate) as f64; + self.state_time += (dt * state_animation_rate) as f64; // TODO: what are the interpolated ori values used for if not here??? let mat = Mat4::::identity() diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 5731865710..c4ba62bdd3 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -170,7 +170,7 @@ impl Scene { .ecs() .read_storage::() .get(client.entity()) - .map_or(false, |cs| cs.action_state.is_dodging()); + .map_or(false, |cs| cs.is_dodge()); let player_scale = match client .state() diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index aebc915d6a..514ec17ce0 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -11,7 +11,7 @@ use client::{self, Client, Event::Chat}; use common::{ clock::Clock, comp, - comp::{ActionState, Pos, Vel}, + comp::{Pos, Vel}, msg::ClientState, terrain::{Block, BlockKind}, vol::ReadVol, @@ -212,10 +212,10 @@ impl PlayState for SessionState { .state() .read_storage::() .get(client.entity()) - .map(|cs| match cs.action_state { - ActionState::Attack(_) + .map(|cs| match cs { + /*ActionState::Attack(_) // TODO: uncomment | ActionState::Block(_) - | ActionState::Wield(_) => true, + | ActionState::Wield(_) => true,*/ _ => false, }) .unwrap_or(false) From 6515daddce82a27a159d45d84de652e325ecd112 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 22 Jan 2020 13:48:55 +0100 Subject: [PATCH 032/387] fixes --- common/src/comp/character_state.rs | 4 ++-- common/src/states/glide.rs | 1 - common/src/states/roll.rs | 20 ++++++++++++-------- common/src/states/utils.rs | 1 - voxygen/src/scene/figure/mod.rs | 8 ++++---- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 4bd65127a6..634bda8948 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -70,10 +70,10 @@ impl CharacterState { } } - /// Compares `action_state`s for shallow equality (does not check internal struct equality) + /// Compares for shallow equality (does not check internal struct equality) pub fn equals(&self, other: &Self) -> bool { // Check if state is the same without looking at the inner data - std::mem::discriminant(&self) == std::mem::discriminant(&other) + std::mem::discriminant(self) == std::mem::discriminant(other) } /// Passes data to variant or subvariant handlers diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index f848cd6ee6..b366a3385c 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -16,7 +16,6 @@ impl StateHandler for State { } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - dbg!(); let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 9979d6308d..aeb1dd45e9 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -46,15 +46,19 @@ impl StateHandler for State { .unwrap_or_default() * ROLL_SPEED; - // Otherwise, tick down remaining_duration - update.character = CharacterState::Roll(Some(State { - remaining_duration: self - .remaining_duration - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) - .unwrap_or_default(), - })); + if self.remaining_duration == Duration::default() { + // Roll duration has expired + update.character = CharacterState::Idle(None); + } else { + // Otherwise, tick down remaining_duration + update.character = CharacterState::Roll(Some(State { + remaining_duration: self + .remaining_duration + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(), + })); + } - // Keep rolling update } } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 8ae5410587..3fe7aeb873 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -188,7 +188,6 @@ pub fn handle_glide(ecs_data: &EcsStateData, update: &mut StateUpdate) { && !ecs_data.physics.on_ground && ecs_data.body.is_humanoid() { - dbg!(); update.character = CharacterState::Glide(None); } } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 29dd93927a..34edd43a8c 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -408,18 +408,18 @@ impl FigureMgr { skeleton_attr, ), CharacterState::Wielding(_) => { - anim::character::CidleAnimation::update_skeleton( + anim::character::WieldAnimation::update_skeleton( &target_base, - (active_tool_kind, time), + (active_tool_kind, vel.0.magnitude(), time), state.state_time, &mut state_animation_rate, skeleton_attr, ) } CharacterState::Wielded(_) => { - anim::character::CidleAnimation::update_skeleton( + anim::character::WieldAnimation::update_skeleton( &target_base, - (active_tool_kind, time), + (active_tool_kind, vel.0.magnitude(), time), state.state_time, &mut state_animation_rate, skeleton_attr, From 76dfac736688e6371c0b27ef1620b6e6c09e4ac4 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 27 Jan 2020 18:32:05 +0100 Subject: [PATCH 033/387] fix: rolling --- voxygen/src/anim/character/roll.rs | 3 ++- voxygen/src/anim/mod.rs | 2 +- voxygen/src/scene/figure/mod.rs | 18 ------------------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index 8a1e05976c..c1402ac40c 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -16,9 +16,10 @@ impl Animation for RollAnimation { skeleton: &Self::Skeleton, (_active_tool_kind, orientation, last_ori, _global_time): Self::Dependency, anim_time: f64, - _rate: &mut f32, + rate: &mut f32, skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { + *rate = 1.0; let mut next = (*skeleton).clone(); let wave = (anim_time as f32 * 5.5).sin(); diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index 4091741ab7..512dc20d66 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -14,7 +14,7 @@ use crate::render::FigureBoneData; use common::comp::{self, ToolKind}; use vek::*; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug)] pub struct Bone { pub offset: Vec3, pub ori: Quaternion, diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 34edd43a8c..7e9c0b3f37 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -407,24 +407,6 @@ impl FigureMgr { &mut state_animation_rate, skeleton_attr, ), - CharacterState::Wielding(_) => { - anim::character::WieldAnimation::update_skeleton( - &target_base, - (active_tool_kind, vel.0.magnitude(), time), - state.state_time, - &mut state_animation_rate, - skeleton_attr, - ) - } - CharacterState::Wielded(_) => { - anim::character::WieldAnimation::update_skeleton( - &target_base, - (active_tool_kind, vel.0.magnitude(), time), - state.state_time, - &mut state_animation_rate, - skeleton_attr, - ) - } /*CharacterState::Block(_) => { anim::character::BlockIdleAnimation::update_skeleton( &target_base, From aa52c6fd4f1ece7cf7640ab41bf99512ddc17d46 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 3 Feb 2020 11:54:50 +0100 Subject: [PATCH 034/387] fix: jumping and attacking --- common/src/comp/ability.rs | 13 ++- common/src/comp/character_state.rs | 26 ++--- common/src/event.rs | 3 + common/src/states/basic_attack.rs | 27 +++-- common/src/states/climb.rs | 3 + common/src/states/glide.rs | 3 + common/src/states/idle.rs | 7 +- common/src/states/mod.rs | 1 + common/src/states/roll.rs | 4 +- common/src/states/sit.rs | 3 + common/src/states/utils.rs | 160 ++++++++--------------------- common/src/states/wielded.rs | 7 +- common/src/states/wielding.rs | 3 + common/src/sys/ability.rs | 65 ------------ common/src/sys/character_state.rs | 28 +++-- common/src/sys/mod.rs | 3 - server/src/lib.rs | 2 + server/src/sys/sentinel.rs | 14 ++- voxygen/src/scene/figure/mod.rs | 24 ++--- 19 files changed, 154 insertions(+), 242 deletions(-) delete mode 100644 common/src/sys/ability.rs diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 8dc488a620..f944b05b8d 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -21,7 +21,7 @@ impl Component for AbilityAction { type Storage = FlaggedStorage>; } -#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct AbilityPool { pub primary: Option, pub secondary: Option, @@ -29,6 +29,17 @@ pub struct AbilityPool { pub dodge: Option, } +impl Default for AbilityPool { + fn default() -> Self { + Self { + primary: Some(comp::CharacterState::BasicAttack(None)), + secondary: None, + block: None, + dodge: Some(comp::CharacterState::Roll(None)), + } + } +} + impl Component for AbilityPool { type Storage = FlaggedStorage>; } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 634bda8948..e94ccb306f 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,7 +1,7 @@ use crate::states::*; use crate::{ - comp::{Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, - event::{EventBus, LocalEvent, ServerEvent}, + comp::{AbilityPool, Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, + event::{LocalEvent, ServerEvent}, state::DeltaTime, sync::Uid, }; @@ -9,6 +9,7 @@ use serde::Deserialize; use serde::Serialize; use specs::LazyUpdate; use specs::{Component, Entity, FlaggedStorage, HashMapStorage}; +use std::collections::VecDeque; pub struct EcsStateData<'a> { pub entity: &'a Entity, @@ -22,9 +23,8 @@ pub struct EcsStateData<'a> { pub stats: &'a Stats, pub body: &'a Body, pub physics: &'a PhysicsState, + pub ability_pool: &'a AbilityPool, pub updater: &'a LazyUpdate, - pub server_bus: &'a EventBus, - pub local_bus: &'a EventBus, } pub struct StateUpdate { @@ -32,6 +32,8 @@ pub struct StateUpdate { pub pos: Pos, pub vel: Vel, pub ori: Ori, + pub local_events: VecDeque, + pub server_events: VecDeque, } #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -41,17 +43,17 @@ pub enum CharacterState { Sit(Option), Wielding(Option), Wielded(Option), - //BasicAttack(Option), + Glide(Option), + BasicAttack(Option), //BasicBlock(Option), //Charge(Option), Roll(Option), - Glide(Option), } impl CharacterState { pub fn is_attack(&self) -> bool { match self { - //CharacterState::BasicAttack(_) => true, + CharacterState::BasicAttack(_) => true, _ => false, } } @@ -83,7 +85,9 @@ impl CharacterState { pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { match self { CharacterState::Idle(opt_state) => opt_state + // If data hasn't been initialized, initialize a new one .unwrap_or_else(|| idle::State::new(ecs_data)) + // Call handler .handle(ecs_data), CharacterState::Climb(opt_state) => opt_state .unwrap_or_else(|| climb::State::new(ecs_data)) @@ -97,12 +101,10 @@ impl CharacterState { CharacterState::Wielded(opt_state) => opt_state .unwrap_or_else(|| wielded::State::new(ecs_data)) .handle(ecs_data), - /*CharacterState::BasicAttack(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one + CharacterState::BasicAttack(opt_state) => opt_state .unwrap_or_else(|| basic_attack::State::new(ecs_data)) - // Call handler .handle(ecs_data), - CharacterState::Charge(opt_state) => opt_state + /*CharacterState::Charge(opt_state) => opt_state .unwrap_or_else(|| charge_attack::State::new(ecs_data)) .handle(ecs_data), CharacterState::BasicBlock(opt_state) => opt_state @@ -115,7 +117,7 @@ impl CharacterState { .unwrap_or_else(|| glide::State::new(ecs_data)) .handle(ecs_data), // All states should be explicitly handled - // Do not use default match: _ => {}, + // DO NOT use default match: _ => {}, } } } diff --git a/common/src/event.rs b/common/src/event.rs index 5251358ace..f07f5bd9c8 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -146,6 +146,9 @@ impl<'a, E> Emitter<'a, E> { pub fn emit(&mut self, event: E) { self.events.push_front(event); } + pub fn append(&mut self, other: &mut VecDeque) { + self.events.append(other) + } } impl<'a, E> Drop for Emitter<'a, E> { diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index 99e44201d6..c264c54656 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -1,9 +1,6 @@ -use super::utils::*; -use crate::comp::{ - ActionState::Attack, AttackKind::BasicAttack, EcsStateData, ItemKind::Tool, StateUpdate, - ToolData, -}; +use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; use crate::states::StateHandler; +use std::collections::VecDeque; use std::time::Duration; @@ -32,22 +29,22 @@ impl StateHandler for State { vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; - // Check if attack duration has expired - if self.remaining_duration == Duration::default() { - // If so, go back to wielding or idling - update.character.action_state = attempt_wield(ecs_data.stats); - return update; - } - - // Otherwise, tick down remaining_duration, and keep rolling - update.character.action_state = Attack(BasicAttack(Some(State { + // Tick down remaining_duration + update.character = CharacterState::BasicAttack(Some(State { remaining_duration: self .remaining_duration .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) .unwrap_or_default(), - }))); + })); + + // Check if attack duration has expired + if self.remaining_duration == Duration::default() { + update.character = CharacterState::Wielded(None); + } update } diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index 7db0631a6d..08fe2742a6 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -1,6 +1,7 @@ use crate::comp::{CharacterState, EcsStateData, StateUpdate}; use crate::states::StateHandler; use crate::sys::phys::GRAVITY; +use std::collections::VecDeque; use vek::vec::{Vec2, Vec3}; use vek::Lerp; @@ -21,6 +22,8 @@ impl StateHandler for State { vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; // If no wall is in front of character ... diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index b366a3385c..87048bb068 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -1,5 +1,6 @@ use crate::comp::{CharacterState, EcsStateData, StateUpdate}; use crate::states::StateHandler; +use std::collections::VecDeque; use vek::{Vec2, Vec3}; // Gravity is 9.81 * 4, so this makes gravity equal to .15 @@ -21,6 +22,8 @@ impl StateHandler for State { vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; // If glide button isn't held or player is on ground, end glide diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index 541285dad4..f9934be701 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -1,5 +1,6 @@ use super::utils::*; use crate::comp::{EcsStateData, StateUpdate}; +use std::collections::VecDeque; use crate::states::StateHandler; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -16,15 +17,17 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; handle_move_dir(ecs_data, &mut update); + handle_jump(ecs_data, &mut update); handle_wield(ecs_data, &mut update); handle_sit(ecs_data, &mut update); handle_climb(ecs_data, &mut update); - handle_roll(ecs_data, &mut update); - //handle_jump(ecs_data, &mut update); handle_glide(ecs_data, &mut update); + handle_dodge(ecs_data, &mut update); update } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index a794626c10..1296526477 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -1,4 +1,5 @@ // Module declarations +pub mod basic_attack; pub mod climb; pub mod glide; pub mod idle; diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index aeb1dd45e9..f1596f8189 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,6 +1,6 @@ -use super::utils::*; use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; use crate::states::StateHandler; +use std::collections::VecDeque; use std::time::Duration; use vek::Vec3; @@ -31,6 +31,8 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; // Update velocity diff --git a/common/src/states/sit.rs b/common/src/states/sit.rs index f6a392acb8..34e3f44150 100644 --- a/common/src/states/sit.rs +++ b/common/src/states/sit.rs @@ -1,6 +1,7 @@ use super::utils::*; use crate::comp::{CharacterState, EcsStateData, StateUpdate}; use crate::states::StateHandler; +use std::collections::VecDeque; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; @@ -16,6 +17,8 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; //handle_jump(ecs_data, &mut update); diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 3fe7aeb873..c0854f9d79 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,111 +1,9 @@ -use crate::comp::{ - Body, CharacterState, ControllerInputs, EcsStateData, ItemKind::Tool, PhysicsState, - StateUpdate, Stats, +use crate::{ + comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate}, + event::LocalEvent, }; use vek::vec::{Vec2, Vec3}; -/* -/// _Determines what ability a player has selected for their primary ability, -/// and returns the corresponding `ActionState` or Idle if nothing_ -pub fn determine_primary_ability(stats: &Stats) -> ActionState { - if let Some(Tool(_)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Attack(BasicAttack(None)) - } else { - Idle(None) - } -} - -/// _Determines what ability a player has selected for their primary ability, -/// and returns the corresponding `ActionState` or Idle if nothing_ -pub fn determine_secondary_ability(stats: &Stats) -> ActionState { - if let Some(Tool(_)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Block(BasicBlock(None)) - } else { - Idle(None) - } -} - -/// _Returns a `MoveState` based on `in_fluid` condition_ -pub fn determine_fall_or_swim(physics: &PhysicsState) -> MoveState { - // Check if in fluid to go to swimming or back to falling - if physics.in_fluid { - Swim(None) - } else { - Fall(None) - } -} -/// _Returns a `MoveState` based on `move_dir` magnitude_ -pub fn determine_stand_or_run(inputs: &ControllerInputs) -> MoveState { - // Return to running or standing based on move inputs - if inputs.move_dir.magnitude_squared() > 0.0 { - Run(None) - } else { - Stand(None) - } -} - -/// _Returns a `MoveState` based on `on_ground` state._ -/// -/// _`FallState`, or `SwimState` if not `on_ground`, -/// `StandState` or `RunState` if is `on_ground`_ -pub fn determine_move_from_grounded_state( - physics: &PhysicsState, - inputs: &ControllerInputs, -) -> MoveState { - // Not on ground, go to swim or fall - if !physics.on_ground { - determine_fall_or_swim(physics) - } - // On ground - else { - determine_stand_or_run(inputs) - } -} - -/// _Returns an ActionState based on whether character has a weapon equipped._ -pub fn attempt_wield(stats: &Stats) -> ActionState { - if let Some(Tool(_)) = stats.equipment.main.as_ref().map(|i| &i.kind) { - Wield(None) - } else { - Idle(None) - } -} - -pub fn can_climb(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { - if let (true, Some(_wall_dir)) = ( - (inputs.climb.is_pressed() | inputs.climb_down.is_pressed()) && body.is_humanoid(), - physics.on_wall, - ) { - true - } else { - false - } -} - -pub fn can_glide(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { - if inputs.glide.is_pressed() && body.is_humanoid() && physics.on_wall == None { - true - } else { - false - } -} - -pub fn can_sit(physics: &PhysicsState, inputs: &ControllerInputs, body: &Body) -> bool { - if inputs.sit.is_pressed() && physics.on_ground && body.is_humanoid() { - true - } else { - false - } -} - -pub fn can_jump(physics: &PhysicsState, inputs: &ControllerInputs) -> bool { - if physics.on_ground && inputs.jump.is_pressed() { - true - } else { - false - } -}*/ - pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { let (accel, speed): (f32, f32) = if ecs_data.physics.on_ground { let accel = 50.0; @@ -166,15 +64,6 @@ pub fn handle_climb(ecs_data: &EcsStateData, update: &mut StateUpdate) { } } -pub fn handle_roll(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if ecs_data.inputs.roll.is_pressed() - && ecs_data.physics.on_ground - && ecs_data.body.is_humanoid() - { - update.character = CharacterState::Roll(None); - } -} - pub fn handle_unwield(ecs_data: &EcsStateData, update: &mut StateUpdate) { if let CharacterState::Wielded(_) = update.character { if ecs_data.inputs.toggle_wield.is_pressed() { @@ -184,10 +73,43 @@ pub fn handle_unwield(ecs_data: &EcsStateData, update: &mut StateUpdate) { } pub fn handle_glide(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if ecs_data.inputs.glide.is_pressed() - && !ecs_data.physics.on_ground - && ecs_data.body.is_humanoid() - { - update.character = CharacterState::Glide(None); + if let CharacterState::Idle(_) | CharacterState::Wielded(_) = update.character { + if ecs_data.inputs.glide.is_pressed() + && !ecs_data.physics.on_ground + && ecs_data.body.is_humanoid() + { + update.character = CharacterState::Glide(None); + } + } +} + +pub fn handle_jump(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if ecs_data.inputs.jump.is_pressed() && ecs_data.physics.on_ground { + update + .local_events + .push_front(LocalEvent::Jump(*ecs_data.entity)); + } +} + +pub fn handle_primary(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if let Some(state) = ecs_data.ability_pool.primary { + if let CharacterState::Wielded(_) = update.character { + if ecs_data.inputs.primary.is_pressed() { + update.character = state; + } + } + } +} + +pub fn handle_dodge(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if let Some(state) = ecs_data.ability_pool.dodge { + if let CharacterState::Idle(_) | CharacterState::Wielded(_) = update.character { + if ecs_data.inputs.roll.is_pressed() + && ecs_data.physics.on_ground + && ecs_data.body.is_humanoid() + { + update.character = state; + } + } } } diff --git a/common/src/states/wielded.rs b/common/src/states/wielded.rs index 27800331b3..e70b0c0c34 100644 --- a/common/src/states/wielded.rs +++ b/common/src/states/wielded.rs @@ -1,6 +1,7 @@ use super::utils::*; use crate::comp::{EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; use crate::states::StateHandler; +use std::collections::VecDeque; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -29,14 +30,18 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; handle_move_dir(&ecs_data, &mut update); + handle_jump(&ecs_data, &mut update); handle_sit(&ecs_data, &mut update); - handle_roll(&ecs_data, &mut update); handle_climb(&ecs_data, &mut update); handle_glide(&ecs_data, &mut update); handle_unwield(&ecs_data, &mut update); + handle_primary(&ecs_data, &mut update); + handle_dodge(&ecs_data, &mut update); update } diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index 32e97b8bb4..d2e3bd289e 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -1,6 +1,7 @@ use super::utils::*; use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; use crate::states::StateHandler; +use std::collections::VecDeque; use std::time::Duration; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -30,6 +31,8 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; handle_move_dir(&ecs_data, &mut update); diff --git a/common/src/sys/ability.rs b/common/src/sys/ability.rs deleted file mode 100644 index 07aaa21bd1..0000000000 --- a/common/src/sys/ability.rs +++ /dev/null @@ -1,65 +0,0 @@ -#![allow(unused_imports)] -#![allow(dead_code)] -use crate::comp::{AbilityAction, AbilityActionKind, AbilityPool, CharacterState}; -use crate::states::StateHandler; - -use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; - -/// # Ability System -/// #### Updates tuples of ( `CharacterState`, `AbilityAction`, and `AbilityPool`s ) -/// _Each update determines what type of ability is being started, and looks into the AbilityPool for which -/// Ability that should be used. System then updates `CharacterState` to that Ability._ -pub struct Sys; - -impl<'a> System<'a> for Sys { - type SystemData = ( - Entities<'a>, - Read<'a, LazyUpdate>, - WriteStorage<'a, CharacterState>, - ReadStorage<'a, AbilityAction>, - ReadStorage<'a, AbilityPool>, - ); - fn run( - &mut self, - ( - entities, - _updater, - mut character_state_storage, - ability_action_storage, - ability_pool_storage, - ): Self::SystemData, - ) { - for (_entity, mut _character, _ability_action, _ability_pool) in ( - &entities, - &mut character_state_storage, - &ability_action_storage, - &ability_pool_storage, - ) - .join() - { - // match ability_action.0 { - // AbilityActionKind::Primary => { - // if let Some(AttackKind(Some(attack_kind))) = ability_pool.primary { - // character.action_state = Attack(attack_kind::default()); - // } - // } - // AbilityActionKind::Secondary => { - // if let Some(attack_kind) = ability_pool.secondary { - // character.action_state = Attack(attack_kind::default()); - // } - // } - // AbilityActionKind::Block => { - // if let Some(block_kind) = ability_pool.block { - // character.action_state = Block(block_kind::default()); - // } - // } - // AbilityActionKind::Dodge => { - // if let Some(dodge_kind) = ability_pool.dodge { - // character.action_state = Dodge(dodge_kind::default()); - // } - // } - // _ => {} - // } - } - } -} diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index c36aae2a1d..4d44334320 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - Body, CharacterState, Controller, EcsStateData, Mounting, Ori, PhysicsState, Pos, Stats, - Vel, + AbilityPool, Body, CharacterState, Controller, EcsStateData, Mounting, Ori, PhysicsState, + Pos, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -33,6 +33,7 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Stats>, ReadStorage<'a, Body>, ReadStorage<'a, PhysicsState>, + ReadStorage<'a, AbilityPool>, ReadStorage<'a, Uid>, ReadStorage<'a, Mounting>, ); @@ -53,11 +54,24 @@ impl<'a> System<'a> for Sys { stats, bodies, physics_states, + ability_pools, uids, mountings, ): Self::SystemData, ) { - for (entity, uid, mut character, pos, vel, ori, controller, stats, body, physics) in ( + for ( + entity, + uid, + character, + pos, + vel, + ori, + controller, + stats, + body, + physics, + ability_pool, + ) in ( &entities, &uids, &mut character_states, @@ -68,6 +82,7 @@ impl<'a> System<'a> for Sys { &stats, &bodies, &physics_states, + &ability_pools, ) .join() { @@ -91,7 +106,7 @@ impl<'a> System<'a> for Sys { return; } - let state_update = character.update(&EcsStateData { + let mut state_update = character.update(&EcsStateData { entity: &entity, uid, character, @@ -104,14 +119,15 @@ impl<'a> System<'a> for Sys { body, physics, updater: &updater, - server_bus: &server_bus, - local_bus: &local_bus, + ability_pool, }); *character = state_update.character; *pos = state_update.pos; *vel = state_update.vel; *ori = state_update.ori; + local_bus.emitter().append(&mut state_update.local_events); + server_bus.emitter().append(&mut state_update.server_events); } } } diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index f8b2fa5627..5d439228f7 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -1,4 +1,3 @@ -mod ability; pub mod agent; pub mod character_state; pub mod controller; @@ -11,7 +10,6 @@ mod stats; use specs::DispatcherBuilder; // System names -pub const ABILITY_SYS: &str = "ability_sys"; pub const CHARACTER_STATE_SYS: &str = "character_state_sys"; pub const AGENT_SYS: &str = "agent_sys"; pub const CONTROLLER_SYS: &str = "controller_sys"; @@ -27,7 +25,6 @@ pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS, MOUNT_SYS]); dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); dispatch_builder.add(stats::Sys, STATS_SYS, &[]); - dispatch_builder.add(ability::Sys, ABILITY_SYS, &[CHARACTER_STATE_SYS]); dispatch_builder.add(phys::Sys, PHYS_SYS, &[CONTROLLER_SYS, MOUNT_SYS, STATS_SYS]); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); } diff --git a/server/src/lib.rs b/server/src/lib.rs index 6bf0557244..7aca5346ed 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -267,6 +267,7 @@ impl Server { state.write_component(entity, comp::CharacterState::default()); state.write_component(entity, comp::Inventory::default()); state.write_component(entity, comp::InventoryUpdate); + state.write_component(entity, comp::AbilityPool::default()); // Make sure physics are accepted. state.write_component(entity, comp::ForceUpdate); @@ -1188,6 +1189,7 @@ impl StateExt for State { .with(comp::Energy::new(100)) .with(comp::Gravity(1.0)) .with(comp::CharacterState::default()) + .with(comp::AbilityPool::default()) } fn notify_registered_clients(&self, msg: ServerMsg) { diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index 320a07a4dd..57408df0bc 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -1,8 +1,8 @@ use super::SysTimer; use common::{ comp::{ - Body, CanBuild, Energy, Gravity, Item, LightEmitter, Mass, MountState, Mounting, Player, - Scale, Stats, Sticky, + AbilityPool, Body, CanBuild, Energy, Gravity, Item, LightEmitter, Mass, MountState, + Mounting, Player, Scale, Stats, Sticky, }, msg::EcsCompPacket, sync::{EntityPackage, SyncPackage, Uid, UpdateTracker, WorldSyncExt}, @@ -50,6 +50,7 @@ pub struct TrackedComps<'a> { pub mass: ReadStorage<'a, Mass>, pub sticky: ReadStorage<'a, Sticky>, pub gravity: ReadStorage<'a, Gravity>, + pub ability_pool: ReadStorage<'a, AbilityPool>, } impl<'a> TrackedComps<'a> { pub fn create_entity_package(&self, entity: EcsEntity) -> EntityPackage { @@ -103,6 +104,10 @@ impl<'a> TrackedComps<'a> { .get(entity) .copied() .map(|c| comps.push(c.into())); + self.ability_pool + .get(entity) + .copied() + .map(|c| comps.push(c.into())); EntityPackage { uid, comps } } @@ -123,6 +128,7 @@ pub struct ReadTrackers<'a> { pub mass: ReadExpect<'a, UpdateTracker>, pub sticky: ReadExpect<'a, UpdateTracker>, pub gravity: ReadExpect<'a, UpdateTracker>, + pub ability_pool: ReadExpect<'a, UpdateTracker>, } impl<'a> ReadTrackers<'a> { pub fn create_sync_package( @@ -150,6 +156,7 @@ impl<'a> ReadTrackers<'a> { .with_component(&comps.uid, &*self.mass, &comps.mass, filter) .with_component(&comps.uid, &*self.sticky, &comps.sticky, filter) .with_component(&comps.uid, &*self.gravity, &comps.gravity, filter) + .with_component(&comps.uid, &*self.ability_pool, &comps.ability_pool, filter) } } @@ -169,6 +176,7 @@ pub struct WriteTrackers<'a> { mass: WriteExpect<'a, UpdateTracker>, sticky: WriteExpect<'a, UpdateTracker>, gravity: WriteExpect<'a, UpdateTracker>, + ability_pool: WriteExpect<'a, UpdateTracker>, } fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) { @@ -187,6 +195,7 @@ fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) { trackers.mass.record_changes(&comps.mass); trackers.sticky.record_changes(&comps.sticky); trackers.gravity.record_changes(&comps.gravity); + trackers.ability_pool.record_changes(&comps.ability_pool); } pub fn register_trackers(world: &mut World) { @@ -204,6 +213,7 @@ pub fn register_trackers(world: &mut World) { world.register_tracker::(); world.register_tracker::(); world.register_tracker::(); + world.register_tracker::(); } /// Deleted entities grouped by region diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 7e9c0b3f37..bda3aefe89 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -331,12 +331,6 @@ impl FigureMgr { let mut state_animation_rate = 1.0; - let vel = ecs - .read_storage::() - .get(entity) - .cloned() - .unwrap_or_default(); - let active_tool_kind = if let Some(ItemKind::Tool(ToolData { kind, .. })) = stats .and_then(|s| s.equipment.main.as_ref()) .map(|i| &i.kind) @@ -407,6 +401,15 @@ impl FigureMgr { &mut state_animation_rate, skeleton_attr, ), + CharacterState::BasicAttack(_) => { + anim::character::AttackAnimation::update_skeleton( + &target_base, + (active_tool_kind, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + } /*CharacterState::Block(_) => { anim::character::BlockIdleAnimation::update_skeleton( &target_base, @@ -424,15 +427,6 @@ impl FigureMgr { &mut state_animation_rate, skeleton_attr, ) - } - CharacterState::BasicAttack(_) => { - anim::character::AttackAnimation::update_skeleton( - &target_base, - (active_tool_kind, time), - state.state_time, - &mut state_animation_rate, - skeleton_attr, - ) }*/ CharacterState::Wielding(_) => { anim::character::WieldAnimation::update_skeleton( From aeb37a1f33928a5a18102272f1514f6f368defbd Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 3 Feb 2020 20:43:36 +0100 Subject: [PATCH 035/387] improvement: char speed --- common/src/states/climb.rs | 10 ++-------- common/src/states/utils.rs | 27 +++++++++++++++------------ common/src/sys/phys.rs | 2 +- voxygen/src/anim/character/run.rs | 2 +- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index 08fe2742a6..a105a30323 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -27,19 +27,13 @@ impl StateHandler for State { }; // If no wall is in front of character ... - if let None = ecs_data.physics.on_wall { + if ecs_data.physics.on_wall.is_none() || ecs_data.physics.on_ground { if ecs_data.inputs.jump.is_pressed() { // They've climbed atop something, give them a boost //TODO: JUMP EVENT - } else { - // Just fall off - update.character = CharacterState::Idle(None); } - } - - // Remove climb state on ground, otherwise character will get stuck - if ecs_data.physics.on_ground { update.character = CharacterState::Idle(None); + return update; } // Move player diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index c0854f9d79..1f9c3b5e0b 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -6,23 +6,24 @@ use vek::vec::{Vec2, Vec3}; pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { let (accel, speed): (f32, f32) = if ecs_data.physics.on_ground { - let accel = 50.0; - let speed = 120.0; + let accel = 100.0; + let speed = 8.0; (accel, speed) } else { - let accel = 10.0; - let speed = 100.0; + let accel = 100.0; + let speed = 8.0; (accel, speed) }; // Move player according to move_dir - update.vel.0 += Vec2::broadcast(ecs_data.dt.0) - * ecs_data.inputs.move_dir - * if update.vel.0.magnitude_squared() < speed.powf(2.0) { - accel - } else { - 0.0 - }; + if update.vel.0.magnitude_squared() < speed.powf(2.0) { + update.vel.0 = + update.vel.0 + Vec2::broadcast(ecs_data.dt.0) * ecs_data.inputs.move_dir * accel; + let mag2 = update.vel.0.magnitude_squared(); + if mag2 > speed.powf(2.0) { + update.vel.0 = update.vel.0.normalized() * speed; + } + } // Set direction based on move direction let ori_dir = if update.character.is_attack() || update.character.is_block() { @@ -56,8 +57,10 @@ pub fn handle_sit(ecs_data: &EcsStateData, update: &mut StateUpdate) { } pub fn handle_climb(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if (ecs_data.inputs.climb.is_pressed() || ecs_data.inputs.climb_down.is_pressed()) + if (ecs_data.inputs.climb.is_just_pressed() || ecs_data.inputs.climb_down.is_pressed()) && ecs_data.physics.on_wall.is_some() + && !ecs_data.physics.on_ground + //&& update.vel.0.z < 0.0 && ecs_data.body.is_humanoid() { update.character = CharacterState::Climb(None); diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 955d229c22..1a72708302 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -11,7 +11,7 @@ use { vek::*, }; -pub const GRAVITY: f32 = 9.81 * 4.0; +pub const GRAVITY: f32 = 9.81 * 7.0; const BOUYANCY: f32 = 0.0; // Friction values used for linear damping. They are unitless quantities. The // value of these quantities must be between zero and one. They represent the diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index f70fbbb5ec..26565dfb78 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -27,7 +27,7 @@ impl Animation for RunAnimation { let constant = 1.0; let wave = (((5.0) - / (1.1 + 3.9 * ((anim_time as f32 * constant as f32 * 1.2).sin()).powf(2.0 as f32))) + / (1.1 + 3.9 * ((anim_time as f32 * constant as f32 * 4.2).sin()).powf(2.0 as f32))) .sqrt()) * ((anim_time as f32 * constant as f32 * 1.2).sin()); let wave_cos = (((5.0) From d383abf9501fd6c6fdad5c89b9c8d834da0bf713 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Tue, 11 Feb 2020 07:42:17 -0800 Subject: [PATCH 036/387] Re add combat --- common/src/comp/character_state.rs | 33 +++++- common/src/comp/mod.rs | 2 +- common/src/msg/ecs_packet.rs | 9 +- common/src/state.rs | 1 + common/src/states/basic_attack.rs | 43 +++++--- common/src/states/mod.rs | 49 ++------- common/src/states/utils.rs | 13 ++- common/src/sys/combat.rs | 168 +++++++++++------------------ common/src/sys/mod.rs | 3 + 9 files changed, 146 insertions(+), 175 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index df36c541df..a0783bae05 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,13 +1,13 @@ use crate::{ - comp::{AbilityPool, Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, Vel}, + comp::{AbilityPool, Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, ToolData, Vel}, event::{LocalEvent, ServerEvent}, state::DeltaTime, states::*, sync::Uid, }; use serde::{Deserialize, Serialize}; -use specs::{Component, Entity, FlaggedStorage, HashMapStorage, LazyUpdate}; -use std::collections::VecDeque; +use specs::{Component, Entity, FlaggedStorage, HashMapStorage, LazyUpdate, VecStorage}; +use std::{collections::VecDeque, time::Duration}; pub struct EcsStateData<'a> { pub entity: &'a Entity, @@ -127,3 +127,30 @@ impl Default for CharacterState { impl Component for CharacterState { type Storage = FlaggedStorage>; } + +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] +pub struct Attacking { + pub weapon: ToolData, + pub time_active: Duration, +} + +impl Attacking { + pub fn remaining_duration(&self) -> Duration { + self.weapon + .attack_duration() + .checked_sub(self.time_active) + .unwrap_or_default() + } + + pub fn tick_time_active(&mut self, dt: Duration) { + self.time_active = self.time_active.checked_add(dt).unwrap_or_default(); + } + + pub fn can_apply_damage(&self) -> bool { + (self.time_active > self.weapon.attack_buildup_duration()) + } +} + +impl Component for Attacking { + type Storage = VecStorage; +} diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 1be4ed8a07..eb8f6cda25 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -23,7 +23,7 @@ pub use body::{ biped_large, bird_medium, bird_small, critter, dragon, fish_medium, fish_small, humanoid, object, quadruped_medium, quadruped_small, AllBodies, Body, BodyData, }; -pub use character_state::{CharacterState, EcsStateData, StateUpdate}; +pub use character_state::{Attacking, CharacterState, EcsStateData, StateUpdate}; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, Mounting, diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index b8a9df7256..57496dda0f 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -23,6 +23,7 @@ sum_type! { Sticky(comp::Sticky), AbilityAction(comp::AbilityAction), AbilityPool(comp::AbilityPool), + Attacking(comp::Attacking), } } // Automatically derive From for EcsCompPhantom @@ -45,6 +46,7 @@ sum_type! { Sticky(PhantomData), AbilityAction(PhantomData), AbilityPool(PhantomData), + Attacking(PhantomData), } } impl sync::CompPacket for EcsCompPacket { @@ -67,6 +69,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::AbilityAction(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Attacking(comp) => sync::handle_insert(comp, entity, world), } } @@ -87,6 +90,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::AbilityAction(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Attacking(comp) => sync::handle_modify(comp, entity, world), } } @@ -109,10 +113,11 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPhantom::Sticky(_) => sync::handle_remove::(entity, world), EcsCompPhantom::AbilityAction(_) => { sync::handle_remove::(entity, world) - } + }, EcsCompPhantom::AbilityPool(_) => { sync::handle_remove::(entity, world) - } + }, + EcsCompPhantom::Attacking(_) => sync::handle_remove::(entity, world), } } } diff --git a/common/src/state.rs b/common/src/state.rs index 13c3e55e3d..3064a58553 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -122,6 +122,7 @@ impl State { ecs.register::(); ecs.register::(); ecs.register::(); + ecs.register::(); // Register components send from clients -> server ecs.register::(); diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index c264c54656..ba300b7b55 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -1,13 +1,15 @@ -use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; -use crate::states::StateHandler; -use std::collections::VecDeque; - -use std::time::Duration; +use crate::{ + comp::{Attacking, CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, + states::{utils, StateHandler}, +}; +use std::{collections::VecDeque, time::Duration}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State { /// How long the state has until exitting pub remaining_duration: Duration, + ///Whether damage can be applied + pub can_apply_damage: bool, } impl StateHandler for State { @@ -20,6 +22,7 @@ impl StateHandler for State { }; Self { remaining_duration: tool_data.attack_duration(), + can_apply_damage: false, } } @@ -33,18 +36,26 @@ impl StateHandler for State { server_events: VecDeque::new(), }; - // Tick down remaining_duration - update.character = CharacterState::BasicAttack(Some(State { - remaining_duration: self - .remaining_duration - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) - .unwrap_or_default(), - })); + // // Tick down + // update.character = CharacterState::BasicAttack(Some(State { + // remaining_duration: self + // .remaining_duration + // .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + // .unwrap_or_default(), + // can_apply_damage: if let Some(Tool(data)) = + // ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) + // { + // (self.remaining_duration < data.attack_recover_duration()) + // } else { + // false + // }, + // })); - // Check if attack duration has expired - if self.remaining_duration == Duration::default() { - update.character = CharacterState::Wielded(None); - } + // // Check if attack duration has expired + // if self.remaining_duration == Duration::default() { + // update.character = CharacterState::Wielded(None); + // ecs_data.updater.remove::(*ecs_data.entity); + // } update } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 1296526477..e917b855b1 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -13,49 +13,14 @@ use crate::comp::{EcsStateData, StateUpdate}; /// ## A type for implementing State Handling Behavior. /// -/// Called by state machines' update functions to allow current states to handle updating -/// their parent machine's current state. +/// Called by state machines' update functions to allow current states to handle +/// updating their parent machine's current state. /// -/// Structures must implement a `handle()` fn to handle update behavior, and a `new()` for -/// instantiating new instances of a state. `handle()` function recieves `EcsStateData`, a struct -/// of readonly ECS Component data, and returns a `StateUpdate` tuple, with new components that will -/// overwrite an entitie's old components. -/// -/// ## Example Implementation: -/// ``` -/// use crate::states::utils; -/// -/// #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -/// pub struct RunState { -/// active_duration: Duration, -/// } -/// -/// impl StateHandler for RunState { -/// fn new(ecs_data: &EcsStateData) -> Self { -/// Self { -/// active_duration: Duration::default(), -/// } -/// } -/// -/// fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { -/// let mut update = StateUpdate { -/// character: *ecs_data.character, -/// pos: *ecs_data.pos, -/// vel: *ecs_data.vel, -/// ori: *ecs_data.ori, -/// }; -/// -/// // -- snip -- -/// // Updates; checks for gliding, climbing, etc. -/// -/// // Update based on groundedness -/// update.character.move_state = -/// utils::determine_move_from_grounded_state(ecs_data.physics, ecs_data.inputs); -/// -/// update -/// } -/// } -/// ``` +/// Structures must implement a `handle()` fn to handle update behavior, and a +/// `new()` for instantiating new instances of a state. `handle()` function +/// recieves `EcsStateData`, a struct of readonly ECS Component data, and +/// returns a `StateUpdate` tuple, with new components that will overwrite an +/// entitie's old components. pub trait StateHandler: Default { fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; fn new(ecs_data: &EcsStateData) -> Self; diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 1f9c3b5e0b..1abf09080a 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,7 +1,8 @@ use crate::{ - comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate}, + comp::{Attacking, CharacterState, EcsStateData, ItemKind::Tool, StateUpdate}, event::LocalEvent, }; +use std::time::Duration; use vek::vec::{Vec2, Vec3}; pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { @@ -96,9 +97,13 @@ pub fn handle_jump(ecs_data: &EcsStateData, update: &mut StateUpdate) { pub fn handle_primary(ecs_data: &EcsStateData, update: &mut StateUpdate) { if let Some(state) = ecs_data.ability_pool.primary { - if let CharacterState::Wielded(_) = update.character { - if ecs_data.inputs.primary.is_pressed() { - update.character = state; + if ecs_data.inputs.primary.is_pressed() { + update.character = state; + if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { + ecs_data.updater.insert(*ecs_data.entity, Attacking { + weapon: data, + time_active: Duration::default(), + }); } } } diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 36fc603e58..63e8c7c303 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - ActionState::*, Body, CharacterState, Controller, HealthChange, HealthSource, Item, - ItemKind, Ori, Pos, Scale, Stats, + Attacking, Body, CharacterState, Controller, HealthChange, HealthSource, Item, ItemKind, + Ori, Pos, Scale, Stats, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -33,6 +33,7 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Controller>, ReadStorage<'a, Body>, ReadStorage<'a, Stats>, + WriteStorage<'a, Attacking>, WriteStorage<'a, CharacterState>, ); @@ -50,14 +51,12 @@ impl<'a> System<'a> for Sys { controllers, bodies, stats, + mut attacking_storage, mut character_states, ): Self::SystemData, ) { - // let mut server_emitter = server_bus.emitter(); - // let mut _local_emitter = local_bus.emitter(); - // Attacks - for (entity, uid, pos, ori, scale_maybe, _, attacker_stats) in ( + for (entity, uid, pos, ori, scale_maybe, _, attacker_stats, attack) in ( &entities, &uids, &positions, @@ -65,115 +64,70 @@ impl<'a> System<'a> for Sys { scales.maybe(), &controllers, &stats, + &mut attacking_storage, ) .join() { - let recover_duration = if let Some(Item { - kind: ItemKind::Tool { kind, .. }, - .. - }) = attacker_stats.equipment.main - { - kind.attack_recover_duration() - } else { - Duration::from_millis(250) - }; + attack.tick_time_active(Duration::from_secs_f32(dt.0)); - // let (deal_damage, should_end) = if let Some(Attack { time_left, applied }) = - // &mut character_states.get_mut(entity).map(|c| &mut c.action) - // { - // *time_left = time_left - // .checked_sub(Duration::from_secs_f32(dt.0)) - // .unwrap_or_default(); - // if !*applied && recover_duration > *time_left { - // *applied = true; - // (true, false) - // } else if *time_left == Duration::default() { - // (false, true) - // } else { - // (false, false) - // } - // } else { - // (false, false) - // }; + if attack.can_apply_damage() { + // Go through all other entities + for (b, uid_b, pos_b, ori_b, scale_b_maybe, character_b, stats_b, body_b) in ( + &entities, + &uids, + &positions, + &orientations, + scales.maybe(), + &character_states, + &stats, + &bodies, + ) + .join() + { + // 2D versions + let pos2 = Vec2::from(pos.0); + let pos_b2: Vec2 = Vec2::from(pos_b.0); + let ori2 = Vec2::from(ori.0); - // if deal_damage { - // if let Some(Attack { .. }) = &character_states.get(entity).map(|c| c.action) { - // // Go through all other entities - // for (b, uid_b, pos_b, ori_b, scale_b_maybe, character_b, stats_b, body_b) in ( - // &entities, - // &uids, - // &positions, - // &orientations, - // scales.maybe(), - // &character_states, - // &stats, - // &bodies, - // ) - // .join() - // { - // // 2D versions - // let pos2 = Vec2::from(pos.0); - // let pos_b2: Vec2 = Vec2::from(pos_b.0); - // let ori2 = Vec2::from(ori.0); + // Scales + let scale = scale_maybe.map_or(1.0, |s| s.0); + let scale_b = scale_b_maybe.map_or(1.0, |s| s.0); + let rad_b = body_b.radius() * scale_b; - // // Scales - // let scale = scale_maybe.map_or(1.0, |s| s.0); - // let scale_b = scale_b_maybe.map_or(1.0, |s| s.0); - // let rad_b = body_b.radius() * scale_b; + // Check if it is a hit + if entity != b + && !stats_b.is_dead + // Spherical wedge shaped attack field + && pos.0.distance_squared(pos_b.0) < (rad_b + scale * ATTACK_RANGE).powi(2) + && ori2.angle_between(pos_b2 - pos2) < ATTACK_ANGLE.to_radians() / 2.0 + (rad_b / pos2.distance(pos_b2)).atan() + { + // Weapon gives base damage + let mut dmg = attack.weapon.base_damage as i32; - // // Check if it is a hit - // if entity != b - // && !stats_b.is_dead - // // Spherical wedge shaped attack field - // && pos.0.distance_squared(pos_b.0) < (rad_b + scale * ATTACK_RANGE).powi(2) - // && ori2.angle_between(pos_b2 - pos2) < ATTACK_ANGLE.to_radians() / 2.0 + (rad_b / pos2.distance(pos_b2)).atan() - // { - // // Weapon gives base damage - // let mut dmg = if let Some(ItemKind::Tool { power, .. }) = - // attacker_stats.equipment.main.as_ref().map(|i| &i.kind) - // { - // *power as i32 - // } else { - // 1 - // }; + // Block + if character_b.is_block() + && ori_b.0.angle_between(pos.0 - pos_b.0) + < BLOCK_ANGLE.to_radians() / 2.0 + { + dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 + } - // // Block - // if character_b.action.is_block() - // && ori_b.0.angle_between(pos.0 - pos_b.0) - // < BLOCK_ANGLE.to_radians() / 2.0 - // { - // dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 - // } + server_bus.emitter().emit(ServerEvent::Damage { + uid: *uid_b, + change: HealthChange { + amount: -dmg, + cause: HealthSource::Attack { by: *uid }, + }, + }); + } + } + } - // server_emitter.emit(ServerEvent::Damage { - // uid: *uid_b, - // change: HealthChange { - // amount: -dmg, - // cause: HealthSource::Attack { by: *uid }, - // }, - // }); - // } - // } - // } - // } - - // if should_end { - // if let Some(character) = &mut character_states.get_mut(entity) { - // character.action = Wield { - // time_left: Duration::default(), - // }; - // } - // } - - // if let Some(Wield { time_left }) = - // &mut character_states.get_mut(entity).map(|c| &mut c.action) - // { - // if *time_left != Duration::default() { - // *time_left = time_left - // .checked_sub(Duration::from_secs_f32(dt.0)) - // .unwrap_or_default(); - // } - // } - // } + if attack.remaining_duration() == Duration::default() { + if let Some(character) = character_states.get_mut(entity) { + *character = CharacterState::Wielded(None); + } + } + } } } diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index 56eb836ee0..6deb55ff11 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -1,5 +1,6 @@ pub mod agent; pub mod character_state; +mod combat; pub mod controller; mod mount; pub mod phys; @@ -11,6 +12,7 @@ use specs::DispatcherBuilder; // System names pub const CHARACTER_STATE_SYS: &str = "character_state_sys"; +pub const COMBAT_SYS: &str = "combat_sys"; pub const AGENT_SYS: &str = "agent_sys"; pub const CONTROLLER_SYS: &str = "controller_sys"; pub const MOUNT_SYS: &str = "mount_sys"; @@ -26,4 +28,5 @@ pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(stats::Sys, STATS_SYS, &[]); dispatch_builder.add(phys::Sys, PHYS_SYS, &[CONTROLLER_SYS, MOUNT_SYS, STATS_SYS]); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); + dispatch_builder.add(combat::Sys, COMBAT_SYS, &[PROJECTILE_SYS]); } From 7bc719e33fadc3172c6ab622443af61d25bbdeae Mon Sep 17 00:00:00 2001 From: Julian Date: Sat, 22 Feb 2020 20:26:49 +0100 Subject: [PATCH 037/387] UpdatedSoundFX New souunds for Sword_in and Sword_out. --- assets/voxygen/audio/sfx/weapon/sword_in.wav | 4 ++-- assets/voxygen/audio/sfx/weapon/sword_out.wav | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/voxygen/audio/sfx/weapon/sword_in.wav b/assets/voxygen/audio/sfx/weapon/sword_in.wav index eb5a2ea8fa..24061231f9 100644 --- a/assets/voxygen/audio/sfx/weapon/sword_in.wav +++ b/assets/voxygen/audio/sfx/weapon/sword_in.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2c3c0a27e129f9d7274e332b30aa59ac8d78401587f582c9d2fa2a8f06b8c292 -size 87596 +oid sha256:181cb4e801f82a55ad1916b861dfc1dc14f56b2716841bf94f320eadda41c8d1 +size 44272 diff --git a/assets/voxygen/audio/sfx/weapon/sword_out.wav b/assets/voxygen/audio/sfx/weapon/sword_out.wav index f16fdbf6b5..4233e07a57 100644 --- a/assets/voxygen/audio/sfx/weapon/sword_out.wav +++ b/assets/voxygen/audio/sfx/weapon/sword_out.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c882be88cd3f2528ba167054b1a98ea5386f420d96dc8ab9340a2adf1b02e7cc -size 64556 +oid sha256:6026f1942a4b6e5dcda65a5984debdf9e025bf98ea30a282f9f7c3ba5c78be5b +size 48620 From f73b5b2fcb62927f5b6303d50d65a88a5cdf6ab8 Mon Sep 17 00:00:00 2001 From: Shane Handley Date: Sun, 23 Feb 2020 09:08:30 +0900 Subject: [PATCH 038/387] Update max hp and refill health when a player uses the set_level command. --- server/src/cmd.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 872f6bec35..1f46109481 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -1079,6 +1079,11 @@ fn handle_level(server: &mut Server, entity: EcsEntity, args: String, action: &C Ok(player) => { if let Some(stats) = ecs.write_storage::().get_mut(player) { stats.level.set_level(lvl); + + stats.update_max_hp(); + stats + .health + .set_to(stats.health.maximum(), comp::HealthSource::LevelUp); } else { error_msg = Some(ServerMsg::private(String::from("Player has no stats!"))); } From d87061fe145e6ba28efe8239b481a28fae55942b Mon Sep 17 00:00:00 2001 From: S Handley Date: Sun, 23 Feb 2020 01:26:51 +0000 Subject: [PATCH 039/387] Add a volume option to SfxEvents, and use this to dispatch movement sfx for quadripeds at a volume proportionate to their size. --- CHANGELOG.md | 1 + common/src/event.rs | 13 +++++- voxygen/src/audio/mod.rs | 9 ++-- .../audio/sfx/event_mapper/movement/mod.rs | 44 ++++++++++++++++--- .../audio/sfx/event_mapper/movement/tests.rs | 39 +++++++++++++++- voxygen/src/audio/sfx/mod.rs | 2 +- 6 files changed, 94 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 086125408c..055492a259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Brighter / higher contrast main-map - Removed highlighting of non-collectible sprites - Fixed /give_exp ignoring player argument +- Extend run sfx to small animals to prevent sneak attacks by geese. ### Removed diff --git a/common/src/event.rs b/common/src/event.rs index d06f912a7b..6ac5e49531 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -9,12 +9,21 @@ use vek::*; pub struct SfxEventItem { pub sfx: SfxEvent, pub pos: Option>, + pub vol: Option, } impl SfxEventItem { - pub fn new(sfx: SfxEvent, pos: Option>) -> Self { Self { sfx, pos } } + pub fn new(sfx: SfxEvent, pos: Option>, vol: Option) -> Self { + Self { sfx, pos, vol } + } - pub fn at_player_position(sfx: SfxEvent) -> Self { Self { sfx, pos: None } } + pub fn at_player_position(sfx: SfxEvent) -> Self { + Self { + sfx, + pos: None, + vol: None, + } + } } #[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] diff --git a/voxygen/src/audio/mod.rs b/voxygen/src/audio/mod.rs index 53ef2965df..1709649c89 100644 --- a/voxygen/src/audio/mod.rs +++ b/voxygen/src/audio/mod.rs @@ -10,7 +10,7 @@ use soundcache::SoundCache; use common::assets; use cpal::traits::DeviceTrait; -use rodio::{Decoder, Device}; +use rodio::{source::Source, Decoder, Device}; use vek::*; const FALLOFF: f32 = 0.13; @@ -135,11 +135,14 @@ impl AudioFrontend { self.music_channels.last_mut() } - pub fn play_sfx(&mut self, sound: &str, pos: Vec3) { + pub fn play_sfx(&mut self, sound: &str, pos: Vec3, vol: Option) { if self.audio_device.is_some() { let calc_pos = ((pos - self.listener_pos) * FALLOFF).into_array(); - let sound = self.sound_cache.load_sound(sound); + let sound = self + .sound_cache + .load_sound(sound) + .amplify(vol.unwrap_or(1.0)); let left_ear = self.listener_ear_left.into_array(); let right_ear = self.listener_ear_right.into_array(); diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 8c4581c00c..0b0294ecec 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -32,7 +32,7 @@ impl MovementEventMapper { } pub fn maintain(&mut self, client: &Client, triggers: &SfxTriggers) { - const SFX_DIST_LIMIT_SQR: f32 = 22500.0; + const SFX_DIST_LIMIT_SQR: f32 = 20000.0; let ecs = client.state().ecs(); let player_position = ecs @@ -65,18 +65,25 @@ impl MovementEventMapper { let mapped_event = match body { Body::Humanoid(_) => Self::map_movement_event(character, state, vel.0, stats), - Body::QuadrupedMedium(_) => { - // TODO: Quadriped running sfx - SfxEvent::Idle + Body::QuadrupedMedium(_) + | Body::QuadrupedSmall(_) + | Body::BirdMedium(_) + | Body::BirdSmall(_) + | Body::BipedLarge(_) => { + Self::map_non_humanoid_movement_event(character, vel.0) }, - _ => SfxEvent::Idle, + _ => SfxEvent::Idle, // Ignore fish, critters, etc... }; // Check for SFX config entry for this movement if Self::should_emit(state, triggers.get_key_value(&mapped_event)) { ecs.read_resource::>() .emitter() - .emit(SfxEventItem::new(mapped_event, Some(pos.0))); + .emit(SfxEventItem::new( + mapped_event, + Some(pos.0), + Some(Self::get_volume_for_body_type(body)), + )); // Update the last play time state.event = mapped_event; @@ -99,7 +106,7 @@ impl MovementEventMapper { /// they have not triggered an event for > n seconds. This prevents /// stale records from bloating the Map size. fn cleanup(&mut self, player: EcsEntity) { - const TRACKING_TIMEOUT: u64 = 15; + const TRACKING_TIMEOUT: u64 = 10; let now = Instant::now(); self.event_history.retain(|entity, event| { @@ -197,11 +204,34 @@ impl MovementEventMapper { } } + /// Maps a limited set of movements for other non-humanoid entities + fn map_non_humanoid_movement_event(current_event: &CharacterState, vel: Vec3) -> SfxEvent { + if current_event.movement == MovementState::Run && vel.magnitude() > 0.1 { + SfxEvent::Run + } else { + SfxEvent::Idle + } + } + /// Returns true for any state where the player has their weapon drawn. This /// helps us manage the wield/unwield sfx events fn has_weapon_drawn(state: ActionState) -> bool { state.is_wield() | state.is_attack() | state.is_block() | state.is_charge() } + + /// Returns a relative volume value for a body type. This helps us emit sfx + /// at a volume appropriate fot the entity we are emitting the event for + fn get_volume_for_body_type(body: &Body) -> f32 { + match body { + Body::Humanoid(_) => 0.9, + Body::QuadrupedSmall(_) => 0.3, + Body::QuadrupedMedium(_) => 0.7, + Body::BirdMedium(_) => 0.3, + Body::BirdSmall(_) => 0.2, + Body::BipedLarge(_) => 1.0, + _ => 0.9, + } + } } #[cfg(test)] mod tests; diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 210f7fe2c1..251efba8a5 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -1,7 +1,10 @@ use super::*; use common::{ assets, - comp::{humanoid, item::Tool, ActionState, Body, MovementState, Stats}, + comp::{ + bird_small, humanoid, item::Tool, quadruped_medium, quadruped_small, ActionState, Body, + MovementState, Stats, + }, event::SfxEvent, }; use std::time::{Duration, Instant}; @@ -417,3 +420,37 @@ fn does_not_map_wield_when_no_main_weapon() { assert_eq!(result, SfxEvent::Run); } + +#[test] +fn maps_quadrupeds_running() { + let result = MovementEventMapper::map_non_humanoid_movement_event( + &CharacterState { + movement: MovementState::Run, + action: ActionState::Idle, + }, + Vec3::new(0.5, 0.8, 0.0), + ); + + assert_eq!(result, SfxEvent::Run); +} + +#[test] +fn determines_relative_volumes() { + let human = + MovementEventMapper::get_volume_for_body_type(&Body::Humanoid(humanoid::Body::random())); + + let quadruped_medium = MovementEventMapper::get_volume_for_body_type(&Body::QuadrupedMedium( + quadruped_medium::Body::random(), + )); + + let quadruped_small = MovementEventMapper::get_volume_for_body_type(&Body::QuadrupedSmall( + quadruped_small::Body::random(), + )); + + let bird_small = + MovementEventMapper::get_volume_for_body_type(&Body::BirdSmall(bird_small::Body::random())); + + assert!(quadruped_medium < human); + assert!(quadruped_small < quadruped_medium); + assert!(bird_small < quadruped_small); +} diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 65231f5758..2af778a0ef 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -91,7 +91,7 @@ impl SfxMgr { }, }; - audio.play_sfx(sfx_file, position); + audio.play_sfx(sfx_file, position, event.vol); } } } From 1f4065ae3258d1436d83e748378bdc38f89b8efa Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 24 Feb 2020 14:32:12 +0100 Subject: [PATCH 040/387] fix: attacking --- common/src/comp/character_state.rs | 18 ------ common/src/states/basic_attack.rs | 62 +++++++++++++------- common/src/states/utils.rs | 10 +--- common/src/sys/combat.rs | 94 +++++++++++++----------------- 4 files changed, 85 insertions(+), 99 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index a0783bae05..417e49b042 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -131,24 +131,6 @@ impl Component for CharacterState { #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct Attacking { pub weapon: ToolData, - pub time_active: Duration, -} - -impl Attacking { - pub fn remaining_duration(&self) -> Duration { - self.weapon - .attack_duration() - .checked_sub(self.time_active) - .unwrap_or_default() - } - - pub fn tick_time_active(&mut self, dt: Duration) { - self.time_active = self.time_active.checked_add(dt).unwrap_or_default(); - } - - pub fn can_apply_damage(&self) -> bool { - (self.time_active > self.weapon.attack_buildup_duration()) - } } impl Component for Attacking { diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index ba300b7b55..91eaabc790 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -8,8 +8,8 @@ use std::{collections::VecDeque, time::Duration}; pub struct State { /// How long the state has until exitting pub remaining_duration: Duration, - ///Whether damage can be applied - pub can_apply_damage: bool, + /// Whether the attack can deal more damage + pub exhausted: bool, } impl StateHandler for State { @@ -22,7 +22,7 @@ impl StateHandler for State { }; Self { remaining_duration: tool_data.attack_duration(), - can_apply_damage: false, + exhausted: false, } } @@ -36,26 +36,44 @@ impl StateHandler for State { server_events: VecDeque::new(), }; - // // Tick down - // update.character = CharacterState::BasicAttack(Some(State { - // remaining_duration: self - // .remaining_duration - // .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) - // .unwrap_or_default(), - // can_apply_damage: if let Some(Tool(data)) = - // ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) - // { - // (self.remaining_duration < data.attack_recover_duration()) - // } else { - // false - // }, - // })); + let tool_kind = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind); - // // Check if attack duration has expired - // if self.remaining_duration == Duration::default() { - // update.character = CharacterState::Wielded(None); - // ecs_data.updater.remove::(*ecs_data.entity); - // } + let can_apply_damage = !self.exhausted + && if let Some(Tool(data)) = tool_kind { + (self.remaining_duration < data.attack_recover_duration()) + } else { + false + }; + + let mut exhausted = self.exhausted; + + if can_apply_damage { + if let Some(Tool(data)) = tool_kind { + ecs_data + .updater + .insert(*ecs_data.entity, Attacking { weapon: data }); + exhausted = true; + } + } else { + ecs_data.updater.remove::(*ecs_data.entity); + } + + let remaining_duration = self + .remaining_duration + .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + .unwrap_or_default(); + + // Tick down + update.character = CharacterState::BasicAttack(Some(State { + remaining_duration, + exhausted, + })); + + // Check if attack duration has expired + if remaining_duration == Duration::default() { + update.character = CharacterState::Wielded(None); + ecs_data.updater.remove::(*ecs_data.entity); + } update } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 1abf09080a..d430afdec8 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -97,13 +97,9 @@ pub fn handle_jump(ecs_data: &EcsStateData, update: &mut StateUpdate) { pub fn handle_primary(ecs_data: &EcsStateData, update: &mut StateUpdate) { if let Some(state) = ecs_data.ability_pool.primary { - if ecs_data.inputs.primary.is_pressed() { - update.character = state; - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - ecs_data.updater.insert(*ecs_data.entity, Attacking { - weapon: data, - time_active: Duration::default(), - }); + if let CharacterState::Wielded(_) = update.character { + if ecs_data.inputs.primary.is_pressed() { + update.character = state; } } } diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 63e8c7c303..d8d894a968 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -68,66 +68,56 @@ impl<'a> System<'a> for Sys { ) .join() { - attack.tick_time_active(Duration::from_secs_f32(dt.0)); + // Go through all other entities + for (b, uid_b, pos_b, ori_b, scale_b_maybe, character_b, stats_b, body_b) in ( + &entities, + &uids, + &positions, + &orientations, + scales.maybe(), + &character_states, + &stats, + &bodies, + ) + .join() + { + // 2D versions + let pos2 = Vec2::from(pos.0); + let pos_b2: Vec2 = Vec2::from(pos_b.0); + let ori2 = Vec2::from(ori.0); - if attack.can_apply_damage() { - // Go through all other entities - for (b, uid_b, pos_b, ori_b, scale_b_maybe, character_b, stats_b, body_b) in ( - &entities, - &uids, - &positions, - &orientations, - scales.maybe(), - &character_states, - &stats, - &bodies, - ) - .join() + // Scales + let scale = scale_maybe.map_or(1.0, |s| s.0); + let scale_b = scale_b_maybe.map_or(1.0, |s| s.0); + let rad_b = body_b.radius() * scale_b; + + // Check if it is a hit + if entity != b + && !stats_b.is_dead + // Spherical wedge shaped attack field + && pos.0.distance_squared(pos_b.0) < (rad_b + scale * ATTACK_RANGE).powi(2) + && ori2.angle_between(pos_b2 - pos2) < ATTACK_ANGLE.to_radians() / 2.0 + (rad_b / pos2.distance(pos_b2)).atan() { - // 2D versions - let pos2 = Vec2::from(pos.0); - let pos_b2: Vec2 = Vec2::from(pos_b.0); - let ori2 = Vec2::from(ori.0); + // Weapon gives base damage + let mut dmg = attack.weapon.base_damage as i32; - // Scales - let scale = scale_maybe.map_or(1.0, |s| s.0); - let scale_b = scale_b_maybe.map_or(1.0, |s| s.0); - let rad_b = body_b.radius() * scale_b; - - // Check if it is a hit - if entity != b - && !stats_b.is_dead - // Spherical wedge shaped attack field - && pos.0.distance_squared(pos_b.0) < (rad_b + scale * ATTACK_RANGE).powi(2) - && ori2.angle_between(pos_b2 - pos2) < ATTACK_ANGLE.to_radians() / 2.0 + (rad_b / pos2.distance(pos_b2)).atan() + // Block + if character_b.is_block() + && ori_b.0.angle_between(pos.0 - pos_b.0) < BLOCK_ANGLE.to_radians() / 2.0 { - // Weapon gives base damage - let mut dmg = attack.weapon.base_damage as i32; - - // Block - if character_b.is_block() - && ori_b.0.angle_between(pos.0 - pos_b.0) - < BLOCK_ANGLE.to_radians() / 2.0 - { - dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 - } - - server_bus.emitter().emit(ServerEvent::Damage { - uid: *uid_b, - change: HealthChange { - amount: -dmg, - cause: HealthSource::Attack { by: *uid }, - }, - }); + dmg = (dmg as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 } - } - } - if attack.remaining_duration() == Duration::default() { - if let Some(character) = character_states.get_mut(entity) { - *character = CharacterState::Wielded(None); + server_bus.emitter().emit(ServerEvent::Damage { + uid: *uid_b, + change: HealthChange { + amount: -dmg, + cause: HealthSource::Attack { by: *uid }, + }, + }); } } } + attacking_storage.clear(); } } From 2fa902270ea4ce97ff7db3117b65fcf5a5119e9b Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 24 Feb 2020 15:35:07 +0100 Subject: [PATCH 041/387] fix: block --- common/src/comp/ability.rs | 6 ++--- common/src/comp/character_state.rs | 12 +++++----- common/src/states/basic_block.rs | 36 ++++++++---------------------- common/src/states/mod.rs | 1 + common/src/states/utils.rs | 10 +++++++++ common/src/states/wielded.rs | 10 +++++---- voxygen/src/scene/figure/cache.rs | 6 ++--- voxygen/src/scene/figure/mod.rs | 7 +++--- voxygen/src/session.rs | 14 +----------- 9 files changed, 42 insertions(+), 60 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index f944b05b8d..39be87db17 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -10,9 +10,7 @@ pub enum AbilityActionKind { // UpdatePool? } impl Default for AbilityActionKind { - fn default() -> Self { - Self::Primary - } + fn default() -> Self { Self::Primary } } #[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct AbilityAction(pub AbilityActionKind); @@ -33,7 +31,7 @@ impl Default for AbilityPool { fn default() -> Self { Self { primary: Some(comp::CharacterState::BasicAttack(None)), - secondary: None, + secondary: Some(comp::CharacterState::BasicBlock(None)), block: None, dodge: Some(comp::CharacterState::Roll(None)), } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 417e49b042..6cd5178a20 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -43,7 +43,7 @@ pub enum CharacterState { Wielded(Option), Glide(Option), BasicAttack(Option), - //BasicBlock(Option), + BasicBlock(Option), //Charge(Option), Roll(Option), } @@ -58,7 +58,7 @@ impl CharacterState { pub fn is_block(&self) -> bool { match self { - //CharacterState::BasicBlock(_) => true, + CharacterState::BasicBlock(_) => true, _ => false, } } @@ -102,12 +102,12 @@ impl CharacterState { CharacterState::BasicAttack(opt_state) => opt_state .unwrap_or_else(|| basic_attack::State::new(ecs_data)) .handle(ecs_data), - /*CharacterState::Charge(opt_state) => opt_state - .unwrap_or_else(|| charge_attack::State::new(ecs_data)) - .handle(ecs_data), CharacterState::BasicBlock(opt_state) => opt_state .unwrap_or_else(|| basic_block::State::new(ecs_data)) - .handle(ecs_data),*/ + .handle(ecs_data), + /*CharacterState::Charge(opt_state) => opt_state + .unwrap_or_else(|| charge_attack::State::new(ecs_data)) + .handle(ecs_data),*/ CharacterState::Roll(opt_state) => opt_state .unwrap_or_else(|| roll::State::new(ecs_data)) .handle(ecs_data), diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index 4952691d72..e3ee63f18f 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -1,24 +1,19 @@ use super::utils::*; -use crate::comp::{EcsStateData, StateUpdate}; -use crate::states::StateHandler; -use std::time::Duration; +use crate::{ + comp::{EcsStateData, StateUpdate}, + states::StateHandler, +}; +use std::{collections::VecDeque, time::Duration}; use vek::Vec2; const BLOCK_ACCEL: f32 = 30.0; const BLOCK_SPEED: f32 = 75.0; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State { - /// How long the blocking state has been active - pub active_duration: Duration, -} +pub struct State {} impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self { - active_duration: Duration::default(), - } - } + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { @@ -26,23 +21,10 @@ impl StateHandler for State { vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; - // TODO: Apply simple move speed debuff instead - - // Update movement - update.vel.0 += Vec2::broadcast(ecs_data.dt.0) - * ecs_data.inputs.move_dir - * match ecs_data.physics.on_ground { - true if update.vel.0.magnitude_squared() < BLOCK_SPEED.powf(2.0) => BLOCK_ACCEL, - _ => 0.0, - }; - - if !ecs_data.inputs.secondary.is_pressed() { - update.character.action_state = attempt_wield(ecs_data.stats); - return update; - } - update } } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index e917b855b1..016362d5be 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -1,5 +1,6 @@ // Module declarations pub mod basic_attack; +pub mod basic_block; pub mod climb; pub mod glide; pub mod idle; diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index d430afdec8..5527365e20 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -105,6 +105,16 @@ pub fn handle_primary(ecs_data: &EcsStateData, update: &mut StateUpdate) { } } +pub fn handle_secondary(ecs_data: &EcsStateData, update: &mut StateUpdate) { + if let Some(state) = ecs_data.ability_pool.secondary { + if let CharacterState::Wielded(_) = update.character { + if ecs_data.inputs.secondary.is_pressed() { + update.character = state; + } + } + } +} + pub fn handle_dodge(ecs_data: &EcsStateData, update: &mut StateUpdate) { if let Some(state) = ecs_data.ability_pool.dodge { if let CharacterState::Idle(_) | CharacterState::Wielded(_) = update.character { diff --git a/common/src/states/wielded.rs b/common/src/states/wielded.rs index e70b0c0c34..73d09ca2ec 100644 --- a/common/src/states/wielded.rs +++ b/common/src/states/wielded.rs @@ -1,8 +1,9 @@ use super::utils::*; -use crate::comp::{EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; -use crate::states::StateHandler; -use std::collections::VecDeque; -use std::time::Duration; +use crate::{ + comp::{EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, + states::StateHandler, +}; +use std::{collections::VecDeque, time::Duration}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State { @@ -41,6 +42,7 @@ impl StateHandler for State { handle_glide(&ecs_data, &mut update); handle_unwield(&ecs_data, &mut update); handle_primary(&ecs_data, &mut update); + handle_secondary(&ecs_data, &mut update); handle_dodge(&ecs_data, &mut update); update diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 9c06759809..3290c3fc23 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -170,9 +170,9 @@ impl FigureModelCache { if camera_mode != CameraMode::FirstPerson || character_state .map(|cs| match cs { - //CharacterState::BasicAttack(_) // TODO: enable - //| CharacterState::BasicBlock(_) - CharacterState::Wielding(_) + CharacterState::BasicAttack(_) + | CharacterState::BasicBlock(_) + | CharacterState::Wielding(_) | CharacterState::Wielded(_) => true, _ => false, }) diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 22cc8322af..4313677564 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -457,15 +457,16 @@ impl FigureMgr { skeleton_attr, ) }, - /*CharacterState::Block(_) => { + CharacterState::BasicBlock(_) => { anim::character::BlockIdleAnimation::update_skeleton( - &target_base, + &CharacterSkeleton::new(), (active_tool_kind, time), state.state_time, &mut state_animation_rate, skeleton_attr, ) - } + }, + /* CharacterState::Charge(_) => { anim::character::ChargeAnimation::update_skeleton( &target_base, diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 353f64f873..508b8cbe6a 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -220,20 +220,8 @@ impl PlayState for SessionState { if let Some(select_pos) = select_pos { client.remove_block(select_pos); } - } else if client - .state() - .read_storage::() - .get(client.entity()) - .map(|cs| match cs { - /*ActionState::Attack(_) // TODO: uncomment - | ActionState::Block(_) - | ActionState::Wield(_) => true,*/ - _ => false, - }) - .unwrap_or(false) - { - self.inputs.secondary.set_state(state); } else { + self.inputs.secondary.set_state(state); if let Some(select_pos) = select_pos { client.collect_block(select_pos); } From 31f3aae75c18efd61dfc84eb626ef6e682e0c471 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 24 Feb 2020 19:17:16 +0100 Subject: [PATCH 042/387] fix: make climbing cost stamina --- assets/common/items/debug/boost.ron | 12 ++++++++---- assets/common/items/debug/possess.ron | 12 ++++++++---- common/src/comp/character_state.rs | 8 ++++++-- common/src/comp/energy.rs | 1 + common/src/states/basic_attack.rs | 1 + common/src/states/basic_block.rs | 1 + common/src/states/climb.rs | 23 +++++++++++++++-------- common/src/states/glide.rs | 11 ++++++----- common/src/states/idle.rs | 5 ++--- common/src/states/roll.rs | 10 ++++++---- common/src/states/sit.rs | 11 ++++++----- common/src/states/wielded.rs | 1 + common/src/states/wielding.rs | 10 ++++++---- common/src/sys/character_state.rs | 18 +++++++++++++----- common/src/sys/phys.rs | 2 +- 15 files changed, 81 insertions(+), 45 deletions(-) diff --git a/assets/common/items/debug/boost.ron b/assets/common/items/debug/boost.ron index c32d38c69a..6ff45a1d78 100644 --- a/assets/common/items/debug/boost.ron +++ b/assets/common/items/debug/boost.ron @@ -2,10 +2,14 @@ Item( name: "Weightless Rod", description: "The sky is the limit.", kind: Tool( - kind: Debug(Boost), - equip_time_millis: 0, - attack_buildup_millis: 0, - attack_recover_millis: 0, + ToolData ( + kind: Debug(Boost), + equip_time_millis: 0, + attack_buildup_millis: 0, + attack_recover_millis: 0, + range: 0, + base_damage: 0, + ) ), ) // And the ground is pretty hard at maximum velocity... diff --git a/assets/common/items/debug/possess.ron b/assets/common/items/debug/possess.ron index e568ece69b..4d223e4506 100644 --- a/assets/common/items/debug/possess.ron +++ b/assets/common/items/debug/possess.ron @@ -2,10 +2,14 @@ Item( name: "Rod of Possession", description: "It's fixed on my branch.", kind: Tool( - kind: Debug(Possess), - equip_time_millis: 0, - attack_buildup_millis: 0, - attack_recover_millis: 0, + ToolData ( + kind: Debug(Possess), + equip_time_millis: 0, + attack_buildup_millis: 0, + attack_recover_millis: 0, + range: 3, + base_damage: 10, + ) ), ) // ... as zesterer always uses to tell us. diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 6cd5178a20..8f6c95c028 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,5 +1,7 @@ use crate::{ - comp::{AbilityPool, Body, ControllerInputs, Ori, PhysicsState, Pos, Stats, ToolData, Vel}, + comp::{ + AbilityPool, Body, ControllerInputs, Energy, Ori, PhysicsState, Pos, Stats, ToolData, Vel, + }, event::{LocalEvent, ServerEvent}, state::DeltaTime, states::*, @@ -7,7 +9,7 @@ use crate::{ }; use serde::{Deserialize, Serialize}; use specs::{Component, Entity, FlaggedStorage, HashMapStorage, LazyUpdate, VecStorage}; -use std::{collections::VecDeque, time::Duration}; +use std::collections::VecDeque; pub struct EcsStateData<'a> { pub entity: &'a Entity, @@ -19,6 +21,7 @@ pub struct EcsStateData<'a> { pub dt: &'a DeltaTime, pub inputs: &'a ControllerInputs, pub stats: &'a Stats, + pub energy: &'a Energy, pub body: &'a Body, pub physics: &'a PhysicsState, pub ability_pool: &'a AbilityPool, @@ -30,6 +33,7 @@ pub struct StateUpdate { pub pos: Pos, pub vel: Vel, pub ori: Ori, + pub energy: Energy, pub local_events: VecDeque, pub server_events: VecDeque, } diff --git a/common/src/comp/energy.rs b/common/src/comp/energy.rs index 8cf2d9224e..e53fbe5a48 100644 --- a/common/src/comp/energy.rs +++ b/common/src/comp/energy.rs @@ -15,6 +15,7 @@ pub enum EnergySource { LevelUp, Regen, Revive, + Climb, Unknown, } diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index 91eaabc790..d633d988d8 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -31,6 +31,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, character: *ecs_data.character, local_events: VecDeque::new(), server_events: VecDeque::new(), diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index e3ee63f18f..fb91ce76a0 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -20,6 +20,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, character: *ecs_data.character, local_events: VecDeque::new(), server_events: VecDeque::new(), diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index a105a30323..8c73c9b31b 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -1,9 +1,13 @@ -use crate::comp::{CharacterState, EcsStateData, StateUpdate}; -use crate::states::StateHandler; -use crate::sys::phys::GRAVITY; +use crate::{ + comp::{CharacterState, EcsStateData, EnergySource, StateUpdate}, + states::StateHandler, + sys::phys::GRAVITY, +}; use std::collections::VecDeque; -use vek::vec::{Vec2, Vec3}; -use vek::Lerp; +use vek::{ + vec::{Vec2, Vec3}, + Lerp, +}; const HUMANOID_CLIMB_ACCEL: f32 = 5.0; const CLIMB_SPEED: f32 = 5.0; @@ -12,9 +16,7 @@ const CLIMB_SPEED: f32 = 5.0; pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { @@ -22,10 +24,15 @@ impl StateHandler for State { vel: *ecs_data.vel, ori: *ecs_data.ori, character: *ecs_data.character, + energy: *ecs_data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; + if let Err(_) = update.energy.try_change_by(-5, EnergySource::Climb) { + update.character = CharacterState::Idle(None); + } + // If no wall is in front of character ... if ecs_data.physics.on_wall.is_none() || ecs_data.physics.on_ground { if ecs_data.inputs.jump.is_pressed() { diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index 87048bb068..ba0d4f8bea 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -1,5 +1,7 @@ -use crate::comp::{CharacterState, EcsStateData, StateUpdate}; -use crate::states::StateHandler; +use crate::{ + comp::{CharacterState, EcsStateData, StateUpdate}, + states::StateHandler, +}; use std::collections::VecDeque; use vek::{Vec2, Vec3}; @@ -12,15 +14,14 @@ const GLIDE_SPEED: f32 = 45.0; pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, character: *ecs_data.character, local_events: VecDeque::new(), server_events: VecDeque::new(), diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index f9934be701..b07456e891 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -7,9 +7,7 @@ use crate::states::StateHandler; pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { @@ -17,6 +15,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index f1596f8189..14223b0e10 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,7 +1,8 @@ -use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; -use crate::states::StateHandler; -use std::collections::VecDeque; -use std::time::Duration; +use crate::{ + comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, + states::StateHandler, +}; +use std::{collections::VecDeque, time::Duration}; use vek::Vec3; const ROLL_SPEED: f32 = 17.0; @@ -31,6 +32,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; diff --git a/common/src/states/sit.rs b/common/src/states/sit.rs index 34e3f44150..1da5fb6df3 100644 --- a/common/src/states/sit.rs +++ b/common/src/states/sit.rs @@ -1,15 +1,15 @@ use super::utils::*; -use crate::comp::{CharacterState, EcsStateData, StateUpdate}; -use crate::states::StateHandler; +use crate::{ + comp::{CharacterState, EcsStateData, StateUpdate}, + states::StateHandler, +}; use std::collections::VecDeque; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &EcsStateData) -> Self { Self {} } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { let mut update = StateUpdate { @@ -17,6 +17,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; diff --git a/common/src/states/wielded.rs b/common/src/states/wielded.rs index 73d09ca2ec..545a38dca6 100644 --- a/common/src/states/wielded.rs +++ b/common/src/states/wielded.rs @@ -31,6 +31,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index d2e3bd289e..e3271ee958 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -1,8 +1,9 @@ use super::utils::*; -use crate::comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}; -use crate::states::StateHandler; -use std::collections::VecDeque; -use std::time::Duration; +use crate::{ + comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, + states::StateHandler, +}; +use std::{collections::VecDeque, time::Duration}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State { @@ -31,6 +32,7 @@ impl StateHandler for State { pos: *ecs_data.pos, vel: *ecs_data.vel, ori: *ecs_data.ori, + energy: *ecs_data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index 4d44334320..a87a7b92ab 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ - AbilityPool, Body, CharacterState, Controller, EcsStateData, Mounting, Ori, PhysicsState, - Pos, Stats, Vel, + AbilityPool, Body, CharacterState, Controller, EcsStateData, Energy, Mounting, Ori, + PhysicsState, Pos, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -11,10 +11,11 @@ use crate::{ use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; /// ## Character State System -/// #### Calls updates to `CharacterState`s. Acts on tuples of ( `CharacterState`, `Pos`, `Vel`, and `Ori` ). +/// #### Calls updates to `CharacterState`s. Acts on tuples of ( +/// `CharacterState`, `Pos`, `Vel`, and `Ori` ). /// -/// _System forms `EcsStateData` tuples and passes those to `ActionState` `update()` fn, -/// then does the same for `MoveState` `update`_ +/// _System forms `EcsStateData` tuples and passes those to `ActionState` +/// `update()` fn, then does the same for `MoveState` `update`_ pub struct Sys; impl<'a> System<'a> for Sys { @@ -29,6 +30,7 @@ impl<'a> System<'a> for Sys { WriteStorage<'a, Pos>, WriteStorage<'a, Vel>, WriteStorage<'a, Ori>, + WriteStorage<'a, Energy>, ReadStorage<'a, Controller>, ReadStorage<'a, Stats>, ReadStorage<'a, Body>, @@ -37,6 +39,7 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Uid>, ReadStorage<'a, Mounting>, ); + fn run( &mut self, ( @@ -50,6 +53,7 @@ impl<'a> System<'a> for Sys { mut positions, mut velocities, mut orientations, + mut energies, controllers, stats, bodies, @@ -66,6 +70,7 @@ impl<'a> System<'a> for Sys { pos, vel, ori, + energy, controller, stats, body, @@ -78,6 +83,7 @@ impl<'a> System<'a> for Sys { &mut positions, &mut velocities, &mut orientations, + &mut energies, &controllers, &stats, &bodies, @@ -113,6 +119,7 @@ impl<'a> System<'a> for Sys { pos, vel, ori, + energy, dt: &dt, inputs, stats, @@ -126,6 +133,7 @@ impl<'a> System<'a> for Sys { *pos = state_update.pos; *vel = state_update.vel; *ori = state_update.ori; + *energy = state_update.energy; local_bus.emitter().append(&mut state_update.local_events); server_bus.emitter().append(&mut state_update.server_events); } diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index d57f0af012..8df26f2390 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -9,7 +9,7 @@ use crate::{ use specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage}; use vek::*; -pub const GRAVITY: f32 = 9.81 * 7.0; +pub const GRAVITY: f32 = 9.81 * 10.0; const BOUYANCY: f32 = 0.0; // Friction values used for linear damping. They are unitless quantities. The // value of these quantities must be between zero and one. They represent the From ac611f46185aa52336792299f8b10560f02d9a18 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 24 Feb 2020 20:57:33 +0100 Subject: [PATCH 043/387] fix: sync characterstates, better energy management --- common/src/comp/character_state.rs | 9 +++++++ common/src/comp/energy.rs | 1 + common/src/msg/ecs_packet.rs | 7 ++++++ common/src/states/basic_attack.rs | 2 +- common/src/states/basic_block.rs | 8 +++++- common/src/states/roll.rs | 10 ++++++++ common/src/states/utils.rs | 13 +++++++--- common/src/sys/stats.rs | 8 +++--- server/src/sys/sentinel.rs | 21 ++++++++++++++-- .../src/audio/sfx/event_mapper/movement.rs | 25 ++++++++----------- 10 files changed, 79 insertions(+), 25 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 8f6c95c028..c3801b7889 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -53,6 +53,15 @@ pub enum CharacterState { } impl CharacterState { + pub fn is_wielded(&self) -> bool { + match self { + CharacterState::Wielded(_) => true, + CharacterState::BasicAttack(_) => true, + CharacterState::BasicBlock(_) => true, + _ => false, + } + } + pub fn is_attack(&self) -> bool { match self { CharacterState::BasicAttack(_) => true, diff --git a/common/src/comp/energy.rs b/common/src/comp/energy.rs index e53fbe5a48..0c74f20304 100644 --- a/common/src/comp/energy.rs +++ b/common/src/comp/energy.rs @@ -16,6 +16,7 @@ pub enum EnergySource { Regen, Revive, Climb, + Roll, Unknown, } diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 57496dda0f..cd62d556e5 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -24,6 +24,7 @@ sum_type! { AbilityAction(comp::AbilityAction), AbilityPool(comp::AbilityPool), Attacking(comp::Attacking), + CharacterState(comp::CharacterState), } } // Automatically derive From for EcsCompPhantom @@ -47,6 +48,7 @@ sum_type! { AbilityAction(PhantomData), AbilityPool(PhantomData), Attacking(PhantomData), + CharacterState(PhantomData), } } impl sync::CompPacket for EcsCompPacket { @@ -70,6 +72,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::AbilityAction(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Attacking(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::CharacterState(comp) => sync::handle_insert(comp, entity, world), } } @@ -91,6 +94,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::AbilityAction(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Attacking(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::CharacterState(comp) => sync::handle_modify(comp, entity, world), } } @@ -118,6 +122,9 @@ impl sync::CompPacket for EcsCompPacket { sync::handle_remove::(entity, world) }, EcsCompPhantom::Attacking(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::CharacterState(_) => { + sync::handle_remove::(entity, world) + }, } } } diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index d633d988d8..f142bc7e13 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -1,6 +1,6 @@ use crate::{ comp::{Attacking, CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, - states::{utils, StateHandler}, + states::StateHandler, }; use std::{collections::VecDeque, time::Duration}; diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index fb91ce76a0..18d7dd1ce2 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -1,6 +1,6 @@ use super::utils::*; use crate::{ - comp::{EcsStateData, StateUpdate}, + comp::{CharacterState, EcsStateData, StateUpdate}, states::StateHandler, }; use std::{collections::VecDeque, time::Duration}; @@ -26,6 +26,12 @@ impl StateHandler for State { server_events: VecDeque::new(), }; + handle_move_dir(&ecs_data, &mut update); + + if !ecs_data.physics.on_ground || !ecs_data.inputs.secondary.is_pressed() { + update.character = CharacterState::Wielded(None); + } + update } } diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 14223b0e10..be3944ba13 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -50,6 +50,16 @@ impl StateHandler for State { .unwrap_or_default() * ROLL_SPEED; + // Smooth orientation + if update.vel.0.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(update.vel.0).normalized()) + .magnitude_squared() + > 0.001 + { + update.ori.0 = + vek::ops::Slerp::slerp(update.ori.0, update.vel.0.into(), 9.0 * ecs_data.dt.0); + } + if self.remaining_duration == Duration::default() { // Roll duration has expired update.character = CharacterState::Idle(None); diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 5527365e20..d6b8d7338f 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,5 +1,5 @@ use crate::{ - comp::{Attacking, CharacterState, EcsStateData, ItemKind::Tool, StateUpdate}, + comp::{Attacking, CharacterState, EcsStateData, EnergySource, ItemKind::Tool, StateUpdate}, event::LocalEvent, }; use std::time::Duration; @@ -27,7 +27,10 @@ pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { } // Set direction based on move direction - let ori_dir = if update.character.is_attack() || update.character.is_block() { + let ori_dir = if update.character.is_wielded() + || update.character.is_attack() + || update.character.is_block() + { Vec2::from(ecs_data.inputs.look_dir).normalized() } else { Vec2::from(update.vel.0) @@ -58,7 +61,7 @@ pub fn handle_sit(ecs_data: &EcsStateData, update: &mut StateUpdate) { } pub fn handle_climb(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if (ecs_data.inputs.climb.is_just_pressed() || ecs_data.inputs.climb_down.is_pressed()) + if (ecs_data.inputs.climb.is_pressed() || ecs_data.inputs.climb_down.is_pressed()) && ecs_data.physics.on_wall.is_some() && !ecs_data.physics.on_ground //&& update.vel.0.z < 0.0 @@ -121,6 +124,10 @@ pub fn handle_dodge(ecs_data: &EcsStateData, update: &mut StateUpdate) { if ecs_data.inputs.roll.is_pressed() && ecs_data.physics.on_ground && ecs_data.body.is_humanoid() + && update + .energy + .try_change_by(-200, EnergySource::Roll) + .is_ok() { update.character = state; } diff --git a/common/src/sys/stats.rs b/common/src/sys/stats.rs index 19e8182c09..548b636bda 100644 --- a/common/src/sys/stats.rs +++ b/common/src/sys/stats.rs @@ -5,7 +5,7 @@ use crate::{ }; use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage}; -const ENERGY_REGEN_ACCEL: f32 = 20.0; +const ENERGY_REGEN_ACCEL: f32 = 10.0; /// This system kills players, levels them up, and regenerates energy. pub struct Sys; @@ -87,15 +87,17 @@ impl<'a> System<'a> for Sys { as i32, EnergySource::Regen, ); - energy.regen_rate += ENERGY_REGEN_ACCEL * dt.0; + energy.regen_rate = + (energy.regen_rate + ENERGY_REGEN_ACCEL * dt.0).min(100.0); } }, // All other states do not regen and set the rate back to zero. - _ => { + CharacterState::Wielded(_) => { if energy.get_unchecked().regen_rate != 0.0 { energy.get_mut_unchecked().regen_rate = 0.0 } }, + _ => {}, } } } diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index 9363dcfc59..f48f8a9f59 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -1,8 +1,8 @@ use super::SysTimer; use common::{ comp::{ - AbilityPool, Body, CanBuild, Energy, Gravity, Item, LightEmitter, Mass, MountState, - Mounting, Player, Scale, Stats, Sticky, + AbilityPool, Body, CanBuild, CharacterState, Energy, Gravity, Item, LightEmitter, Mass, + MountState, Mounting, Player, Scale, Stats, Sticky, }, msg::EcsCompPacket, sync::{EntityPackage, SyncPackage, Uid, UpdateTracker, WorldSyncExt}, @@ -52,6 +52,7 @@ pub struct TrackedComps<'a> { pub sticky: ReadStorage<'a, Sticky>, pub gravity: ReadStorage<'a, Gravity>, pub ability_pool: ReadStorage<'a, AbilityPool>, + pub character_state: ReadStorage<'a, CharacterState>, } impl<'a> TrackedComps<'a> { pub fn create_entity_package(&self, entity: EcsEntity) -> EntityPackage { @@ -109,6 +110,10 @@ impl<'a> TrackedComps<'a> { .get(entity) .copied() .map(|c| comps.push(c.into())); + self.character_state + .get(entity) + .copied() + .map(|c| comps.push(c.into())); EntityPackage { uid, comps } } @@ -130,6 +135,7 @@ pub struct ReadTrackers<'a> { pub sticky: ReadExpect<'a, UpdateTracker>, pub gravity: ReadExpect<'a, UpdateTracker>, pub ability_pool: ReadExpect<'a, UpdateTracker>, + pub character_state: ReadExpect<'a, UpdateTracker>, } impl<'a> ReadTrackers<'a> { pub fn create_sync_package( @@ -158,6 +164,12 @@ impl<'a> ReadTrackers<'a> { .with_component(&comps.uid, &*self.sticky, &comps.sticky, filter) .with_component(&comps.uid, &*self.gravity, &comps.gravity, filter) .with_component(&comps.uid, &*self.ability_pool, &comps.ability_pool, filter) + .with_component( + &comps.uid, + &*self.character_state, + &comps.character_state, + filter, + ) } } @@ -178,6 +190,7 @@ pub struct WriteTrackers<'a> { sticky: WriteExpect<'a, UpdateTracker>, gravity: WriteExpect<'a, UpdateTracker>, ability_pool: WriteExpect<'a, UpdateTracker>, + character_state: WriteExpect<'a, UpdateTracker>, } fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) { @@ -197,6 +210,9 @@ fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) { trackers.sticky.record_changes(&comps.sticky); trackers.gravity.record_changes(&comps.gravity); trackers.ability_pool.record_changes(&comps.ability_pool); + trackers + .character_state + .record_changes(&comps.character_state); } pub fn register_trackers(world: &mut World) { @@ -215,6 +231,7 @@ pub fn register_trackers(world: &mut World) { world.register_tracker::(); world.register_tracker::(); world.register_tracker::(); + world.register_tracker::(); } /// Deleted entities grouped by region diff --git a/voxygen/src/audio/sfx/event_mapper/movement.rs b/voxygen/src/audio/sfx/event_mapper/movement.rs index 559e036aa4..00e80b6815 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement.rs @@ -124,28 +124,23 @@ impl MovementEventMapper { } } - /// Voxygen has an existing list of character states via `MoveState::*` and - /// `ActionState::*` however that list does not provide enough - /// resolution to target specific entity events, such as opening or - /// closing the glider. These methods translate those entity states with - /// some additional data into more specific `SfxEvent`'s which we attach - /// sounds to + /// Voxygen has an existing list of character states however that list does + /// not provide enough resolution to target specific entity events, such + /// as opening or closing the glider. These methods translate those + /// entity states with some additional data into more specific + /// `SfxEvent`'s which we attach sounds to fn map_movement_event(current_event: &CharacterState, previous_event: SfxEvent) -> SfxEvent { - match (current_event, previous_event) { - (CharacterState::Roll(_), _) => SfxEvent::Roll, - (CharacterState::Climb(_), _) => SfxEvent::Climb, - (CharacterState::Idle(_), _) => SfxEvent::Run, - (CharacterState::Idle(_), SfxEvent::Glide) => SfxEvent::GliderClose, - (CharacterState::Idle(_), SfxEvent::Fall) => SfxEvent::Run, - (CharacterState::Idle(_), SfxEvent::Jump) => SfxEvent::Idle, - (CharacterState::Glide(_), previous_event) => { + match (previous_event, current_event) { + (_, CharacterState::Roll(_)) => SfxEvent::Roll, + (_, CharacterState::Climb(_)) => SfxEvent::Climb, + (SfxEvent::Glide, CharacterState::Idle(_)) => SfxEvent::GliderClose, + (previous_event, CharacterState::Glide(_)) => { if previous_event != SfxEvent::GliderOpen && previous_event != SfxEvent::Glide { SfxEvent::GliderOpen } else { SfxEvent::Glide } }, - (CharacterState::Idle(_), SfxEvent::Glide) => SfxEvent::GliderClose, _ => SfxEvent::Idle, } } From 4cc998f92bad364238cfb56f935bac4f98d464d6 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Mon, 24 Feb 2020 22:20:50 +0100 Subject: [PATCH 044/387] fix: non-humanoid npcs can attack again --- common/src/comp/character_state.rs | 2 +- common/src/states/basic_attack.rs | 18 +++++++++++------- common/src/states/utils.rs | 4 +--- common/src/states/wielding.rs | 10 ++++------ common/src/sys/combat.rs | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index c3801b7889..589eeaeca0 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -143,7 +143,7 @@ impl Component for CharacterState { #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct Attacking { - pub weapon: ToolData, + pub weapon: Option, } impl Component for Attacking { diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index f142bc7e13..1574abed2e 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -14,14 +14,14 @@ pub struct State { impl StateHandler for State { fn new(ecs_data: &EcsStateData) -> Self { - let tool_data = + let remaining_duration = if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data + data.attack_duration() } else { - ToolData::default() + Duration::from_millis(300) }; Self { - remaining_duration: tool_data.attack_duration(), + remaining_duration, exhausted: false, } } @@ -43,7 +43,7 @@ impl StateHandler for State { && if let Some(Tool(data)) = tool_kind { (self.remaining_duration < data.attack_recover_duration()) } else { - false + true }; let mut exhausted = self.exhausted; @@ -52,9 +52,13 @@ impl StateHandler for State { if let Some(Tool(data)) = tool_kind { ecs_data .updater - .insert(*ecs_data.entity, Attacking { weapon: data }); - exhausted = true; + .insert(*ecs_data.entity, Attacking { weapon: Some(data) }); + } else { + ecs_data + .updater + .insert(*ecs_data.entity, Attacking { weapon: None }); } + exhausted = true; } else { ecs_data.updater.remove::(*ecs_data.entity); } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 861d2c2d07..14294a3631 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -47,9 +47,7 @@ pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { pub fn handle_wield(ecs_data: &EcsStateData, update: &mut StateUpdate) { if ecs_data.inputs.primary.is_pressed() { - if let Some(Tool(_)) = ecs_data.stats.equipment.main.as_ref().map(|i| &i.kind) { - update.character = CharacterState::Wielding(None); - } + update.character = CharacterState::Wielding(None); } } diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index e3271ee958..58da3c22b0 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -14,16 +14,14 @@ pub struct State { impl StateHandler for State { fn new(ecs_data: &EcsStateData) -> Self { - let tool_data = + let equip_delay = if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data + data.equip_time() } else { - ToolData::default() + Duration::default() }; - Self { - equip_delay: tool_data.equip_time(), - } + Self { equip_delay } } fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index d8d894a968..0024e639a5 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -99,7 +99,7 @@ impl<'a> System<'a> for Sys { && ori2.angle_between(pos_b2 - pos2) < ATTACK_ANGLE.to_radians() / 2.0 + (rad_b / pos2.distance(pos_b2)).atan() { // Weapon gives base damage - let mut dmg = attack.weapon.base_damage as i32; + let mut dmg = attack.weapon.map(|w| w.base_damage as i32).unwrap_or(3); // Block if character_b.is_block() From d6f72876e91439c1969b56103f9a2d20900c4736 Mon Sep 17 00:00:00 2001 From: Shane Handley Date: Tue, 25 Feb 2020 10:01:41 +0900 Subject: [PATCH 045/387] Fix tests for movement sfx. --- .../audio/sfx/event_mapper/movement/tests.rs | 419 +++++++++--------- 1 file changed, 198 insertions(+), 221 deletions(-) diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 251efba8a5..9e147467bc 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -2,8 +2,8 @@ use super::*; use common::{ assets, comp::{ - bird_small, humanoid, item::Tool, quadruped_medium, quadruped_small, ActionState, Body, - MovementState, Stats, + bird_small, humanoid, item::ToolKind, quadruped_medium, quadruped_small, Body, + CharacterState, Stats, }, event::SfxEvent, }; @@ -94,10 +94,7 @@ fn maps_idle() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Stand, - action: ActionState::Idle, - }, + &CharacterState::Idle(None), &LastSfxEvent { event: SfxEvent::Idle, weapon_drawn: false, @@ -110,55 +107,55 @@ fn maps_idle() { assert_eq!(result, SfxEvent::Idle); } -#[test] -fn maps_run_with_sufficient_velocity() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn maps_run_with_sufficient_velocity() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Run, - action: ActionState::Idle, - }, - &LastSfxEvent { - event: SfxEvent::Idle, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::new(0.5, 0.8, 0.0), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Run, +// action: ActionState::Idle, +// }, +// &LastSfxEvent { +// event: SfxEvent::Idle, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::new(0.5, 0.8, 0.0), +// &stats, +// ); - assert_eq!(result, SfxEvent::Run); -} +// assert_eq!(result, SfxEvent::Run); +// } -#[test] -fn does_not_map_run_with_insufficient_velocity() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn does_not_map_run_with_insufficient_velocity() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Run, - action: ActionState::Idle, - }, - &LastSfxEvent { - event: SfxEvent::Idle, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::new(0.02, 0.0001, 0.0), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Run, +// action: ActionState::Idle, +// }, +// &LastSfxEvent { +// event: SfxEvent::Idle, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::new(0.02, 0.0001, 0.0), +// &stats, +// ); - assert_eq!(result, SfxEvent::Idle); -} +// assert_eq!(result, SfxEvent::Idle); +// } #[test] fn maps_roll() { @@ -169,13 +166,7 @@ fn maps_roll() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState { - action: ActionState::Roll { - time_left: Duration::new(1, 0), - was_wielding: false, - }, - movement: MovementState::Run, - }, + &CharacterState::Roll(None), &LastSfxEvent { event: SfxEvent::Run, weapon_drawn: false, @@ -188,55 +179,55 @@ fn maps_roll() { assert_eq!(result, SfxEvent::Roll); } -#[test] -fn maps_fall() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn maps_fall() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Fall, - action: ActionState::Idle, - }, - &LastSfxEvent { - event: SfxEvent::Fall, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::zero(), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Fall, +// action: ActionState::Idle, +// }, +// &LastSfxEvent { +// event: SfxEvent::Fall, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::zero(), +// &stats, +// ); - assert_eq!(result, SfxEvent::Fall); -} +// assert_eq!(result, SfxEvent::Fall); +// } -#[test] -fn maps_land_on_ground_to_run() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn maps_land_on_ground_to_run() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Stand, - action: ActionState::Idle, - }, - &LastSfxEvent { - event: SfxEvent::Fall, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::zero(), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Stand, +// action: ActionState::Idle, +// }, +// &LastSfxEvent { +// event: SfxEvent::Fall, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::zero(), +// &stats, +// ); - assert_eq!(result, SfxEvent::Run); -} +// assert_eq!(result, SfxEvent::Run); +// } #[test] fn maps_glider_open() { @@ -247,10 +238,7 @@ fn maps_glider_open() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Glide, - action: ActionState::Idle, - }, + &CharacterState::Glide(None), &LastSfxEvent { event: SfxEvent::Jump, weapon_drawn: false, @@ -272,10 +260,7 @@ fn maps_glide() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Glide, - action: ActionState::Idle, - }, + &CharacterState::Glide(None), &LastSfxEvent { event: SfxEvent::Glide, weapon_drawn: false, @@ -288,87 +273,58 @@ fn maps_glide() { assert_eq!(result, SfxEvent::Glide); } -#[test] -fn maps_glider_close_when_closing_mid_flight() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn maps_glider_close_when_closing_mid_flight() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Fall, - action: ActionState::Idle, - }, - &LastSfxEvent { - event: SfxEvent::Glide, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::zero(), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Fall, +// action: ActionState::Idle, +// }, +// &LastSfxEvent { +// event: SfxEvent::Glide, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::zero(), +// &stats, +// ); - assert_eq!(result, SfxEvent::GliderClose); -} +// assert_eq!(result, SfxEvent::GliderClose); +// } -#[test] -fn maps_glider_close_when_landing() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn maps_glider_close_when_landing() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Stand, - action: ActionState::Idle, - }, - &LastSfxEvent { - event: SfxEvent::Glide, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::zero(), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Stand, +// action: ActionState::Idle, +// }, +// &LastSfxEvent { +// event: SfxEvent::Glide, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::zero(), +// &stats, +// ); - assert_eq!(result, SfxEvent::GliderClose); -} +// assert_eq!(result, SfxEvent::GliderClose); +// } #[test] fn maps_wield() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - Some(assets::load_expect_cloned( - "common.items.weapons.starter_sword", - )), - ); - - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Stand, - action: ActionState::Wield { - time_left: Duration::from_millis(800), - }, - }, - &LastSfxEvent { - event: SfxEvent::Idle, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::zero(), - &stats, - ); - - assert_eq!(result, SfxEvent::Wield(Tool::Sword)); -} - -#[test] -fn maps_unwield() { let stats = Stats::new( String::from("test"), Body::Humanoid(humanoid::Body::random()), @@ -378,10 +334,31 @@ fn maps_unwield() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Stand, - action: ActionState::Idle, + &CharacterState::BasicAttack(None), + &LastSfxEvent { + event: SfxEvent::Idle, + weapon_drawn: false, + time: Instant::now(), }, + Vec3::zero(), + &stats, + ); + + assert_eq!(result, SfxEvent::Wield(ToolKind::Axe)); +} + +#[test] +fn maps_unwield() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + Some(assets::load_expect_cloned( + "common.items.weapons.starter_bow", + )), + ); + + let result = MovementEventMapper::map_movement_event( + &CharacterState::default(), &LastSfxEvent { event: SfxEvent::Idle, weapon_drawn: true, @@ -391,48 +368,48 @@ fn maps_unwield() { &stats, ); - assert_eq!(result, SfxEvent::Unwield(Tool::Axe)); + assert_eq!(result, SfxEvent::Unwield(ToolKind::Bow)); } -#[test] -fn does_not_map_wield_when_no_main_weapon() { - let stats = Stats::new( - String::from("test"), - Body::Humanoid(humanoid::Body::random()), - None, - ); +// #[test] +// fn does_not_map_wield_when_no_main_weapon() { +// let stats = Stats::new( +// String::from("test"), +// Body::Humanoid(humanoid::Body::random()), +// None, +// ); - let result = MovementEventMapper::map_movement_event( - &CharacterState { - movement: MovementState::Run, - action: ActionState::Wield { - time_left: Duration::from_millis(600), - }, - }, - &LastSfxEvent { - event: SfxEvent::Idle, - weapon_drawn: false, - time: Instant::now(), - }, - Vec3::new(0.5, 0.8, 0.0), - &stats, - ); +// let result = MovementEventMapper::map_movement_event( +// &CharacterState { +// movement: MovementState::Run, +// action: ActionState::Wield { +// time_left: Duration::from_millis(600), +// }, +// }, +// &LastSfxEvent { +// event: SfxEvent::Idle, +// weapon_drawn: false, +// time: Instant::now(), +// }, +// Vec3::new(0.5, 0.8, 0.0), +// &stats, +// ); - assert_eq!(result, SfxEvent::Run); -} +// assert_eq!(result, SfxEvent::Run); +// } -#[test] -fn maps_quadrupeds_running() { - let result = MovementEventMapper::map_non_humanoid_movement_event( - &CharacterState { - movement: MovementState::Run, - action: ActionState::Idle, - }, - Vec3::new(0.5, 0.8, 0.0), - ); +// #[test] +// fn maps_quadrupeds_running() { +// let result = MovementEventMapper::map_non_humanoid_movement_event( +// &CharacterState { +// movement: MovementState::Run, +// action: ActionState::Idle, +// }, +// Vec3::new(0.5, 0.8, 0.0), +// ); - assert_eq!(result, SfxEvent::Run); -} +// assert_eq!(result, SfxEvent::Run); +// } #[test] fn determines_relative_volumes() { From 543851434312c10567029e838656903949398a20 Mon Sep 17 00:00:00 2001 From: Justin Shipsey Date: Tue, 25 Feb 2020 06:47:56 +0000 Subject: [PATCH 046/387] animation housekeeping --- voxygen/src/anim/bird_medium/idle.rs | 8 +-- voxygen/src/anim/bird_medium/mod.rs | 8 +-- voxygen/src/anim/bird_medium/run.rs | 12 ++-- voxygen/src/anim/character/run.rs | 73 +++++++++++------------- voxygen/src/anim/character/stand.rs | 44 ++++++-------- voxygen/src/anim/quadruped_small/idle.rs | 27 +++++---- voxygen/src/anim/quadruped_small/run.rs | 41 ++++++------- 7 files changed, 100 insertions(+), 113 deletions(-) diff --git a/voxygen/src/anim/bird_medium/idle.rs b/voxygen/src/anim/bird_medium/idle.rs index 82cd25c2bc..86b776720e 100644 --- a/voxygen/src/anim/bird_medium/idle.rs +++ b/voxygen/src/anim/bird_medium/idle.rs @@ -33,7 +33,7 @@ impl Animation for IdleAnimation { * 0.25, ); - next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 11.0; + next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1); next.head.ori = Quaternion::rotation_z(duck_head_look.x) * Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03); next.head.scale = Vec3::one(); @@ -46,7 +46,7 @@ impl Animation for IdleAnimation { next.torso.ori = Quaternion::rotation_y(wave_slow * 0.03); next.torso.scale = Vec3::one() / 11.0; - next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1) / 11.0; + next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); next.tail.ori = Quaternion::rotation_x(wave_slow_cos * 0.03); next.tail.scale = Vec3::one(); @@ -54,7 +54,7 @@ impl Animation for IdleAnimation { -skeleton_attr.wing.0, skeleton_attr.wing.1, skeleton_attr.wing.2, - ) / 11.0; + ); next.wing_l.ori = Quaternion::rotation_z(0.0); next.wing_l.scale = Vec3::one() * 1.05; @@ -62,7 +62,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing.0, skeleton_attr.wing.1, skeleton_attr.wing.2, - ) / 11.0; + ); next.wing_r.ori = Quaternion::rotation_y(0.0); next.wing_r.scale = Vec3::one() * 1.05; diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index f1330d82c8..0ff89377ae 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/mod.rs @@ -31,11 +31,11 @@ impl Skeleton for BirdMediumSkeleton { let torso_mat = self.torso.compute_base_matrix(); [ - FigureBoneData::new(self.head.compute_base_matrix() * torso_mat), + FigureBoneData::new(torso_mat * self.head.compute_base_matrix()), FigureBoneData::new(torso_mat), - FigureBoneData::new(self.tail.compute_base_matrix() * torso_mat), - FigureBoneData::new(self.wing_l.compute_base_matrix() * torso_mat), - FigureBoneData::new(self.wing_r.compute_base_matrix() * torso_mat), + FigureBoneData::new(torso_mat * self.tail.compute_base_matrix()), + FigureBoneData::new(torso_mat * self.wing_l.compute_base_matrix()), + FigureBoneData::new(torso_mat * self.wing_r.compute_base_matrix()), FigureBoneData::new(self.leg_l.compute_base_matrix()), FigureBoneData::new(self.leg_r.compute_base_matrix()), FigureBoneData::default(), diff --git a/voxygen/src/anim/bird_medium/run.rs b/voxygen/src/anim/bird_medium/run.rs index 36cb77cc50..ea73668941 100644 --- a/voxygen/src/anim/bird_medium/run.rs +++ b/voxygen/src/anim/bird_medium/run.rs @@ -28,7 +28,7 @@ impl Animation for RunAnimation { 0.0, skeleton_attr.head.0, skeleton_attr.head.1 + center * 0.5, - ) / 11.0; + ); next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03); next.head.scale = Vec3::one(); @@ -44,7 +44,7 @@ impl Animation for RunAnimation { 0.0, skeleton_attr.tail.0, skeleton_attr.tail.1 + centeroffset * 0.6, - ) / 11.0; + ); next.tail.ori = Quaternion::rotation_x(center * 0.03); next.tail.scale = Vec3::one(); @@ -52,16 +52,16 @@ impl Animation for RunAnimation { -skeleton_attr.wing.0, skeleton_attr.wing.1, skeleton_attr.wing.2, - ) / 11.0; - next.wing_l.ori = Quaternion::rotation_y(footl * 0.3); + ); + next.wing_l.ori = Quaternion::rotation_y(footl * 0.1); next.wing_l.scale = Vec3::one() * 1.05; next.wing_r.offset = Vec3::new( skeleton_attr.wing.0, skeleton_attr.wing.1, skeleton_attr.wing.2, - ) / 11.0; - next.wing_r.ori = Quaternion::rotation_y(footr * 0.3); + ); + next.wing_r.ori = Quaternion::rotation_y(footr * 0.1); next.wing_r.scale = Vec3::one() * 1.05; next.leg_l.offset = Vec3::new( diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index f202ef5545..c4e2479248 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -21,22 +21,18 @@ impl Animation for RunAnimation { let speed = Vec2::::from(velocity).magnitude(); *rate = speed; - let constant = 1.0; - let wave = (((5.0) - / (1.1 + 3.9 * ((anim_time as f32 * constant as f32 * 1.2).sin()).powf(2.0 as f32))) + let lab = 1.0; + let long = (((5.0) + / (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 1.2).sin()).powf(2.0 as f32))) .sqrt()) - * ((anim_time as f32 * constant as f32 * 1.2).sin()); - let wave_cos = (((5.0) - / (1.1 + 3.9 * ((anim_time as f32 * constant as f32 * 2.4).sin()).powf(2.0 as f32))) + * ((anim_time as f32 * lab as f32 * 1.2).sin()); + let short = (((5.0) + / (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 2.4).sin()).powf(2.0 as f32))) .sqrt()) - * ((anim_time as f32 * constant as f32 * 1.5).sin()); - let wave_cos_dub = (((5.0) - / (1.1 + 3.9 * ((anim_time as f32 * constant as f32 * 4.8).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * constant as f32 * 1.5).sin()); + * ((anim_time as f32 * lab as f32 * 1.5).sin()); - let wave_diff = (anim_time as f32 * 0.6).sin(); let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); + let head_look = Vec2::new( ((global_time + anim_time) as f32 / 4.0) .floor() @@ -67,48 +63,48 @@ impl Animation for RunAnimation { next.head.offset = Vec3::new( 0.0, -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 20.0 + wave_cos * 1.3, + skeleton_attr.neck_height + 20.0 + short * 1.3, ); - next.head.ori = Quaternion::rotation_z(head_look.x + wave * 0.1) + next.head.ori = Quaternion::rotation_z(head_look.x + long * 0.1) * Quaternion::rotation_x(head_look.y + 0.35); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_cos * 1.1); - next.chest.ori = Quaternion::rotation_z(wave * 0.2); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + short * 1.1); + next.chest.ori = Quaternion::rotation_z(long * 0.2); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + wave_cos * 1.1); - next.belt.ori = Quaternion::rotation_z(wave * 0.35); + next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + short * 1.1); + next.belt.ori = Quaternion::rotation_z(long * 0.35); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + wave_cos * 1.1); - next.shorts.ori = Quaternion::rotation_z(wave * 0.6); + next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + short * 1.1); + next.shorts.ori = Quaternion::rotation_z(long * 0.6); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( -6.0 + wave_stop * -1.0, - -0.25 + wave_cos * 2.0, - 5.0 - wave * 1.5, + -0.25 + short * 2.0, + 5.0 - long * 1.5, ); next.l_hand.ori = - Quaternion::rotation_x(0.8 + wave_cos * 1.2) * Quaternion::rotation_y(wave_stop * 0.1); + Quaternion::rotation_x(0.8 + short * 1.2) * Quaternion::rotation_y(wave_stop * 0.1); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( 6.0 + wave_stop * 1.0, - -0.25 - wave_cos * 2.0, - 5.0 + wave * 1.5, + -0.25 + short * -2.0, + 5.0 + long * 1.5, ); - next.r_hand.ori = Quaternion::rotation_x(0.8 + wave_cos * -1.2) - * Quaternion::rotation_y(wave_stop * -0.1); + next.r_hand.ori = + Quaternion::rotation_x(0.8 + short * -1.2) * Quaternion::rotation_y(wave_stop * -0.1); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, 0.0 + wave_cos * 1.0, 6.0 - wave_cos_dub * 0.7); - next.l_foot.ori = Quaternion::rotation_x(-0.0 - wave_cos * 1.2); + next.l_foot.offset = Vec3::new(-3.4, 0.0 + short * 1.0, 6.0); + next.l_foot.ori = Quaternion::rotation_x(-0.0 - short * 1.2); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, 0.0 - wave_cos * 1.0, 6.0 - wave_cos_dub * 0.7); - next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave_cos * 1.2); + next.r_foot.offset = Vec3::new(3.4, short * -1.0, 6.0); + next.r_foot.ori = Quaternion::rotation_x(short * 1.2); next.r_foot.scale = Vec3::one(); next.main.offset = Vec3::new( @@ -116,16 +112,15 @@ impl Animation for RunAnimation { -5.0 + skeleton_attr.weapon_y, 15.0, ); - next.main.ori = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_cos * 0.25); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + short * 0.25); next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); - next.l_shoulder.ori = Quaternion::rotation_x(wave_cos * 0.15); + next.l_shoulder.offset = Vec3::new(-5.0, -0.5, 4.7); + next.l_shoulder.ori = Quaternion::rotation_x(short * 0.15); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); - next.r_shoulder.ori = Quaternion::rotation_x(wave * 0.15); + next.r_shoulder.offset = Vec3::new(5.0, -0.5, 4.7); + next.r_shoulder.ori = Quaternion::rotation_x(long * 0.15); next.r_shoulder.scale = Vec3::one() * 1.1; next.glider.offset = Vec3::new(0.0, 5.0, 0.0); @@ -136,9 +131,9 @@ impl Animation for RunAnimation { next.lantern.ori = Quaternion::rotation_y(0.0); next.lantern.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.3 + wave * -0.08, 0.4) * skeleton_attr.scaler; + next.torso.offset = Vec3::new(0.0, -0.3 + long * -0.08, 0.4) * skeleton_attr.scaler; next.torso.ori = - Quaternion::rotation_x(wave_stop * speed * -0.06 + wave_diff * speed * -0.005) + Quaternion::rotation_x(wave_stop * speed * -0.06 + wave_stop * speed * -0.005) * Quaternion::rotation_y(tilt); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index 25459e7d3c..2116115be7 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -1,6 +1,6 @@ use super::{super::Animation, CharacterSkeleton, SkeletonAttr}; use common::comp::item::Tool; -use std::{f32::consts::PI, ops::Mul}; +use std::ops::Mul; use vek::*; pub struct StandAnimation; @@ -18,9 +18,8 @@ impl Animation for StandAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); - let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos(); - let wave_ultra_slow_abs = ((anim_time as f32 * 0.5 + PI).sin()) + 1.0; + let slow = (anim_time as f32 * 1.0).sin(); + let breathe = ((anim_time as f32 * 0.5).sin()).abs(); let head_look = Vec2::new( ((global_time + anim_time) as f32 / 12.0) @@ -37,40 +36,33 @@ impl Animation for StandAnimation { next.head.offset = Vec3::new( 0.0 + skeleton_attr.neck_right, -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 21.0 + wave_ultra_slow * 0.3, + skeleton_attr.neck_height + 21.0 + slow * 0.3, ); next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y.abs()); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_ultra_slow * 0.3); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + slow * 0.3); next.chest.ori = Quaternion::rotation_x(0.0); - next.chest.scale = Vec3::one() * 1.01 + wave_ultra_slow_abs * 0.05; + next.chest.scale = Vec3::one() * 1.01 + breathe * 0.05; - next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + wave_ultra_slow * 0.3); + next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + slow * 0.3); next.belt.ori = Quaternion::rotation_x(0.0); - next.belt.scale = Vec3::one() + wave_ultra_slow_abs * 0.05; + next.belt.scale = Vec3::one() + breathe * 0.05; - next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + wave_ultra_slow * 0.3); + next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + slow * 0.3); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new( - -6.0, - -0.25 + wave_ultra_slow_cos * 0.15, - 5.0 + wave_ultra_slow * 0.5, - ); + next.l_hand.offset = Vec3::new(-6.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5); - next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * -0.06); + next.l_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.06); next.l_hand.scale = Vec3::one(); - next.r_hand.offset = Vec3::new( - 6.0, - -0.25 + wave_ultra_slow_cos * 0.15, - 5.0 + wave_ultra_slow * 0.5 + wave_ultra_slow_abs * -0.05, - ); - next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * -0.06); - next.r_hand.scale = Vec3::one() + wave_ultra_slow_abs * -0.05; + next.r_hand.offset = + Vec3::new(6.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5 + breathe * -0.05); + next.r_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.06); + next.r_hand.scale = Vec3::one() + breathe * -0.05; next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); next.l_foot.ori = Quaternion::identity(); @@ -86,15 +78,15 @@ impl Animation for StandAnimation { 15.0, ); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one() + wave_ultra_slow_abs * -0.05; + next.main.scale = Vec3::one() + breathe * -0.05; next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0); - next.l_shoulder.scale = (Vec3::one() + wave_ultra_slow_abs * -0.05) * 1.15; + next.l_shoulder.scale = (Vec3::one() + breathe * -0.05) * 1.15; next.r_shoulder.offset = Vec3::new(5.0, 0.0, 5.0); next.r_shoulder.ori = Quaternion::rotation_x(0.0); - next.r_shoulder.scale = (Vec3::one() + wave_ultra_slow_abs * -0.05) * 1.15; + next.r_shoulder.scale = (Vec3::one() + breathe * -0.05) * 1.15; next.glider.offset = Vec3::new(0.0, 5.0, 0.0); next.glider.ori = Quaternion::rotation_y(0.0); diff --git a/voxygen/src/anim/quadruped_small/idle.rs b/voxygen/src/anim/quadruped_small/idle.rs index 9293d7cec7..59a3c2fc0c 100644 --- a/voxygen/src/anim/quadruped_small/idle.rs +++ b/voxygen/src/anim/quadruped_small/idle.rs @@ -17,11 +17,10 @@ impl Animation for IdleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave = (anim_time as f32 * 14.0).sin(); - let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); - let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos(); + let slow = (anim_time as f32 * 3.5).sin(); + let slow_alt = (anim_time as f32 * 3.5 + PI).sin(); - let pig_head_look = Vec2::new( + let head_look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) .floor() .mul(7331.0) @@ -35,17 +34,17 @@ impl Animation for IdleAnimation { ); next.head.offset = - Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + wave * 0.2) / 11.0; - next.head.ori = Quaternion::rotation_z(pig_head_look.x) - * Quaternion::rotation_x(pig_head_look.y + wave_slow_cos * 0.03); + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 0.2) / 11.0; + next.head.ori = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x(head_look.y + slow_alt * 0.03); next.head.scale = Vec3::one() / 10.5; next.chest.offset = Vec3::new( - wave_slow * 0.05, + slow * 0.05, skeleton_attr.chest.0, - skeleton_attr.chest.1 + wave_slow_cos * 0.2, + skeleton_attr.chest.1 + slow_alt * 0.2, ) / 11.0; - next.chest.ori = Quaternion::rotation_y(wave_slow * 0.05); + next.chest.ori = Quaternion::rotation_y(slow * 0.05); next.chest.scale = Vec3::one() / 11.0; next.leg_lf.offset = Vec3::new( @@ -53,7 +52,7 @@ impl Animation for IdleAnimation { skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, ) / 11.0; - next.leg_lf.ori = Quaternion::rotation_x(wave_slow * 0.08); + next.leg_lf.ori = Quaternion::rotation_x(slow * 0.08); next.leg_lf.scale = Vec3::one() / 11.0; next.leg_rf.offset = Vec3::new( @@ -61,7 +60,7 @@ impl Animation for IdleAnimation { skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, ) / 11.0; - next.leg_rf.ori = Quaternion::rotation_x(wave_slow_cos * 0.08); + next.leg_rf.ori = Quaternion::rotation_x(slow_alt * 0.08); next.leg_rf.scale = Vec3::one() / 11.0; next.leg_lb.offset = Vec3::new( @@ -69,7 +68,7 @@ impl Animation for IdleAnimation { skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, ) / 11.0; - next.leg_lb.ori = Quaternion::rotation_x(wave_slow_cos * 0.08); + next.leg_lb.ori = Quaternion::rotation_x(slow_alt * 0.08); next.leg_lb.scale = Vec3::one() / 11.0; next.leg_rb.offset = Vec3::new( @@ -77,7 +76,7 @@ impl Animation for IdleAnimation { skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, ) / 11.0; - next.leg_rb.ori = Quaternion::rotation_x(wave_slow * 0.08); + next.leg_rb.ori = Quaternion::rotation_x(slow * 0.08); next.leg_rb.scale = Vec3::one() / 11.0; next diff --git a/voxygen/src/anim/quadruped_small/run.rs b/voxygen/src/anim/quadruped_small/run.rs index 38a7cfeb58..801c66ddb4 100644 --- a/voxygen/src/anim/quadruped_small/run.rs +++ b/voxygen/src/anim/quadruped_small/run.rs @@ -1,4 +1,5 @@ use super::{super::Animation, QuadrupedSmallSkeleton, SkeletonAttr}; +use std::f32::consts::PI; use vek::*; pub struct RunAnimation; @@ -16,55 +17,55 @@ impl Animation for RunAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave = (anim_time as f32 * 14.0).sin(); - let wave_quick = (anim_time as f32 * 20.0).sin(); - let wave_quick_cos = (anim_time as f32 * 20.0).cos(); - let wave_cos = (anim_time as f32 * 14.0).cos(); + let slow = (anim_time as f32 * 14.0).sin(); + let fast = (anim_time as f32 * 20.0).sin(); + let fast_alt = (anim_time as f32 * 20.0 + PI / 2.0).sin(); + let slow_alt = (anim_time as f32 * 14.0 + PI / 2.0).sin(); next.head.offset = - Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + wave * 1.5) / 11.0; + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 1.5) / 11.0; next.head.ori = - Quaternion::rotation_x(0.2 + wave * 0.05) * Quaternion::rotation_y(wave_cos * 0.03); + Quaternion::rotation_x(0.2 + slow * 0.05) * Quaternion::rotation_y(slow_alt * 0.03); next.head.scale = Vec3::one() / 10.5; next.chest.offset = Vec3::new( 0.0, skeleton_attr.chest.0, - skeleton_attr.chest.1 + wave_cos * 1.2, + skeleton_attr.chest.1 + slow_alt * 1.2, ) / 11.0; - next.chest.ori = Quaternion::rotation_x(wave * 0.1); + next.chest.ori = Quaternion::rotation_x(slow * 0.1); next.chest.scale = Vec3::one() / 11.0; next.leg_lf.offset = Vec3::new( -skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1 + wave_quick * 0.8, - skeleton_attr.feet_f.2 + wave_quick_cos * 1.5, + skeleton_attr.feet_f.1 + fast * 0.8, + skeleton_attr.feet_f.2 + fast_alt * 1.5, ) / 11.0; - next.leg_lf.ori = Quaternion::rotation_x(wave_quick * 0.3); + next.leg_lf.ori = Quaternion::rotation_x(fast * 0.3); next.leg_lf.scale = Vec3::one() / 11.0; next.leg_rf.offset = Vec3::new( skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1 - wave_quick_cos * 0.8, - skeleton_attr.feet_f.2 + wave_quick * 1.5, + skeleton_attr.feet_f.1 + fast_alt * -0.8, + skeleton_attr.feet_f.2 + fast * 1.5, ) / 11.0; - next.leg_rf.ori = Quaternion::rotation_x(wave_quick_cos * -0.3); + next.leg_rf.ori = Quaternion::rotation_x(fast_alt * -0.3); next.leg_rf.scale = Vec3::one() / 11.0; next.leg_lb.offset = Vec3::new( -skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1 - wave_quick_cos * 0.8, - skeleton_attr.feet_b.2 + wave_quick * 1.5, + skeleton_attr.feet_b.1 + fast_alt * -0.8, + skeleton_attr.feet_b.2 + fast * 1.5, ) / 11.0; - next.leg_lb.ori = Quaternion::rotation_x(wave_quick_cos * -0.3); + next.leg_lb.ori = Quaternion::rotation_x(fast_alt * -0.3); next.leg_lb.scale = Vec3::one() / 11.0; next.leg_rb.offset = Vec3::new( skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1 + wave_quick * 0.8, - skeleton_attr.feet_b.2 + wave_quick_cos * 1.5, + skeleton_attr.feet_b.1 + fast * 0.8, + skeleton_attr.feet_b.2 + fast_alt * 1.5, ) / 11.0; - next.leg_rb.ori = Quaternion::rotation_x(wave_quick * 0.3); + next.leg_rb.ori = Quaternion::rotation_x(fast * 0.3); next.leg_rb.scale = Vec3::one() / 11.0; next From 0d2b26a3b85971af0e4d8567ba5327f9baf8f532 Mon Sep 17 00:00:00 2001 From: Shane Handley Date: Tue, 25 Feb 2020 22:00:48 +0900 Subject: [PATCH 047/387] SFX Fixes - Reinstate run, uncomment tests and make them pass, adjust config. --- assets/voxygen/audio/sfx.ron | 10 +- common/src/event.rs | 4 - .../audio/sfx/event_mapper/movement/mod.rs | 119 +++-- .../audio/sfx/event_mapper/movement/tests.rs | 475 ++++++++++-------- 4 files changed, 357 insertions(+), 251 deletions(-) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index 38349f287e..53dbe54287 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -9,7 +9,7 @@ "voxygen.audio.sfx.footsteps.stepgrass_5", "voxygen.audio.sfx.footsteps.stepgrass_6", ], - threshold: 0.25, + threshold: 0.4, ), GliderOpen: ( files: [ @@ -23,17 +23,17 @@ ], threshold: 0.5, ), - Wield(Sword): ( + Wield(Sword(Rapier)): ( files: [ "voxygen.audio.sfx.weapon.sword_out", ], - threshold: 0.5, + threshold: 1.0, ), - Unwield(Sword): ( + Unwield(Sword(Rapier)): ( files: [ "voxygen.audio.sfx.weapon.sword_in", ], - threshold: 0.5, + threshold: 1.0, ), } ) \ No newline at end of file diff --git a/common/src/event.rs b/common/src/event.rs index dc8e596050..53ac827c01 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -39,10 +39,6 @@ pub enum SfxEvent { Fall, ExperienceGained, LevelUp, - LightLantern, - ExtinguishLantern, - Attack, - AttackWolf, Wield(comp::item::ToolKind), Unwield(comp::item::ToolKind), } diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 05191d9049..87479d6c01 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -5,7 +5,7 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use client::Client; use common::{ - comp::{Body, CharacterState, Item, ItemKind, Pos, Stats, ToolData, Vel}, + comp::{Body, CharacterState, Item, ItemKind, PhysicsState, Pos, Stats, ToolData, Vel}, event::{EventBus, SfxEvent, SfxEventItem}, }; use hashbrown::HashMap; @@ -14,14 +14,26 @@ use std::time::{Duration, Instant}; use vek::*; #[derive(Clone)] -struct LastSfxEvent { +struct PreviousEntityState { event: SfxEvent, - weapon_drawn: bool, time: Instant, + weapon_drawn: bool, + on_ground: bool, +} + +impl Default for PreviousEntityState { + fn default() -> Self { + Self { + event: SfxEvent::Idle, + time: Instant::now(), + weapon_drawn: false, + on_ground: true, + } + } } pub struct MovementEventMapper { - event_history: HashMap, + event_history: HashMap, } impl MovementEventMapper { @@ -40,12 +52,13 @@ impl MovementEventMapper { .get(client.entity()) .map_or(Vec3::zero(), |pos| pos.0); - for (entity, pos, vel, body, stats, character) in ( + for (entity, pos, vel, body, stats, physics, character) in ( &ecs.entities(), &ecs.read_storage::(), &ecs.read_storage::(), &ecs.read_storage::(), &ecs.read_storage::(), + &ecs.read_storage::(), ecs.read_storage::().maybe(), ) .join() @@ -57,21 +70,17 @@ impl MovementEventMapper { let state = self .event_history .entry(entity) - .or_insert_with(|| LastSfxEvent { - event: SfxEvent::Idle, - weapon_drawn: false, - time: Instant::now(), - }); + .or_insert_with(|| PreviousEntityState::default()); let mapped_event = match body { - Body::Humanoid(_) => Self::map_movement_event(character, state, vel.0, stats), + Body::Humanoid(_) => { + Self::map_movement_event(character, physics, state, vel.0, stats) + }, Body::QuadrupedMedium(_) | Body::QuadrupedSmall(_) | Body::BirdMedium(_) | Body::BirdSmall(_) - | Body::BipedLarge(_) => { - Self::map_non_humanoid_movement_event(character, vel.0) - }, + | Body::BipedLarge(_) => Self::map_non_humanoid_movement_event(physics, vel.0), _ => SfxEvent::Idle, // Ignore fish, critters, etc... }; @@ -85,14 +94,16 @@ impl MovementEventMapper { Some(Self::get_volume_for_body_type(body)), )); - // Update the last play time + // Set the new previous entity state state.event = mapped_event; state.time = Instant::now(); - state.weapon_drawn = character.is_wielded(); + state.weapon_drawn = Self::weapon_drawn(character); + state.on_ground = physics.on_ground; } else { - // Keep the last event, it may not have an SFX trigger but it helps us determine - // the next one + // If we don't dispatch the event, store this data as we can use it to determine + // the next event state.event = mapped_event; + state.on_ground = physics.on_ground; } } } @@ -121,12 +132,12 @@ impl MovementEventMapper { /// file(s) to play) 2. The sfx has not been played since it's timeout /// threshold has elapsed, which prevents firing every tick fn should_emit( - last_play_entry: &LastSfxEvent, + previous_state: &PreviousEntityState, sfx_trigger_item: Option<(&SfxEvent, &SfxTriggerItem)>, ) -> bool { if let Some((event, item)) = sfx_trigger_item { - if &last_play_entry.event == event { - last_play_entry.time.elapsed().as_secs_f64() >= item.threshold + if &previous_state.event == event { + previous_state.time.elapsed().as_secs_f64() >= item.threshold } else { true } @@ -141,8 +152,9 @@ impl MovementEventMapper { /// entity states with some additional data into more specific /// `SfxEvent`'s which we attach sounds to fn map_movement_event( - current_event: &CharacterState, - previous_event: &LastSfxEvent, + character_state: &CharacterState, + physics_state: &PhysicsState, + previous_state: &PreviousEntityState, vel: Vec3, stats: &Stats, ) -> SfxEvent { @@ -154,19 +166,42 @@ impl MovementEventMapper { .. }) = stats.equipment.main { - if let Some(wield_event) = - match (previous_event.weapon_drawn, current_event.is_wielded()) { - (false, true) => Some(SfxEvent::Wield(kind)), - (true, false) => Some(SfxEvent::Unwield(kind)), - _ => None, - } - { + if let Some(wield_event) = match ( + previous_state.weapon_drawn, + Self::weapon_drawn(character_state), + ) { + (false, true) => Some(SfxEvent::Wield(kind)), + (true, false) => Some(SfxEvent::Unwield(kind)), + _ => None, + } { return wield_event; } } + // Match the fall/land and jump states based on the on_ground status + // They may also have landed on the ground with the glider (!jump) + if let Some(jump_or_fall_event) = match (physics_state.on_ground, previous_state.on_ground) + { + (true, false) => { + if previous_state.event == SfxEvent::Glide { + Some(SfxEvent::GliderClose) + } else { + Some(SfxEvent::Run) + } + }, + (false, true) => Some(SfxEvent::Jump), + _ => None, + } { + return jump_or_fall_event; + } + + // Match run state + if physics_state.on_ground && vel.magnitude() > 0.1 { + return SfxEvent::Run; + } + // Match all other Movemement and Action states - match (previous_event.event, current_event) { + match (previous_state.event, character_state) { (_, CharacterState::Roll(_)) => SfxEvent::Roll, (_, CharacterState::Climb(_)) => SfxEvent::Climb, (SfxEvent::Glide, CharacterState::Idle(_)) => SfxEvent::GliderClose, @@ -182,18 +217,26 @@ impl MovementEventMapper { } /// Maps a limited set of movements for other non-humanoid entities - fn map_non_humanoid_movement_event(current_event: &CharacterState, vel: Vec3) -> SfxEvent { - if let CharacterState::Idle(_) = current_event { - if vel.magnitude() > 0.1 { - SfxEvent::Run - } else { - SfxEvent::Idle - } + fn map_non_humanoid_movement_event(physics_state: &PhysicsState, vel: Vec3) -> SfxEvent { + if physics_state.on_ground && vel.magnitude() > 0.1 { + SfxEvent::Run } else { SfxEvent::Idle } } + /// This helps us determine whether we should be emitting the Wield/Unwield + /// events. For now, consider either CharacterState::Wielded or + /// ::Wielding to mean the weapon is drawn. This will need updating if the + /// animations change to match the wield_duration associated with the weapon + fn weapon_drawn(character: &CharacterState) -> bool { + character.is_wielded() + || match character { + CharacterState::Wielding(_) => true, + _ => false, + } + } + /// Returns a relative volume value for a body type. This helps us emit sfx /// at a volume appropriate fot the entity we are emitting the event for fn get_volume_for_body_type(body: &Body) -> f32 { diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 9e147467bc..5d898ca73f 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -3,7 +3,7 @@ use common::{ assets, comp::{ bird_small, humanoid, item::ToolKind, quadruped_medium, quadruped_small, Body, - CharacterState, Stats, + CharacterState, PhysicsState, Stats, }, event::SfxEvent, }; @@ -11,34 +11,29 @@ use std::time::{Duration, Instant}; #[test] fn no_item_config_no_emit() { - let last_sfx_event = LastSfxEvent { - event: SfxEvent::Idle, - weapon_drawn: false, - time: Instant::now(), - }; - - let result = MovementEventMapper::should_emit(&last_sfx_event, None); + let previous_state = PreviousEntityState::default(); + let result = MovementEventMapper::should_emit(&previous_state, None); assert_eq!(result, false); } #[test] fn config_but_played_since_threshold_no_emit() { - let event = SfxEvent::Run; - let trigger_item = SfxTriggerItem { files: vec![String::from("some.path.to.sfx.file")], threshold: 1.0, }; // Triggered a 'Run' 0 seconds ago - let last_sfx_event = LastSfxEvent { + let previous_state = PreviousEntityState { event: SfxEvent::Run, - weapon_drawn: false, time: Instant::now(), + weapon_drawn: false, + on_ground: true, }; - let result = MovementEventMapper::should_emit(&last_sfx_event, Some((&event, &trigger_item))); + let result = + MovementEventMapper::should_emit(&previous_state, Some((&SfxEvent::Run, &trigger_item))); assert_eq!(result, false); } @@ -52,35 +47,37 @@ fn config_and_not_played_since_threshold_emits() { threshold: 0.5, }; - let last_sfx_event = LastSfxEvent { + let previous_state = PreviousEntityState { event: SfxEvent::Idle, - weapon_drawn: false, time: Instant::now().checked_add(Duration::from_secs(1)).unwrap(), + weapon_drawn: false, + on_ground: true, }; - let result = MovementEventMapper::should_emit(&last_sfx_event, Some((&event, &trigger_item))); + let result = + MovementEventMapper::should_emit(&previous_state, Some((&SfxEvent::Run, &trigger_item))); assert_eq!(result, true); } #[test] fn same_previous_event_elapsed_emits() { - let event = SfxEvent::Run; - let trigger_item = SfxTriggerItem { files: vec![String::from("some.path.to.sfx.file")], threshold: 0.5, }; - let last_sfx_event = LastSfxEvent { + let previous_state = PreviousEntityState { event: SfxEvent::Run, - weapon_drawn: false, time: Instant::now() .checked_sub(Duration::from_millis(500)) .unwrap(), + weapon_drawn: false, + on_ground: true, }; - let result = MovementEventMapper::should_emit(&last_sfx_event, Some((&event, &trigger_item))); + let result = + MovementEventMapper::should_emit(&previous_state, Some((&SfxEvent::Run, &trigger_item))); assert_eq!(result, true); } @@ -95,10 +92,17 @@ fn maps_idle() { let result = MovementEventMapper::map_movement_event( &CharacterState::Idle(None), - &LastSfxEvent { + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { event: SfxEvent::Idle, - weapon_drawn: false, time: Instant::now(), + weapon_drawn: false, + on_ground: true, }, Vec3::zero(), &stats, @@ -107,55 +111,92 @@ fn maps_idle() { assert_eq!(result, SfxEvent::Idle); } -// #[test] -// fn maps_run_with_sufficient_velocity() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); +#[test] +fn maps_run_with_sufficient_velocity() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Run, -// action: ActionState::Idle, -// }, -// &LastSfxEvent { -// event: SfxEvent::Idle, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::new(0.5, 0.8, 0.0), -// &stats, -// ); + let result = MovementEventMapper::map_movement_event( + &CharacterState::Idle(None), + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Idle, + time: Instant::now(), + weapon_drawn: false, + on_ground: true, + }, + Vec3::new(0.5, 0.8, 0.0), + &stats, + ); -// assert_eq!(result, SfxEvent::Run); -// } + assert_eq!(result, SfxEvent::Run); +} -// #[test] -// fn does_not_map_run_with_insufficient_velocity() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); +#[test] +fn does_not_map_run_with_insufficient_velocity() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Run, -// action: ActionState::Idle, -// }, -// &LastSfxEvent { -// event: SfxEvent::Idle, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::new(0.02, 0.0001, 0.0), -// &stats, -// ); + let result = MovementEventMapper::map_movement_event( + &CharacterState::Idle(None), + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Idle, + time: Instant::now(), + weapon_drawn: false, + on_ground: true, + }, + Vec3::new(0.02, 0.0001, 0.0), + &stats, + ); -// assert_eq!(result, SfxEvent::Idle); -// } + assert_eq!(result, SfxEvent::Idle); +} + +#[test] +fn does_not_map_run_with_sufficient_velocity_but_not_on_ground() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); + + let result = MovementEventMapper::map_movement_event( + &CharacterState::Idle(None), + &PhysicsState { + on_ground: false, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Idle, + time: Instant::now(), + weapon_drawn: false, + on_ground: false, + }, + Vec3::new(0.5, 0.8, 0.0), + &stats, + ); + + assert_eq!(result, SfxEvent::Idle); +} #[test] fn maps_roll() { @@ -167,10 +208,17 @@ fn maps_roll() { let result = MovementEventMapper::map_movement_event( &CharacterState::Roll(None), - &LastSfxEvent { + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { event: SfxEvent::Run, - weapon_drawn: false, time: Instant::now(), + weapon_drawn: false, + on_ground: true, }, Vec3::zero(), &stats, @@ -179,55 +227,34 @@ fn maps_roll() { assert_eq!(result, SfxEvent::Roll); } -// #[test] -// fn maps_fall() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); +#[test] +fn maps_land_on_ground_to_run() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Fall, -// action: ActionState::Idle, -// }, -// &LastSfxEvent { -// event: SfxEvent::Fall, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::zero(), -// &stats, -// ); + let result = MovementEventMapper::map_movement_event( + &CharacterState::Idle(None), + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Idle, + time: Instant::now(), + weapon_drawn: false, + on_ground: false, + }, + Vec3::zero(), + &stats, + ); -// assert_eq!(result, SfxEvent::Fall); -// } - -// #[test] -// fn maps_land_on_ground_to_run() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); - -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Stand, -// action: ActionState::Idle, -// }, -// &LastSfxEvent { -// event: SfxEvent::Fall, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::zero(), -// &stats, -// ); - -// assert_eq!(result, SfxEvent::Run); -// } + assert_eq!(result, SfxEvent::Run); +} #[test] fn maps_glider_open() { @@ -239,10 +266,17 @@ fn maps_glider_open() { let result = MovementEventMapper::map_movement_event( &CharacterState::Glide(None), - &LastSfxEvent { + &PhysicsState { + on_ground: false, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { event: SfxEvent::Jump, - weapon_drawn: false, time: Instant::now(), + weapon_drawn: false, + on_ground: false, }, Vec3::zero(), &stats, @@ -261,10 +295,17 @@ fn maps_glide() { let result = MovementEventMapper::map_movement_event( &CharacterState::Glide(None), - &LastSfxEvent { + &PhysicsState { + on_ground: false, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { event: SfxEvent::Glide, - weapon_drawn: false, time: Instant::now(), + weapon_drawn: false, + on_ground: false, }, Vec3::zero(), &stats, @@ -273,55 +314,63 @@ fn maps_glide() { assert_eq!(result, SfxEvent::Glide); } -// #[test] -// fn maps_glider_close_when_closing_mid_flight() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); +#[test] +fn maps_glider_close_when_closing_mid_flight() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Fall, -// action: ActionState::Idle, -// }, -// &LastSfxEvent { -// event: SfxEvent::Glide, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::zero(), -// &stats, -// ); + let result = MovementEventMapper::map_movement_event( + &CharacterState::Idle(None), + &PhysicsState { + on_ground: false, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Glide, + time: Instant::now(), + weapon_drawn: false, + on_ground: false, + }, + Vec3::zero(), + &stats, + ); -// assert_eq!(result, SfxEvent::GliderClose); -// } + assert_eq!(result, SfxEvent::GliderClose); +} -// #[test] -// fn maps_glider_close_when_landing() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); +#[test] +fn maps_glider_close_when_landing() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Stand, -// action: ActionState::Idle, -// }, -// &LastSfxEvent { -// event: SfxEvent::Glide, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::zero(), -// &stats, -// ); + let result = MovementEventMapper::map_movement_event( + &CharacterState::Idle(None), + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Glide, + time: Instant::now(), + weapon_drawn: false, + on_ground: false, + }, + Vec3::zero(), + &stats, + ); -// assert_eq!(result, SfxEvent::GliderClose); -// } + assert_eq!(result, SfxEvent::GliderClose); +} #[test] fn maps_wield() { @@ -334,11 +383,18 @@ fn maps_wield() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::BasicAttack(None), - &LastSfxEvent { + &CharacterState::Wielding(None), + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { event: SfxEvent::Idle, - weapon_drawn: false, time: Instant::now(), + weapon_drawn: false, + on_ground: true, }, Vec3::zero(), &stats, @@ -359,10 +415,17 @@ fn maps_unwield() { let result = MovementEventMapper::map_movement_event( &CharacterState::default(), - &LastSfxEvent { + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { event: SfxEvent::Idle, - weapon_drawn: true, time: Instant::now(), + weapon_drawn: true, + on_ground: true, }, Vec3::zero(), &stats, @@ -371,45 +434,49 @@ fn maps_unwield() { assert_eq!(result, SfxEvent::Unwield(ToolKind::Bow)); } -// #[test] -// fn does_not_map_wield_when_no_main_weapon() { -// let stats = Stats::new( -// String::from("test"), -// Body::Humanoid(humanoid::Body::random()), -// None, -// ); +#[test] +fn does_not_map_wield_when_no_main_weapon() { + let stats = Stats::new( + String::from("test"), + Body::Humanoid(humanoid::Body::random()), + None, + ); -// let result = MovementEventMapper::map_movement_event( -// &CharacterState { -// movement: MovementState::Run, -// action: ActionState::Wield { -// time_left: Duration::from_millis(600), -// }, -// }, -// &LastSfxEvent { -// event: SfxEvent::Idle, -// weapon_drawn: false, -// time: Instant::now(), -// }, -// Vec3::new(0.5, 0.8, 0.0), -// &stats, -// ); + let result = MovementEventMapper::map_movement_event( + &CharacterState::Wielded(None), + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + &PreviousEntityState { + event: SfxEvent::Idle, + time: Instant::now(), + weapon_drawn: false, + on_ground: true, + }, + Vec3::new(0.5, 0.8, 0.0), + &stats, + ); -// assert_eq!(result, SfxEvent::Run); -// } + assert_eq!(result, SfxEvent::Run); +} -// #[test] -// fn maps_quadrupeds_running() { -// let result = MovementEventMapper::map_non_humanoid_movement_event( -// &CharacterState { -// movement: MovementState::Run, -// action: ActionState::Idle, -// }, -// Vec3::new(0.5, 0.8, 0.0), -// ); +#[test] +fn maps_quadrupeds_running() { + let result = MovementEventMapper::map_non_humanoid_movement_event( + &PhysicsState { + on_ground: true, + on_wall: None, + touch_entity: None, + in_fluid: false, + }, + Vec3::new(0.5, 0.8, 0.0), + ); -// assert_eq!(result, SfxEvent::Run); -// } + assert_eq!(result, SfxEvent::Run); +} #[test] fn determines_relative_volumes() { From 9f7aa61fbdda4c00aba10752312e32cb30ff5c5c Mon Sep 17 00:00:00 2001 From: Caleb Cochran Date: Tue, 25 Feb 2020 20:48:09 -0600 Subject: [PATCH 048/387] Fixing #504 - Enemies stop attacking after combat --- common/src/sys/agent.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index f2268d439c..3d126f4ecd 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -124,7 +124,7 @@ impl<'a> System<'a> for Sys { if thread_rng().gen::() < 0.1 { choose_target = true; } - }, + } Activity::Follow(target, chaser) => { if let (Some(tgt_pos), _tgt_stats) = (positions.get(*target), stats.get(*target)) @@ -146,14 +146,14 @@ impl<'a> System<'a> for Sys { } else { do_idle = true; } - }, + } Activity::Attack { target, chaser, been_close, .. } => { - if let (Some(tgt_pos), _tgt_stats, tgt_alignment) = ( + if let (Some(tgt_pos), Some(tgt_stats), tgt_alignment) = ( positions.get(*target), stats.get(*target), alignments @@ -164,7 +164,8 @@ impl<'a> System<'a> for Sys { // Don't attack entities we are passive towards // TODO: This is here, it's a bit of a hack if let Some(alignment) = alignment { - if (*alignment).passive_towards(tgt_alignment) { + if (*alignment).passive_towards(tgt_alignment) || tgt_stats.is_dead + { do_idle = true; break 'activity; } @@ -207,7 +208,7 @@ impl<'a> System<'a> for Sys { } else { do_idle = true; } - }, + } } } From 8479230e66881ffd9ded183948048da94f9b9ee1 Mon Sep 17 00:00:00 2001 From: Caleb Cochran Date: Tue, 25 Feb 2020 21:59:08 -0600 Subject: [PATCH 049/387] Replaced commas (fmt issue) --- common/src/sys/agent.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 3d126f4ecd..07788bf1a2 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -124,7 +124,7 @@ impl<'a> System<'a> for Sys { if thread_rng().gen::() < 0.1 { choose_target = true; } - } + }, Activity::Follow(target, chaser) => { if let (Some(tgt_pos), _tgt_stats) = (positions.get(*target), stats.get(*target)) @@ -146,7 +146,7 @@ impl<'a> System<'a> for Sys { } else { do_idle = true; } - } + }, Activity::Attack { target, chaser, From 219f9fa3be17563c2377323f0f08c74cef8b57da Mon Sep 17 00:00:00 2001 From: Caleb Cochran Date: Tue, 25 Feb 2020 22:01:51 -0600 Subject: [PATCH 050/387] Added missed comma --- common/src/sys/agent.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 07788bf1a2..9d8415ea28 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -208,7 +208,7 @@ impl<'a> System<'a> for Sys { } else { do_idle = true; } - } + }, } } From 89dd2fbaa067e4a1cfc6bcc24f42c73e6ded26a3 Mon Sep 17 00:00:00 2001 From: Caleb Cochran Date: Tue, 25 Feb 2020 22:41:58 -0600 Subject: [PATCH 051/387] Added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 055492a259..71ac390130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added gamma setting - Added new orc hairstyles - Added sfx for wielding/unwielding weapons +- Fixed NPCs attacking the player forever after killing them ### Changed From 1fbdb9c59067de5a13724d1fb72a3f096f6ea960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Wed, 26 Feb 2020 00:10:00 +0100 Subject: [PATCH 052/387] auto-generated docker image for server-cli based on kaniko like i researched for torvus and correct release branch detection: - https://gitlab.com/veloren/torvus/-/commit/ade4d375756ffa1eb1ac32f25aec3c6738bed6cc --- .gitlab-ci.yml | 49 ++++++++++++++++++++++++++++------- server-cli/Dockerfile | 8 ++++++ server-cli/docker-compose.yml | 17 ++++++++++++ server-cli/docker-run.sh | 3 +++ 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 server-cli/Dockerfile create mode 100644 server-cli/docker-compose.yml create mode 100755 server-cli/docker-run.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 813eabf4c0..b90be89601 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,8 @@ variables: stages: - optional-builds - check-compile - - post + - build-post + - publish before_script: - source $HOME/.cargo/env @@ -90,10 +91,10 @@ security: # -- -# -- post build +# -- build-post unittests: - stage: post + stage: build-post when: delayed start_in: 5 seconds tags: @@ -103,7 +104,7 @@ unittests: - cargo test || cargo test || cargo test || cargo test coverage: - stage: post + stage: build-post when: delayed start_in: 5 seconds tags: @@ -113,7 +114,7 @@ coverage: - cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v benchmarks: - stage: post + stage: build-post when: delayed start_in: 5 seconds tags: @@ -125,7 +126,7 @@ benchmarks: localization-status: variables: GIT_DEPTH: 0 - stage: post + stage: build-post when: delayed start_in: 5 seconds allow_failure: true @@ -135,14 +136,15 @@ localization-status: - cargo test -q test_all_localizations -- --nocapture --ignored linux: - stage: post + stage: build-post when: delayed start_in: 5 seconds only: refs: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - - /^v[0-9]+\.[0-9]+\.[0-9]+/ + - /^v[0-9]+\.[0-9]+/ - /^master$/ + - /^docker-server$/ tags: - veloren-docker script: @@ -160,13 +162,13 @@ linux: expire_in: 1 week windows: - stage: post + stage: build-post when: delayed start_in: 5 seconds only: refs: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - - /^v[0-9]+\.[0-9]+\.[0-9]+/ + - /^v[0-9]+\.[0-9]+/ - /^master$/ tags: - veloren-docker @@ -182,3 +184,30 @@ windows: - LICENSE expire_in: 1 week # -- + +# -- publish + +docker: + stage: publish + when: delayed + start_in: 5 seconds + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + dependencies: + - linux + before_script: + - ls "$CI_PROJECT_DIR/server-cli/" + only: + refs: + - /^r[0-9]+\.[0-9]+\.[0-9]+/ + - /^v[0-9]+\.[0-9]+/ + - /^master$/ + - /^docker-server$/ + tags: + - veloren-docker + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-server" + +# -- diff --git a/server-cli/Dockerfile b/server-cli/Dockerfile new file mode 100644 index 0000000000..eacecc7846 --- /dev/null +++ b/server-cli/Dockerfile @@ -0,0 +1,8 @@ +FROM debian:stable-slim + +ARG PROJECTNAME=server-cli + +COPY ./server-cli/docker-run.sh /opt/docker-run.sh +COPY ./veloren-server-cli /opt/veloren-server-cli +COPY ./assets/common /opt/assets/common +COPY ./assets/world /opt/assets/world diff --git a/server-cli/docker-compose.yml b/server-cli/docker-compose.yml new file mode 100644 index 0000000000..ba9badf7de --- /dev/null +++ b/server-cli/docker-compose.yml @@ -0,0 +1,17 @@ +version: "3.7" + +services: + game-server: + image: registry.gitlab.com/veloren/veloren:master-server + ports: + - "14004:14004" + - "14005:14005" + deploy: + replicas: 1 + update_config: + parallelism: 2 + delay: 10s + order: stop-first + failure_action: rollback + restart_policy: + condition: on-failure diff --git a/server-cli/docker-run.sh b/server-cli/docker-run.sh new file mode 100755 index 0000000000..e965090fdb --- /dev/null +++ b/server-cli/docker-run.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd /opt +RUST_LOG=info,common=debug,common::net=info RUST_BACKTRACE=1 /opt/veloren-server-cli From bf14deb5e0fa6ffc0eed6ac230def9cd7e9d423a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Wed, 26 Feb 2020 17:10:47 +0100 Subject: [PATCH 053/387] automated macos builds --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b90be89601..353ec24fb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -183,6 +183,30 @@ windows: - assets/ - LICENSE expire_in: 1 week + +macos: + stage: build-post + when: delayed + start_in: 5 seconds + only: + refs: + - /^r[0-9]+\.[0-9]+\.[0-9]+/ + - /^v[0-9]+\.[0-9]+/ + - /^master$/ + - /^docker-server$/ + tags: + - veloren-docker + script: + - PATH="/dockercache/osxcross/target/bin:$PATH" COREAUDIO_SDK_PATH=/dockercache/osxcross/target/SDK/MacOSX10.13.sdk CC=o64-clang CXX=o64-clang++ cargo build --target x86_64-apple-darwin --release + - cp -r target/x86_64-apple-darwin/release/veloren-server-cli $CI_PROJECT_DIR + - cp -r target/x86_64-apple-darwin/release/veloren-voxygen $CI_PROJECT_DIR + artifacts: + paths: + - veloren-server-cli + - veloren-voxygen + - assets/ + - LICENSE + expire_in: 1 week # -- # -- publish From 0cb0328c79fb341eff6d2b4b2d8948700c9e0851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Thu, 27 Feb 2020 13:43:43 +0100 Subject: [PATCH 054/387] workaround for tests and tarpaulin --- .gitlab-ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 353ec24fb0..0a93f8de07 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,7 +101,7 @@ unittests: - veloren-docker script: - echo "Workaround, cargo tests fails due some rust files are already deleted, so we just stack cargo test. if its the os error, it wont appear on them all, if its a real error, it will retry and then fail" - - cargo test || cargo test || cargo test || cargo test + - cargo test || ( sleep 10 && cargo test ) || ( sleep 10 && cargo test ) || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test || cargo test coverage: stage: build-post @@ -111,7 +111,7 @@ coverage: - veloren-docker script: - echo "Workaround, tarpaulin fails due some rust files are already deleted, so we just stack tarpaulin. if its the os error, it wont appear on them all, if its a real error, it will retry and then fail" - - cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v + - cargo tarpaulin -v || ( sleep 10 && cargo tarpaulin -v ) || ( sleep 10 && cargo tarpaulin -v ) || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v || cargo tarpaulin -v benchmarks: stage: build-post @@ -144,7 +144,6 @@ linux: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+/ - /^master$/ - - /^docker-server$/ tags: - veloren-docker script: @@ -193,7 +192,6 @@ macos: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+/ - /^master$/ - - /^docker-server$/ tags: - veloren-docker script: @@ -227,7 +225,6 @@ docker: - /^r[0-9]+\.[0-9]+\.[0-9]+/ - /^v[0-9]+\.[0-9]+/ - /^master$/ - - /^docker-server$/ tags: - veloren-docker script: From ce7b9a84b84c1ea44bf60741ee10f64063f3f327 Mon Sep 17 00:00:00 2001 From: Artem Polishchuk Date: Sun, 17 Nov 2019 21:04:37 +0200 Subject: [PATCH 055/387] Add desktop file and AppData manifest Fix screenshot duplicate in appdata Move .png icon to git lfs --- .../voxygen/net.veloren.veloren.appdata.xml | 61 +++++++++++++++++++ assets/voxygen/net.veloren.veloren.desktop | 9 +++ assets/voxygen/net.veloren.veloren.png | 3 + 3 files changed, 73 insertions(+) create mode 100644 assets/voxygen/net.veloren.veloren.appdata.xml create mode 100644 assets/voxygen/net.veloren.veloren.desktop create mode 100644 assets/voxygen/net.veloren.veloren.png diff --git a/assets/voxygen/net.veloren.veloren.appdata.xml b/assets/voxygen/net.veloren.veloren.appdata.xml new file mode 100644 index 0000000000..1192abe8fc --- /dev/null +++ b/assets/voxygen/net.veloren.veloren.appdata.xml @@ -0,0 +1,61 @@ + + + + net.veloren.veloren.desktop + CC0-1.0 + GPL-3.0-or-later + + intense + mild + mild + mild + + Veloren + + Veloren is a multiplayer voxel RPG written in Rust. It is inspired + by games such as Cube World, Legend of Zelda: Breath of the Wild, + Dwarf Fortress and Minecraft. + + +

+ Welcome To Veloren! +

+ Veloren is a multiplayer voxel RPG written in Rust. Veloren takes + inspiration from games such as Cube World, Minecraft and Dwarf + Fortress. The game is currently under heavy development, but is + playable. +

+ Development +

+ Currently the communication of contributors happens mainly on our + official Discord server (https://discord.gg/kjwJwjK). You can join + it to keep up with the development, talk to us or contribute + something yourself. Anyone who shows genuine effort to help is + welcome in our team. You don't have to know how to program to + contribute! +

+
+ + + https://media.discordapp.net/attachments/634860358623821835/643034796548947968/screenshot_1573381825305.png + + + https://media.discordapp.net/attachments/597826574095613962/643102462781423616/screenshot_1573397958545.png + + + https://cdn.discordapp.com/attachments/634860358623821835/646518917577310219/screenshot_1574211401431.png + + + + sandbox + world + multiplayer + + https://veloren.net + https://gitlab.com/veloren/veloren/issues + https://gitlab.com/veloren/veloren#faq + https://book.veloren.net/ + + veloren-voxygen + +
diff --git a/assets/voxygen/net.veloren.veloren.desktop b/assets/voxygen/net.veloren.veloren.desktop new file mode 100644 index 0000000000..5e4f2cd02e --- /dev/null +++ b/assets/voxygen/net.veloren.veloren.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Veloren +Comment=Veloren is a multiplayer voxel RPG written in Rust +Exec=veloren-voxygen +Categories=Game;Simulation; +Keywords=veloren;sandbox;world;blocks;nodes;multiplayer;roleplaying; +Icon=net.veloren.veloren.png +Terminal=false diff --git a/assets/voxygen/net.veloren.veloren.png b/assets/voxygen/net.veloren.veloren.png new file mode 100644 index 0000000000..c849ca552b --- /dev/null +++ b/assets/voxygen/net.veloren.veloren.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7162cb9f05336af0b35e7b8e923716161dc4df418c8e3fd9918c71ad5a875201 +size 33292 From daa0a10c2c526e92745c413bb97abe31477662fd Mon Sep 17 00:00:00 2001 From: S Handley Date: Sun, 1 Mar 2020 19:45:05 +0000 Subject: [PATCH 056/387] Revert "Do that better, and add a TODO." This reverts commit 9b0f11bd8922491bf2c2a9b4422d59982b227564. It wasn't better. --- voxygen/src/audio/sfx/event_mapper/movement/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 0b0294ecec..77c2067177 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -157,10 +157,11 @@ impl MovementEventMapper { { if let Some(wield_event) = match ( previous_event.weapon_drawn, + current_event.action.is_roll(), Self::has_weapon_drawn(current_event.action), ) { - (false, true) => Some(SfxEvent::Wield(kind)), - (true, false) => Some(SfxEvent::Unwield(kind)), + (false, false, true) => Some(SfxEvent::Wield(kind)), + (true, false, false) => Some(SfxEvent::Unwield(kind)), _ => None, } { return wield_event; From b0ca85069b418199a71d595ac1b43984e99419fc Mon Sep 17 00:00:00 2001 From: S Handley Date: Wed, 4 Mar 2020 10:09:48 +0000 Subject: [PATCH 057/387] Piggyback on the InventoryUpdate events and attach some additional event info so that we can detect why the inventory update was triggered, and emit an associated sfx event that matches it. --- CHANGELOG.md | 1 + assets/voxygen/audio/sfx.ron | 54 +++++++++++++++++++ .../voxygen/audio/sfx/inventory/add_item.wav | 3 ++ .../audio/sfx/inventory/consumable/apple.wav | 3 ++ .../audio/sfx/inventory/consumable/food.wav | 3 ++ .../audio/sfx/inventory/consumable/liquid.wav | 3 ++ client/src/lib.rs | 12 ++++- common/src/comp/inventory/item.rs | 2 +- common/src/comp/inventory/mod.rs | 36 +++++++++++-- common/src/comp/mod.rs | 2 +- common/src/event.rs | 3 +- common/src/msg/server.rs | 2 +- server/src/cmd.rs | 11 +++- server/src/events/interaction.rs | 5 +- server/src/events/inventory_manip.rs | 22 ++++++-- server/src/lib.rs | 10 +++- server/src/sys/entity_sync.rs | 7 ++- voxygen/src/audio/sfx/event_mapper/mod.rs | 4 +- .../audio/sfx/event_mapper/movement/mod.rs | 2 +- 19 files changed, 159 insertions(+), 26 deletions(-) create mode 100644 assets/voxygen/audio/sfx/inventory/add_item.wav create mode 100644 assets/voxygen/audio/sfx/inventory/consumable/apple.wav create mode 100644 assets/voxygen/audio/sfx/inventory/consumable/food.wav create mode 100644 assets/voxygen/audio/sfx/inventory/consumable/liquid.wav diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ac390130..0e3ca83fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added new orc hairstyles - Added sfx for wielding/unwielding weapons - Fixed NPCs attacking the player forever after killing them +- Added sfx for collecting, dropping and using inventory items ### Changed diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index 38349f287e..2a8d79e5e2 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -35,5 +35,59 @@ ], threshold: 0.5, ), + Inventory(Collected): ( + files: [ + "voxygen.audio.sfx.inventory.add_item", + ], + threshold: 0.5, + ), + Inventory(Swapped): ( + files: [ + "voxygen.audio.sfx.inventory.add_item", + ], + threshold: 0.5, + ), + Inventory(Given): ( + files: [ + "voxygen.audio.sfx.inventory.add_item", + ], + threshold: 0.5, + ), + Inventory(Dropped): ( + files: [ + "voxygen.audio.sfx.footsteps.stepgrass_4", + ], + threshold: 0.5, + ), + Inventory(Consumed(Potion)): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.liquid", + ], + threshold: 0.3, + ), + Inventory(Consumed(PotionMinor)): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.liquid", + ], + threshold: 0.3, + ), + Inventory(Consumed(Apple)): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.apple", + ], + threshold: 0.3, + ), + Inventory(Consumed(Mushroom)): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.food", + ], + threshold: 0.3, + ), + Inventory(Consumed(Cheese)): ( + files: [ + "voxygen.audio.sfx.inventory.consumable.food", + ], + threshold: 0.3, + ) } ) \ No newline at end of file diff --git a/assets/voxygen/audio/sfx/inventory/add_item.wav b/assets/voxygen/audio/sfx/inventory/add_item.wav new file mode 100644 index 0000000000..b6fa2c3665 --- /dev/null +++ b/assets/voxygen/audio/sfx/inventory/add_item.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5320d020c82cab3f1ed294c06bdd50df007ed354bca2103b42e3fb4fc3f3ee7a +size 71196 diff --git a/assets/voxygen/audio/sfx/inventory/consumable/apple.wav b/assets/voxygen/audio/sfx/inventory/consumable/apple.wav new file mode 100644 index 0000000000..286d8aade0 --- /dev/null +++ b/assets/voxygen/audio/sfx/inventory/consumable/apple.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c4d2931431c26b95a4d41b2e137b3db74456b8b9db54d7c48defb9d7bb67689 +size 70152 diff --git a/assets/voxygen/audio/sfx/inventory/consumable/food.wav b/assets/voxygen/audio/sfx/inventory/consumable/food.wav new file mode 100644 index 0000000000..ea39de567a --- /dev/null +++ b/assets/voxygen/audio/sfx/inventory/consumable/food.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fd5074d0ec517b626e95bc34cb75e735d48dbb99473ffeadb79d90734f52f7d +size 31208 diff --git a/assets/voxygen/audio/sfx/inventory/consumable/liquid.wav b/assets/voxygen/audio/sfx/inventory/consumable/liquid.wav new file mode 100644 index 0000000000..fa0db211f4 --- /dev/null +++ b/assets/voxygen/audio/sfx/inventory/consumable/liquid.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c3a38dede30bb4a8c13644bd43be5fe261f177f3c65f88e5d02da5b9ba68a97 +size 21548 diff --git a/client/src/lib.rs b/client/src/lib.rs index 90ecb651c6..57ee0fb4d7 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -14,6 +14,7 @@ pub use specs::{ use byteorder::{ByteOrder, LittleEndian}; use common::{ comp::{self, ControlEvent, Controller, ControllerInputs, InventoryManip}, + event::{EventBus, SfxEvent, SfxEventItem}, msg::{ validate_chat_msg, ChatMsgValidationError, ClientMsg, ClientState, PlayerListUpdate, RequestStateError, ServerError, ServerInfo, ServerMsg, MAX_BYTES_CHAT_MSG, @@ -377,6 +378,7 @@ impl Client { } } } + // Handle new messages from the server. frontend_events.append(&mut self.handle_new_messages()?); @@ -669,8 +671,14 @@ impl Client { self.state.write_component(entity, character_state); } }, - ServerMsg::InventoryUpdate(inventory) => { - self.state.write_component(self.entity, inventory) + ServerMsg::InventoryUpdate(inventory, event) => { + self.state.write_component(self.entity, inventory); + + self.state + .ecs() + .read_resource::>() + .emitter() + .emit(SfxEventItem::at_player_position(SfxEvent::Inventory(event))); }, ServerMsg::TerrainChunkUpdate { key, chunk } => { if let Ok(chunk) = chunk { diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index da958ee9b9..dd25ef9e4f 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -90,7 +90,7 @@ pub enum Armor { Necklace, } -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Consumable { Apple, Cheese, diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index f6833ff923..f192208b5c 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -1,10 +1,11 @@ pub mod item; // Reexports -pub use item::{Debug, Item, ItemKind, Tool}; +pub use item::{Consumable, Debug, Item, ItemKind, Tool}; use crate::assets; -use specs::{Component, HashMapStorage, NullStorage}; +use specs::{Component, FlaggedStorage, HashMapStorage}; +use specs_idvs::IDVStorage; use std::ops::Not; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -136,12 +137,37 @@ impl Component for Inventory { type Storage = HashMapStorage; } -// ForceUpdate +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] +pub enum InventoryUpdateEvent { + Init, + Used, + Consumed(Consumable), + Gave, + Given, + Swapped, + Dropped, + Collected, + Possession, + Debug, +} + +impl Default for InventoryUpdateEvent { + fn default() -> Self { Self::Init } +} + #[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)] -pub struct InventoryUpdate; +pub struct InventoryUpdate { + event: InventoryUpdateEvent, +} + +impl InventoryUpdate { + pub fn new(event: InventoryUpdateEvent) -> Self { Self { event } } + + pub fn event(&self) -> InventoryUpdateEvent { self.event } +} impl Component for InventoryUpdate { - type Storage = NullStorage; + type Storage = FlaggedStorage>; } #[cfg(test)] mod test; diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 24b1be9efb..2871761a7a 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -28,7 +28,7 @@ pub use controller::{ }; pub use energy::{Energy, EnergySource}; pub use inputs::CanBuild; -pub use inventory::{item, Inventory, InventoryUpdate, Item, ItemKind}; +pub use inventory::{item, Inventory, InventoryUpdate, InventoryUpdateEvent, Item, ItemKind}; pub use last::Last; pub use location::{Waypoint, WaypointArea}; pub use phys::{ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; diff --git a/common/src/event.rs b/common/src/event.rs index 6ac5e49531..0ba59b7274 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -1,5 +1,5 @@ use crate::{comp, sync::Uid}; -use comp::item::Tool; +use comp::{item::Tool, InventoryUpdateEvent}; use parking_lot::Mutex; use serde::Deserialize; use specs::Entity as EcsEntity; @@ -42,6 +42,7 @@ pub enum SfxEvent { LevelUp, Wield(Tool), Unwield(Tool), + Inventory(InventoryUpdateEvent), } pub enum LocalEvent { diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index a9244b15f6..0a7b84ae33 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -71,7 +71,7 @@ pub enum ServerMsg { entity: u64, character_state: comp::CharacterState, }, - InventoryUpdate(comp::Inventory), + InventoryUpdate(comp::Inventory, comp::InventoryUpdateEvent), TerrainChunkUpdate { key: Vec2, chunk: Result, ()>, diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 1f46109481..b4a2e3e5dd 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -262,6 +262,7 @@ lazy_static! { ), ]; } + fn handle_give(server: &mut Server, entity: EcsEntity, args: String, _action: &ChatCommand) { if let Ok(item) = assets::load_cloned(&args) { server @@ -274,7 +275,10 @@ fn handle_give(server: &mut Server, entity: EcsEntity, args: String, _action: &C .state .ecs() .write_storage::() - .insert(entity, comp::InventoryUpdate); + .insert( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Given), + ); } else { server.notify_client(entity, ServerMsg::private(String::from("Invalid item!"))); } @@ -1113,7 +1117,10 @@ fn handle_debug(server: &mut Server, entity: EcsEntity, _args: String, _action: .state .ecs() .write_storage::() - .insert(entity, comp::InventoryUpdate); + .insert( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Debug), + ); } else { server.notify_client( entity, diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 96be66e52b..7d7e3fd124 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -106,7 +106,10 @@ pub fn handle_possess(server: &Server, possessor_uid: Uid, possesse_uid: Uid) { } } ecs.write_storage::() - .insert(possesse, comp::InventoryUpdate) + .insert( + possesse, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Possession), + ) .err() .map(|e| { error!( diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index 4485a62fb7..09998ca6aa 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -48,7 +48,10 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv } } - state.write_component(entity, comp::InventoryUpdate); + state.write_component( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Collected), + ); }, comp::InventoryManip::Collect(pos) => { @@ -76,6 +79,8 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv .get_mut(entity) .and_then(|inv| inv.remove(slot)); + let mut event = comp::InventoryUpdateEvent::Used; + if let Some(item) = item_opt { match item.kind { comp::ItemKind::Tool { .. } => { @@ -94,7 +99,8 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv stats.equipment.main = Some(item); } }, - comp::ItemKind::Consumable { effect, .. } => { + comp::ItemKind::Consumable { kind, effect } => { + event = comp::InventoryUpdateEvent::Consumed(kind); state.apply_effect(entity, effect); }, comp::ItemKind::Utility { kind } => match kind { @@ -168,7 +174,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv } } - state.write_component(entity, comp::InventoryUpdate); + state.write_component(entity, comp::InventoryUpdate::new(event)); }, comp::InventoryManip::Swap(a, b) => { @@ -177,7 +183,10 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv .write_storage::() .get_mut(entity) .map(|inv| inv.swap_slots(a, b)); - state.write_component(entity, comp::InventoryUpdate); + state.write_component( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Swapped), + ); }, comp::InventoryManip::Drop(slot) => { @@ -201,7 +210,10 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv item, )); } - state.write_component(entity, comp::InventoryUpdate); + state.write_component( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Dropped), + ); }, } diff --git a/server/src/lib.rs b/server/src/lib.rs index b39fefea50..4d11efd110 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -282,7 +282,10 @@ impl Server { state.write_component(entity, comp::CharacterState::default()); state.write_component(entity, comp::Alignment::Owned(entity)); state.write_component(entity, comp::Inventory::default()); - state.write_component(entity, comp::InventoryUpdate); + state.write_component( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::default()), + ); // Make sure physics are accepted. state.write_component(entity, comp::ForceUpdate); @@ -606,7 +609,10 @@ impl StateExt for State { .map(|inv| inv.push(item).is_none()) .unwrap_or(false); if success { - self.write_component(entity, comp::InventoryUpdate); + self.write_component( + entity, + comp::InventoryUpdate::new(comp::InventoryUpdateEvent::Collected), + ); } success } diff --git a/server/src/sys/entity_sync.rs b/server/src/sys/entity_sync.rs index 1d28b77117..62bc7521a7 100644 --- a/server/src/sys/entity_sync.rs +++ b/server/src/sys/entity_sync.rs @@ -328,8 +328,11 @@ impl<'a> System<'a> for Sys { // TODO: Sync clients that don't have a position? // Sync inventories - for (client, inventory, _) in (&mut clients, &inventories, &inventory_updates).join() { - client.notify(ServerMsg::InventoryUpdate(inventory.clone())); + for (client, inventory, update) in (&mut clients, &inventories, &inventory_updates).join() { + client.notify(ServerMsg::InventoryUpdate( + inventory.clone(), + update.event(), + )); } // Remove all force flags. diff --git a/voxygen/src/audio/sfx/event_mapper/mod.rs b/voxygen/src/audio/sfx/event_mapper/mod.rs index e195d1cba2..94905cb802 100644 --- a/voxygen/src/audio/sfx/event_mapper/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/mod.rs @@ -1,5 +1,5 @@ -pub mod movement; -pub mod progression; +mod movement; +mod progression; use movement::MovementEventMapper; use progression::ProgressionEventMapper; diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 77c2067177..617092e8d6 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -172,7 +172,7 @@ impl MovementEventMapper { match ( current_event.movement, current_event.action, - previous_event.event, + previous_event.event.clone(), ) { (_, ActionState::Roll { .. }, _) => SfxEvent::Roll, (MovementState::Climb, ..) => SfxEvent::Climb, From 9d8d61736b9b196f98db05477a7ef297a43e253b Mon Sep 17 00:00:00 2001 From: Shane Handley Date: Thu, 5 Mar 2020 16:11:45 +0900 Subject: [PATCH 058/387] Deselect the inventory slot after dropping an item. --- voxygen/src/hud/bag.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 22d763ed42..70e27498de 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -258,6 +258,7 @@ impl<'a> Widget for Bag<'a> { if let Some(to_drop) = state.selected_slot { if ui.widget_input(ui.window).clicks().left().next().is_some() { event = Some(Event::HudEvent(HudEvent::DropInventorySlot(to_drop))); + state.update(|s| s.selected_slot = None); } } From 86e15695fc3dc9d2757269d646eec7fbdf217749 Mon Sep 17 00:00:00 2001 From: Justin Shipsey Date: Thu, 5 Mar 2020 14:02:11 +0000 Subject: [PATCH 059/387] weapon control bone --- CHANGELOG.md | 2 + assets/voxygen/element/frames/banner_top.png | 4 +- .../voxygen/element/misc_bg/textbox_bot.png | 4 +- .../voxygen/element/misc_bg/textbox_mid.png | 4 +- .../voxygen/element/misc_bg/textbox_top.png | 4 +- voxygen/src/anim/biped_large/mod.rs | 4 +- voxygen/src/anim/bird_medium/mod.rs | 4 +- voxygen/src/anim/bird_small/mod.rs | 4 +- voxygen/src/anim/character/attack.rs | 86 +++++++++-------- voxygen/src/anim/character/block.rs | 24 ++--- voxygen/src/anim/character/blockidle.rs | 24 ++--- voxygen/src/anim/character/charge.rs | 5 + voxygen/src/anim/character/cidle.rs | 36 +++---- voxygen/src/anim/character/climb.rs | 41 +++++--- voxygen/src/anim/character/crun.rs | 36 ++++--- voxygen/src/anim/character/gliding.rs | 35 +++++-- voxygen/src/anim/character/idle.rs | 39 ++++++-- voxygen/src/anim/character/jump.rs | 35 +++++-- voxygen/src/anim/character/mod.rs | 31 ++++-- voxygen/src/anim/character/roll.rs | 40 ++++++-- voxygen/src/anim/character/run.rs | 95 +++++++++++++------ voxygen/src/anim/character/sit.rs | 36 +++++-- voxygen/src/anim/character/stand.rs | 48 +++++++--- voxygen/src/anim/character/swim.rs | 37 ++++++-- voxygen/src/anim/character/wield.rs | 28 ++++-- voxygen/src/anim/critter/mod.rs | 4 +- voxygen/src/anim/dragon/mod.rs | 4 +- voxygen/src/anim/fish_medium/mod.rs | 4 +- voxygen/src/anim/fish_small/mod.rs | 4 +- voxygen/src/anim/fixture/mod.rs | 4 +- voxygen/src/anim/mod.rs | 2 +- voxygen/src/anim/object/mod.rs | 4 +- voxygen/src/anim/quadruped_medium/mod.rs | 4 +- voxygen/src/anim/quadruped_small/mod.rs | 4 +- voxygen/src/scene/figure/cache.rs | 26 ++--- 35 files changed, 513 insertions(+), 253 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e3ca83fa6..227c50b450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added sfx for wielding/unwielding weapons - Fixed NPCs attacking the player forever after killing them - Added sfx for collecting, dropping and using inventory items +- New attack animation +- weapon control system ### Changed diff --git a/assets/voxygen/element/frames/banner_top.png b/assets/voxygen/element/frames/banner_top.png index 95d2a663d0..a8f9c1a224 100644 --- a/assets/voxygen/element/frames/banner_top.png +++ b/assets/voxygen/element/frames/banner_top.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9fef31ac181203a09fa2ffc9da905d01b801de6916c719421c6c0824fcc381b6 -size 728 +oid sha256:1f03ab3f90d7abe2ccd67de23b7a7f1e026cb97c8e202a60165397d61b8f9dce +size 4881 diff --git a/assets/voxygen/element/misc_bg/textbox_bot.png b/assets/voxygen/element/misc_bg/textbox_bot.png index 7cbf38faa2..e944fe5eff 100644 --- a/assets/voxygen/element/misc_bg/textbox_bot.png +++ b/assets/voxygen/element/misc_bg/textbox_bot.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:689bb98f756e4795e39e9bf4dcc8696c30aa24972a99064e7a69dcced79a10ef -size 1017 +oid sha256:79e8e39281ebb9293b804ea0535635d69cc455ab4bb6d1103b84ec91e77990c1 +size 6377 diff --git a/assets/voxygen/element/misc_bg/textbox_mid.png b/assets/voxygen/element/misc_bg/textbox_mid.png index 193d78a014..9c271c6c21 100644 --- a/assets/voxygen/element/misc_bg/textbox_mid.png +++ b/assets/voxygen/element/misc_bg/textbox_mid.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b9ff2f6356b696b1d019ae8c9e171578516abd0fe6fa34ccd93ead8195766f7f -size 839 +oid sha256:6d9097face16955fac82b30dbe896796aea1b589db5c9cda2f87d9bc7f63f3a7 +size 6103 diff --git a/assets/voxygen/element/misc_bg/textbox_top.png b/assets/voxygen/element/misc_bg/textbox_top.png index a6ce89cfc1..1f2067cd01 100644 --- a/assets/voxygen/element/misc_bg/textbox_top.png +++ b/assets/voxygen/element/misc_bg/textbox_top.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c14b2e270f868f5621371ad8bd323afb46dd9919e7ff862943483b8de662128e -size 1020 +oid sha256:d770f17e438f4119cba20d54020acac26445467f968015028a3b476c2e97ea83 +size 6358 diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 85611e944e..282c094876 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -47,7 +47,7 @@ impl BipedLargeSkeleton { impl Skeleton for BipedLargeSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let upper_torso_mat = self.upper_torso.compute_base_matrix(); let shoulder_l_mat = self.shoulder_l.compute_base_matrix(); let shoulder_r_mat = self.shoulder_r.compute_base_matrix(); @@ -78,6 +78,8 @@ impl Skeleton for BipedLargeSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index 0ff89377ae..d5e7832e74 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/mod.rs @@ -27,7 +27,7 @@ impl BirdMediumSkeleton { impl Skeleton for BirdMediumSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let torso_mat = self.torso.compute_base_matrix(); [ @@ -47,6 +47,8 @@ impl Skeleton for BirdMediumSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/bird_small/mod.rs b/voxygen/src/anim/bird_small/mod.rs index 610b63122a..763bb2fac8 100644 --- a/voxygen/src/anim/bird_small/mod.rs +++ b/voxygen/src/anim/bird_small/mod.rs @@ -31,7 +31,7 @@ impl BirdSmallSkeleton { impl Skeleton for BirdSmallSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let torso_mat = self.torso.compute_base_matrix(); [ @@ -51,6 +51,8 @@ impl Skeleton for BirdSmallSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index 9ceb9343e8..3cc674e799 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -21,60 +21,65 @@ impl Animation for AttackAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let slow = (anim_time as f32 * 9.0).sin(); - let accel_med = 1.0 - (anim_time as f32 * 16.0).cos(); - let accel_slow = 1.0 - (anim_time as f32 * 12.0).cos(); - let accel_fast = 1.0 - (anim_time as f32 * 24.0).cos(); - let decel = (anim_time as f32 * 16.0).min(PI / 2.0).sin(); + let lab = 1.0; + let accel_med = 1.0 - (anim_time as f32 * 16.0 * lab as f32).cos(); + let accel_slow = 1.0 - (anim_time as f32 * 12.0 * lab as f32).cos(); + let accel_fast = 1.0 - (anim_time as f32 * 24.0 * lab as f32).cos(); + let decel = (anim_time as f32 * 16.0 * lab as f32).min(PI / 2.0).sin(); + + let slow = (((5.0) + / (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 12.4).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * lab as f32 * 12.4).sin()); next.head.offset = Vec3::new( 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, + -2.0 + skeleton_attr.neck_forward + decel * 0.8, skeleton_attr.neck_height + 21.0, ); - next.head.ori = Quaternion::rotation_z(decel * -0.25) - * Quaternion::rotation_x(0.0 + decel * -0.1) - * Quaternion::rotation_y(decel * 0.1); + next.head.ori = Quaternion::rotation_z(decel * 0.25) + * Quaternion::rotation_x(0.0 + decel * 0.1) + * Quaternion::rotation_y(decel * -0.1); next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0); - next.chest.ori = Quaternion::rotation_x(0.0); + next.chest.ori = Quaternion::rotation_z(decel * -0.2) + * Quaternion::rotation_x(0.0 + decel * -0.2) + * Quaternion::rotation_y(decel * 0.2); next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, 5.0); - next.belt.ori = Quaternion::rotation_x(0.0); + next.belt.ori = Quaternion::rotation_z(decel * -0.1) + * Quaternion::rotation_x(0.0 + decel * -0.1) + * Quaternion::rotation_y(decel * 0.1); next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, 2.0); - next.shorts.ori = Quaternion::rotation_x(0.0); + next.belt.ori = Quaternion::rotation_z(decel * -0.08) + * Quaternion::rotation_x(0.0 + decel * -0.08) + * Quaternion::rotation_y(decel * 0.08); next.shorts.scale = Vec3::one(); match active_tool_kind { //TODO: Inventory Some(Tool::Sword) => { - next.l_hand.offset = - Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); - next.l_hand.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + accel_med * -0.8) - * Quaternion::rotation_y(0.0 + accel_med * -0.4); - next.l_hand.scale = Vec3::one() * 1.01; - - next.r_hand.offset = - Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + accel_med * -0.8) - * Quaternion::rotation_y(0.0 + accel_med * -0.4); - next.r_hand.scale = Vec3::one() * 1.01; - - next.main.offset = Vec3::new( - -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, - 8.0 + accel_fast * 3.0, - 0.0, - ); - next.main.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + accel_med * -0.8) - * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.offset = Vec3::new(0.0, 1.0, 0.0); + next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.scale = Vec3::one() * 1.04; + next.r_hand.offset = Vec3::new(0.0, 0.0, -3.0); + next.r_hand.ori = Quaternion::rotation_x(1.27); + next.r_hand.scale = Vec3::one() * 1.05; + next.main.offset = Vec3::new(0.0, 6.0, -1.0); + next.main.ori = Quaternion::rotation_x(-0.3) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(-8.0 - slow * 1.0, 3.0 - slow * 5.0, 0.0); + next.control.ori = Quaternion::rotation_x(-1.2) + * Quaternion::rotation_y(slow * 1.5) + * Quaternion::rotation_z(1.4 + slow * 0.5); + next.control.scale = Vec3::one(); }, Some(Tool::Axe) => { next.l_hand.offset = @@ -266,10 +271,17 @@ impl Animation for AttackAnimation { next.lantern.scale = Vec3::one() * 0.0; next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(decel * -0.2) - * Quaternion::rotation_x(0.0 + decel * -0.2) - * Quaternion::rotation_y(decel * 0.2); + next.torso.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/block.rs b/voxygen/src/anim/character/block.rs index 17c1415641..53cff1dda0 100644 --- a/voxygen/src/anim/character/block.rs +++ b/voxygen/src/anim/character/block.rs @@ -63,21 +63,23 @@ impl Animation for BlockAnimation { match active_tool_kind { //TODO: Inventory Some(Tool::Sword) => { - next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0 + wave_ultra_slow * 1.0); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); + next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); + next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.scale = Vec3::one() * 1.04; + next.r_hand.offset = Vec3::new(0.0, -6.0, -8.0); + next.r_hand.ori = Quaternion::rotation_x(1.27); + next.r_hand.scale = Vec3::one() * 1.05; + next.main.offset = Vec3::new(0.0, 0.0, -6.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(-8.0, 13.0, 8.0); + next.control.ori = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(0.4) + * Quaternion::rotation_z(-1.57); + next.control.scale = Vec3::one(); }, Some(Tool::Axe) => { next.l_hand.offset = Vec3::new( diff --git a/voxygen/src/anim/character/blockidle.rs b/voxygen/src/anim/character/blockidle.rs index 67af96d2a2..09ac00407d 100644 --- a/voxygen/src/anim/character/blockidle.rs +++ b/voxygen/src/anim/character/blockidle.rs @@ -62,21 +62,23 @@ impl Animation for BlockIdleAnimation { match active_tool_kind { //TODO: Inventory Some(Tool::Sword) => { - next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0 + wave_ultra_slow * 1.0); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); + next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); + next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.scale = Vec3::one() * 1.04; + next.r_hand.offset = Vec3::new(0.0, -6.0, -8.0); + next.r_hand.ori = Quaternion::rotation_x(1.27); + next.r_hand.scale = Vec3::one() * 1.05; + next.main.offset = Vec3::new(0.0, 0.0, -6.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(-8.0, 13.0, 8.0); + next.control.ori = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(0.4) + * Quaternion::rotation_z(-1.57); + next.control.scale = Vec3::one(); }, Some(Tool::Axe) => { next.l_hand.offset = Vec3::new( diff --git a/voxygen/src/anim/character/charge.rs b/voxygen/src/anim/character/charge.rs index a0cbe277d5..18203270c9 100644 --- a/voxygen/src/anim/character/charge.rs +++ b/voxygen/src/anim/character/charge.rs @@ -103,6 +103,11 @@ impl Animation for ChargeAnimation { next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + next } } diff --git a/voxygen/src/anim/character/cidle.rs b/voxygen/src/anim/character/cidle.rs index c4093cf2c3..a33d6d0ed9 100644 --- a/voxygen/src/anim/character/cidle.rs +++ b/voxygen/src/anim/character/cidle.rs @@ -22,7 +22,7 @@ impl Animation for CidleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin(); + let wave_ultra_slow = (anim_time as f32 * 0.5 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); let wave_slow_cos = (anim_time as f32 * 6.0 + PI).cos(); let wave_slow = (anim_time as f32 * 6.0 + PI).sin(); @@ -63,29 +63,23 @@ impl Animation for CidleAnimation { match active_tool_kind { //TODO: Inventory Some(Tool::Sword) => { - next.l_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - -2.0 + wave_ultra_slow_cos * 0.5, - 1.0 + wave_ultra_slow * 1.0, - ); - next.l_hand.ori = Quaternion::rotation_x(1.27); - next.l_hand.scale = Vec3::one() * 1.0; - next.r_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - -2.5 + wave_ultra_slow_cos * 0.5, - -1.0 + wave_ultra_slow * 1.0, - ); - next.r_hand.ori = Quaternion::rotation_x(1.27); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 5.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 1.0 + wave_ultra_slow * 1.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) + next.l_hand.offset = Vec3::new(-0.25, -5.0, -5.0); + next.l_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2); + next.l_hand.scale = Vec3::one() * 1.04; + next.r_hand.offset = Vec3::new(1.25, -5.5, -8.0); + next.r_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3); + next.r_hand.scale = Vec3::one() * 1.05; + next.main.offset = Vec3::new(0.0, 0.0, -6.0); + next.main.ori = Quaternion::rotation_x(-0.1) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(-7.0, 6.0, 6.0); + next.control.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + next.control.scale = Vec3::one(); }, Some(Tool::Axe) => { next.l_hand.offset = Vec3::new( diff --git a/voxygen/src/anim/character/climb.rs b/voxygen/src/anim/character/climb.rs index 769abeecf6..b95ec99a84 100644 --- a/voxygen/src/anim/character/climb.rs +++ b/voxygen/src/anim/character/climb.rs @@ -59,11 +59,11 @@ impl Animation for ClimbAnimation { * Quaternion::rotation_y(wave_test * 0.10); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new(-6.0, -0.25 + wave_testc * 1.5, 5.0 - wave_test * 4.0); + next.l_hand.offset = Vec3::new(-6.0, -0.25 + wave_testc * 1.5, 6.0 - wave_test * 4.0); next.l_hand.ori = Quaternion::rotation_x(2.2 + wave_testc * 0.5); next.l_hand.scale = Vec3::one(); - next.r_hand.offset = Vec3::new(6.0, -0.25 - wave_testc * 1.5, 5.0 + wave_test * 4.0); + next.r_hand.offset = Vec3::new(6.0, -0.25 - wave_testc * 1.5, 6.0 + wave_test * 4.0); next.r_hand.ori = Quaternion::rotation_x(2.2 - wave_testc * 0.5); next.r_hand.scale = Vec3::one(); @@ -75,15 +75,6 @@ impl Animation for ClimbAnimation { next.r_foot.ori = Quaternion::rotation_x(0.2 + wave_testc * 0.5); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_cos * 0.25); - next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(wave_cos * 0.15); next.l_shoulder.scale = Vec3::one() * 1.1; @@ -96,6 +87,23 @@ impl Animation for ClimbAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 18.0, + ); + next.main.ori = + Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_cos * 0.25); + next.main.scale = Vec3::one(); + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -104,6 +112,17 @@ impl Animation for ClimbAnimation { next.torso.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/crun.rs b/voxygen/src/anim/character/crun.rs index 59d1807a69..cf12ef8c56 100644 --- a/voxygen/src/anim/character/crun.rs +++ b/voxygen/src/anim/character/crun.rs @@ -43,23 +43,33 @@ impl Animation for WieldAnimation { match Tool::Bow { //TODO: Inventory - Tool::Sword => { - next.l_hand.offset = Vec3::new(-6.0, 3.75, 0.25); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.weapon.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.0 + skeleton_attr.weapon_y, + Some(Tool::Sword) => { + next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); + next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.scale = Vec3::one() * 1.04; + next.r_hand.offset = Vec3::new(0.0, -6.0, -8.0); + next.r_hand.ori = Quaternion::rotation_x(1.27); + next.r_hand.scale = Vec3::one() * 1.05; + next.main.offset = Vec3::new( 0.0, + 0.0, + -6.0, ); - next.weapon.ori = Quaternion::rotation_x(-0.3) + next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); - next.weapon.scale = Vec3::one(); - } + next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new( + -8.0, + 4.0, + 6.0, + ); + next.control.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + next.control.scale = Vec3::one(); + }, Tool::Axe => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index 955208a3d2..5eacea3e85 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -105,14 +105,6 @@ impl Animation for GlidingAnimation { ); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one() * 1.1; @@ -126,6 +118,22 @@ impl Animation for GlidingAnimation { Quaternion::rotation_x(1.0) * Quaternion::rotation_y(wave_very_slow_cos * 0.04); next.glider.scale = Vec3::one(); + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one(); + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -135,6 +143,17 @@ impl Animation for GlidingAnimation { * Quaternion::rotation_y(tilt * 16.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index 87a709ab50..57949cb125 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -56,7 +56,7 @@ impl Animation for IdleAnimation { next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( - -6.0, + -7.0, -0.25 + wave_ultra_slow_cos * 0.15, 5.0 + wave_ultra_slow * 0.5, ); @@ -65,7 +65,7 @@ impl Animation for IdleAnimation { next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( - 6.0, + 7.0, -0.25 + wave_ultra_slow_cos * 0.15, 5.0 + wave_ultra_slow * 0.5 + wave_ultra_slow_abs * -0.05, ); @@ -80,14 +80,6 @@ impl Animation for IdleAnimation { next.r_foot.ori = Quaternion::identity(); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one() + wave_ultra_slow_abs * -0.05; - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = (Vec3::one() + wave_ultra_slow_abs * -0.05) * 1.15; @@ -100,6 +92,22 @@ impl Animation for IdleAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 18.0, + ); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one() + wave_ultra_slow_abs * -0.05; + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -108,6 +116,17 @@ impl Animation for IdleAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs index 7a93aa4f82..b19f3f5ba4 100644 --- a/voxygen/src/anim/character/jump.rs +++ b/voxygen/src/anim/character/jump.rs @@ -68,14 +68,6 @@ impl Animation for JumpAnimation { next.r_foot.ori = Quaternion::rotation_x(wave_stop * 1.2 + wave_slow * 0.2); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(wave_stop_alt * 0.3); next.l_shoulder.scale = Vec3::one() * 1.1; @@ -88,6 +80,22 @@ impl Animation for JumpAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one(); + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -96,6 +104,17 @@ impl Animation for JumpAnimation { next.torso.ori = Quaternion::rotation_x(-0.2); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index 6ed75e27e2..727d0f0918 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -37,12 +37,16 @@ pub struct CharacterSkeleton { r_hand: Bone, l_foot: Bone, r_foot: Bone, - main: Bone, l_shoulder: Bone, r_shoulder: Bone, glider: Bone, + main: Bone, + second: Bone, lantern: Bone, torso: Bone, + control: Bone, + l_control: Bone, + r_control: Bone, } impl CharacterSkeleton { @@ -52,11 +56,16 @@ impl CharacterSkeleton { impl Skeleton for CharacterSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let chest_mat = self.chest.compute_base_matrix(); let torso_mat = self.torso.compute_base_matrix(); let l_hand_mat = self.l_hand.compute_base_matrix(); + let r_hand_mat = self.r_hand.compute_base_matrix(); + let control_mat = self.control.compute_base_matrix(); + let l_control_mat = self.l_control.compute_base_matrix(); + let r_control_mat = self.r_control.compute_base_matrix(); let main_mat = self.main.compute_base_matrix(); + let second_mat = self.second.compute_base_matrix(); let head_mat = self.head.compute_base_matrix(); [ @@ -64,18 +73,20 @@ impl Skeleton for CharacterSkeleton { FigureBoneData::new(torso_mat * chest_mat), FigureBoneData::new(torso_mat * self.belt.compute_base_matrix()), FigureBoneData::new(torso_mat * self.shorts.compute_base_matrix()), - FigureBoneData::new(torso_mat * chest_mat * l_hand_mat), - FigureBoneData::new(torso_mat * chest_mat * self.r_hand.compute_base_matrix()), + FigureBoneData::new(torso_mat * chest_mat * control_mat * l_control_mat * l_hand_mat), + FigureBoneData::new(torso_mat * chest_mat * control_mat * r_control_mat * r_hand_mat), FigureBoneData::new(torso_mat * self.l_foot.compute_base_matrix()), FigureBoneData::new(torso_mat * self.r_foot.compute_base_matrix()), - FigureBoneData::new(torso_mat * chest_mat * main_mat), FigureBoneData::new(torso_mat * chest_mat * self.l_shoulder.compute_base_matrix()), FigureBoneData::new(torso_mat * chest_mat * self.r_shoulder.compute_base_matrix()), FigureBoneData::new(torso_mat * self.glider.compute_base_matrix()), + FigureBoneData::new(torso_mat * chest_mat * control_mat * l_control_mat * main_mat), + FigureBoneData::new(torso_mat * chest_mat * control_mat * r_control_mat * second_mat), FigureBoneData::new(torso_mat * chest_mat * self.lantern.compute_base_matrix()), FigureBoneData::new(torso_mat), - FigureBoneData::default(), - FigureBoneData::default(), + FigureBoneData::new(control_mat), + FigureBoneData::new(l_control_mat), + FigureBoneData::new(r_control_mat), ] } @@ -88,12 +99,16 @@ impl Skeleton for CharacterSkeleton { self.r_hand.interpolate(&target.r_hand, dt); self.l_foot.interpolate(&target.l_foot, dt); self.r_foot.interpolate(&target.r_foot, dt); - self.main.interpolate(&target.main, dt); self.l_shoulder.interpolate(&target.l_shoulder, dt); self.r_shoulder.interpolate(&target.r_shoulder, dt); self.glider.interpolate(&target.glider, dt); + self.main.interpolate(&target.main, dt); + self.second.interpolate(&target.second, dt); self.lantern.interpolate(&target.lantern, dt); self.torso.interpolate(&target.torso, dt); + self.control.interpolate(&target.control, dt); + self.l_control.interpolate(&target.l_control, dt); + self.r_control.interpolate(&target.r_control, dt); } } diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index b9fd7fbfa1..5dc42b8eed 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -85,16 +85,6 @@ impl Animation for RollAnimation { next.r_foot.ori = Quaternion::rotation_x(wave * -0.4); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) - * Quaternion::rotation_z(1.57) - * Quaternion::rotation_x(0.0); - next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one() * 1.1; @@ -107,6 +97,24 @@ impl Animation for RollAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); + next.main.ori = Quaternion::rotation_y(2.5) + * Quaternion::rotation_z(1.57) + * Quaternion::rotation_x(0.0); + next.main.scale = Vec3::one(); + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -115,6 +123,18 @@ impl Animation for RollAnimation { Vec3::new(0.0, 0.0, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(tilt); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index c4e2479248..a4c92e3bce 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -23,23 +23,36 @@ impl Animation for RunAnimation { let lab = 1.0; let long = (((5.0) - / (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 1.2).sin()).powf(2.0 as f32))) + / (1.5 + 3.5 * ((anim_time as f32 * lab as f32 * 0.66).sin()).powf(2.0 as f32))) .sqrt()) - * ((anim_time as f32 * lab as f32 * 1.2).sin()); - let short = (((5.0) - / (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 2.4).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * lab as f32 * 1.5).sin()); + * ((anim_time as f32 * lab as f32 * 0.66).sin()); - let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); + let short = (((5.0) + / (1.5 + 3.5 * ((anim_time as f32 * lab as f32 * 1.32).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * lab as f32 * 1.32).sin()); + + let shortalt = (((5.0) + / (1.5 + + 3.5 + * ((anim_time as f32 * lab as f32 * 1.32 + PI / 2.0).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * lab as f32 * 1.32 + PI / 2.0).sin()); + + let foot = (((5.0) + / (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 1.32).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * lab as f32 * 1.32).sin()); + + let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0 / 2.0).sin(); let head_look = Vec2::new( - ((global_time + anim_time) as f32 / 4.0) + ((global_time + anim_time) as f32 / 18.0) .floor() .mul(7331.0) .sin() * 0.2, - ((global_time + anim_time) as f32 / 4.0) + ((global_time + anim_time) as f32 / 18.0) .floor() .mul(1337.0) .sin() @@ -70,21 +83,21 @@ impl Animation for RunAnimation { next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + short * 1.1); - next.chest.ori = Quaternion::rotation_z(long * 0.2); + next.chest.ori = Quaternion::rotation_z(short * 0.2); next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + short * 1.1); - next.belt.ori = Quaternion::rotation_z(long * 0.35); + next.belt.ori = Quaternion::rotation_z(short * 0.35); next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + short * 1.1); - next.shorts.ori = Quaternion::rotation_z(long * 0.6); + next.shorts.ori = Quaternion::rotation_z(short * 0.6); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( -6.0 + wave_stop * -1.0, -0.25 + short * 2.0, - 5.0 - long * 1.5, + 5.0 + short * -1.5, ); next.l_hand.ori = Quaternion::rotation_x(0.8 + short * 1.2) * Quaternion::rotation_y(wave_stop * 0.1); @@ -93,20 +106,32 @@ impl Animation for RunAnimation { next.r_hand.offset = Vec3::new( 6.0 + wave_stop * 1.0, -0.25 + short * -2.0, - 5.0 + long * 1.5, + 5.0 + short * 1.5, ); next.r_hand.ori = Quaternion::rotation_x(0.8 + short * -1.2) * Quaternion::rotation_y(wave_stop * -0.1); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, 0.0 + short * 1.0, 6.0); - next.l_foot.ori = Quaternion::rotation_x(-0.0 - short * 1.2); + next.l_foot.offset = Vec3::new(-3.4, foot * 1.0, 6.0); + next.l_foot.ori = Quaternion::rotation_x(foot * -1.2); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, short * -1.0, 6.0); - next.r_foot.ori = Quaternion::rotation_x(short * 1.2); + next.r_foot.offset = Vec3::new(3.4, foot * -1.0, 6.0); + next.r_foot.ori = Quaternion::rotation_x(foot * 1.2); next.r_foot.scale = Vec3::one(); + next.l_shoulder.offset = Vec3::new(-5.0, -1.0, 4.7); + next.l_shoulder.ori = Quaternion::rotation_x(short * 0.15); + next.l_shoulder.scale = Vec3::one() * 1.1; + + next.r_shoulder.offset = Vec3::new(5.0, -1.0, 4.7); + next.r_shoulder.ori = Quaternion::rotation_x(short * -0.15); + next.r_shoulder.scale = Vec3::one() * 1.1; + + next.glider.offset = Vec3::new(0.0, 5.0, 0.0); + next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( -7.0 + skeleton_attr.weapon_x, -5.0 + skeleton_attr.weapon_y, @@ -115,28 +140,36 @@ impl Animation for RunAnimation { next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + short * 0.25); next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, -0.5, 4.7); - next.l_shoulder.ori = Quaternion::rotation_x(short * 0.15); - next.l_shoulder.scale = Vec3::one() * 1.1; - - next.r_shoulder.offset = Vec3::new(5.0, -0.5, 4.7); - next.r_shoulder.ori = Quaternion::rotation_x(long * 0.15); - next.r_shoulder.scale = Vec3::one() * 1.1; - - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); - next.glider.scale = Vec3::one() * 0.0; + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; next.lantern.offset = Vec3::new(0.0, 5.0, 0.0); next.lantern.ori = Quaternion::rotation_y(0.0); next.lantern.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.3 + long * -0.08, 0.4) * skeleton_attr.scaler; + next.torso.offset = Vec3::new(0.0, -0.3 + shortalt * -0.065, 0.4) * skeleton_attr.scaler; next.torso.ori = - Quaternion::rotation_x(wave_stop * speed * -0.06 + wave_stop * speed * -0.005) + Quaternion::rotation_x(wave_stop * speed * -0.05 + wave_stop * speed * -0.005) * Quaternion::rotation_y(tilt); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); + next } } diff --git a/voxygen/src/anim/character/sit.rs b/voxygen/src/anim/character/sit.rs index 2a1d4858bd..a4a8f4a210 100644 --- a/voxygen/src/anim/character/sit.rs +++ b/voxygen/src/anim/character/sit.rs @@ -95,14 +95,6 @@ impl Animation for SitAnimation { ); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one() + wave_slow_abs * -0.05; - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = (Vec3::one() + wave_slow_abs * -0.05) * 1.15; @@ -115,6 +107,22 @@ impl Animation for SitAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one() + wave_slow_abs * -0.05; + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -122,6 +130,18 @@ impl Animation for SitAnimation { next.torso.offset = Vec3::new(0.0, -0.2, wave_stop * -0.16) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index 2116115be7..116cf5db09 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -43,26 +43,25 @@ impl Animation for StandAnimation { next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + slow * 0.3); - next.chest.ori = Quaternion::rotation_x(0.0); - next.chest.scale = Vec3::one() * 1.01 + breathe * 0.05; + next.chest.ori = Quaternion::rotation_z(head_look.x * 0.6); + next.chest.scale = Vec3::one() * 1.01; next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + slow * 0.3); - next.belt.ori = Quaternion::rotation_x(0.0); + next.belt.ori = Quaternion::rotation_z(head_look.x * 0.4); next.belt.scale = Vec3::one() + breathe * 0.05; next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + slow * 0.3); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new(-6.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5); + next.l_hand.offset = Vec3::new(-7.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5); next.l_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.06); next.l_hand.scale = Vec3::one(); - next.r_hand.offset = - Vec3::new(6.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5 + breathe * -0.05); + next.r_hand.offset = Vec3::new(7.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5); next.r_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.06); - next.r_hand.scale = Vec3::one() + breathe * -0.05; + next.r_hand.scale = Vec3::one(); next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); next.l_foot.ori = Quaternion::identity(); @@ -72,14 +71,6 @@ impl Animation for StandAnimation { next.r_foot.ori = Quaternion::identity(); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one() + breathe * -0.05; - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = (Vec3::one() + breathe * -0.05) * 1.15; @@ -92,6 +83,22 @@ impl Animation for StandAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 18.0, + ); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one(); + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -100,6 +107,17 @@ impl Animation for StandAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 4531e0ae8a..8b8220277d 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -95,15 +95,6 @@ impl Animation for SwimAnimation { next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave_cos * 1.5); next.r_foot.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_cos * 0.25); - next.main.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(wave_cos * 0.15); next.l_shoulder.scale = Vec3::one() * 1.1; @@ -116,6 +107,23 @@ impl Animation for SwimAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; + next.main.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 18.0, + ); + next.main.ori = + Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_cos * 0.25); + next.main.scale = Vec3::one(); + + next.second.offset = Vec3::new( + 0.0 + skeleton_attr.weapon_x, + 0.0 + skeleton_attr.weapon_y, + 0.0, + ); + next.second.ori = Quaternion::rotation_y(0.0); + next.second.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new(0.0, 5.0, 0.0); next.lantern.ori = Quaternion::rotation_y(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -126,6 +134,17 @@ impl Animation for SwimAnimation { * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(0.0); + next.control.scale = Vec3::one(); + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 68d18d2c9d..9e882fed3c 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -30,21 +30,23 @@ impl Animation for WieldAnimation { match active_tool_kind { //TODO: Inventory Some(Tool::Sword) => { - next.l_hand.offset = Vec3::new(-6.0, -2.0, 1.0); + next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); next.l_hand.ori = Quaternion::rotation_x(1.27); - next.l_hand.scale = Vec3::one() * 1.00; - next.r_hand.offset = Vec3::new(-6.0, -2.5, -1.0); + next.l_hand.scale = Vec3::one() * 1.04; + next.r_hand.offset = Vec3::new(0.0, -6.0, -8.0); next.r_hand.ori = Quaternion::rotation_x(1.27); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 5.5 + skeleton_attr.weapon_y, - 1.0, - ); + next.r_hand.scale = Vec3::one() * 1.05; + next.main.offset = Vec3::new(0.0, 0.0, -6.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(-8.0, 4.0, 6.0); + next.control.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + next.control.scale = Vec3::one(); }, Some(Tool::Axe) => { next.l_hand.offset = Vec3::new(-6.5, -0.5, 6.0); @@ -200,6 +202,14 @@ impl Animation for WieldAnimation { next.torso.offset = Vec3::new(0.0, 0.3 + wave * -0.08, 0.4) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(wave_stop * -0.2); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/critter/mod.rs b/voxygen/src/anim/critter/mod.rs index 9677461239..4a2c05ef6d 100644 --- a/voxygen/src/anim/critter/mod.rs +++ b/voxygen/src/anim/critter/mod.rs @@ -32,7 +32,7 @@ impl CritterSkeleton { impl Skeleton for CritterSkeleton { type Attr = CritterAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { [ FigureBoneData::new(self.head.compute_base_matrix()), FigureBoneData::new(self.chest.compute_base_matrix()), @@ -50,6 +50,8 @@ impl Skeleton for CritterSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index c3bfec7e61..131d78dc24 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -49,7 +49,7 @@ impl DragonSkeleton { impl Skeleton for DragonSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let chest_front_mat = self.chest_front.compute_base_matrix(); let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); @@ -72,6 +72,8 @@ impl Skeleton for DragonSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/fish_medium/mod.rs b/voxygen/src/anim/fish_medium/mod.rs index b085ed7220..5912719299 100644 --- a/voxygen/src/anim/fish_medium/mod.rs +++ b/voxygen/src/anim/fish_medium/mod.rs @@ -35,7 +35,7 @@ impl FishMediumSkeleton { impl Skeleton for FishMediumSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let torso_mat = self.torso.compute_base_matrix(); let rear_mat = self.rear.compute_base_matrix(); @@ -56,6 +56,8 @@ impl Skeleton for FishMediumSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/fish_small/mod.rs b/voxygen/src/anim/fish_small/mod.rs index ed26ef0247..e1b47513f7 100644 --- a/voxygen/src/anim/fish_small/mod.rs +++ b/voxygen/src/anim/fish_small/mod.rs @@ -27,7 +27,7 @@ impl FishSmallSkeleton { impl Skeleton for FishSmallSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let torso_mat = self.torso.compute_base_matrix(); [ @@ -47,6 +47,8 @@ impl Skeleton for FishSmallSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/fixture/mod.rs b/voxygen/src/anim/fixture/mod.rs index 92a68d0125..a243b923a4 100644 --- a/voxygen/src/anim/fixture/mod.rs +++ b/voxygen/src/anim/fixture/mod.rs @@ -13,7 +13,7 @@ impl FixtureSkeleton { impl Skeleton for FixtureSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { [ FigureBoneData::new(vek::Mat4::identity()), FigureBoneData::new(vek::Mat4::identity()), @@ -31,6 +31,8 @@ impl Skeleton for FixtureSkeleton { FigureBoneData::new(vek::Mat4::identity()), FigureBoneData::new(vek::Mat4::identity()), FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), ] } diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index 1a309e95c9..347df6f7e6 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -51,7 +51,7 @@ impl Bone { pub trait Skeleton: Send + Sync + 'static { type Attr; - fn compute_matrices(&self) -> [FigureBoneData; 16]; + fn compute_matrices(&self) -> [FigureBoneData; 18]; /// Change the current skeleton to be more like `target`. fn interpolate(&mut self, target: &Self, dt: f32); diff --git a/voxygen/src/anim/object/mod.rs b/voxygen/src/anim/object/mod.rs index d6f3ac510e..b9befc2522 100644 --- a/voxygen/src/anim/object/mod.rs +++ b/voxygen/src/anim/object/mod.rs @@ -15,7 +15,7 @@ const SCALE: f32 = 1.0 / 11.0; impl Skeleton for ObjectSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { [ FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), @@ -33,6 +33,8 @@ impl Skeleton for ObjectSkeleton { FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), + FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), + FigureBoneData::new(Mat4::scaling_3d(Vec3::broadcast(SCALE))), ] } diff --git a/voxygen/src/anim/quadruped_medium/mod.rs b/voxygen/src/anim/quadruped_medium/mod.rs index 57f36c9c1f..a30eaa0203 100644 --- a/voxygen/src/anim/quadruped_medium/mod.rs +++ b/voxygen/src/anim/quadruped_medium/mod.rs @@ -31,7 +31,7 @@ impl QuadrupedMediumSkeleton { impl Skeleton for QuadrupedMediumSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { let ears_mat = self.ears.compute_base_matrix(); let head_upper_mat = self.head_upper.compute_base_matrix(); let head_lower_mat = self.head_lower.compute_base_matrix(); @@ -53,6 +53,8 @@ impl Skeleton for QuadrupedMediumSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/anim/quadruped_small/mod.rs b/voxygen/src/anim/quadruped_small/mod.rs index fb4c559fbf..a277b5aff8 100644 --- a/voxygen/src/anim/quadruped_small/mod.rs +++ b/voxygen/src/anim/quadruped_small/mod.rs @@ -26,7 +26,7 @@ impl QuadrupedSmallSkeleton { impl Skeleton for QuadrupedSmallSkeleton { type Attr = SkeletonAttr; - fn compute_matrices(&self) -> [FigureBoneData; 16] { + fn compute_matrices(&self) -> [FigureBoneData; 18] { [ FigureBoneData::new(self.head.compute_base_matrix()), FigureBoneData::new(self.chest.compute_base_matrix()), @@ -44,6 +44,8 @@ impl Skeleton for QuadrupedSmallSkeleton { FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), ] } diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index fdf0aef8cd..dcace2126d 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -172,19 +172,6 @@ impl FigureModelCache { }, CameraMode::FirstPerson => None, }, - if camera_mode != CameraMode::FirstPerson - || character_state - .map(|cs| { - cs.action.is_attack() - || cs.action.is_block() - || cs.action.is_wield() - }) - .unwrap_or_default() - { - Some(mesh_main(equipment.and_then(|e| e.main.as_ref()))) - } else { - None - }, match camera_mode { CameraMode::ThirdPerson => Some( humanoid_armor_shoulder_spec.mesh_left_shoulder(&body), @@ -198,6 +185,19 @@ impl FigureModelCache { CameraMode::FirstPerson => None, }, Some(mesh_glider()), + if camera_mode != CameraMode::FirstPerson + || character_state + .map(|cs| { + cs.action.is_attack() + || cs.action.is_block() + || cs.action.is_wield() + }) + .unwrap_or_default() + { + Some(mesh_main(equipment.and_then(|e| e.main.as_ref()))) + } else { + None + }, Some(mesh_lantern()), None, None, From a97b694dfe69a95bdfe5224c145799c9d630e700 Mon Sep 17 00:00:00 2001 From: Capucho Date: Sun, 1 Mar 2020 22:18:22 +0000 Subject: [PATCH 060/387] Groundwork for fixing #36 and rewrite of client timeouts so that they don't use Instant and Duration --- client/src/lib.rs | 37 +++++++++++++++++------------------- voxygen/src/hud/mod.rs | 16 ++++++++++++++-- voxygen/src/main.rs | 5 +++++ voxygen/src/menu/main/mod.rs | 8 +++----- voxygen/src/session.rs | 30 ++++++++++++++++------------- voxygen/src/singleplayer.rs | 29 ++++++++++++++++++++-------- 6 files changed, 77 insertions(+), 48 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 57ee0fb4d7..5bb2068dc6 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -40,11 +40,11 @@ use vek::*; // The duration of network inactivity until the player is kicked // @TODO: in the future, this should be configurable on the server // and be provided to the client -const SERVER_TIMEOUT: Duration = Duration::from_secs(20); +const SERVER_TIMEOUT: f64 = 20.0; // After this duration has elapsed, the user will begin getting kick warnings in // their chat window -const SERVER_TIMEOUT_GRACE_PERIOD: Duration = Duration::from_secs(14); +const SERVER_TIMEOUT_GRACE_PERIOD: f64 = 14.0; pub enum Event { Chat { @@ -64,8 +64,8 @@ pub struct Client { postbox: PostBox, - last_server_ping: Instant, - last_server_pong: Instant, + last_server_ping: f64, + last_server_pong: f64, last_ping_delta: f64, tick: u64, @@ -152,8 +152,8 @@ impl Client { postbox, - last_server_ping: Instant::now(), - last_server_pong: Instant::now(), + last_server_ping: 0.0, + last_server_pong: 0.0, last_ping_delta: 0.0, tick: 0, @@ -481,9 +481,9 @@ impl Client { } // Send a ping to the server once every second - if Instant::now().duration_since(self.last_server_ping) > Duration::from_secs(1) { + if self.state.get_time() - self.last_server_ping > 1. { self.postbox.send_message(ClientMsg::Ping); - self.last_server_ping = Instant::now(); + self.last_server_ping = self.state.get_time(); } // 6) Update the server about the player's physics attributes. @@ -528,16 +528,14 @@ impl Client { // Check that we have an valid connection. // Use the last ping time as a 1s rate limiter, we only notify the user once per // second - if Instant::now().duration_since(self.last_server_ping) > Duration::from_secs(1) { - let duration_since_last_pong = Instant::now().duration_since(self.last_server_pong); + if self.state.get_time() - self.last_server_ping > 1. { + let duration_since_last_pong = self.state.get_time() - self.last_server_pong; // Dispatch a notification to the HUD warning they will be kicked in {n} seconds - if duration_since_last_pong.as_secs() >= SERVER_TIMEOUT_GRACE_PERIOD.as_secs() { - if let Some(seconds_until_kick) = - SERVER_TIMEOUT.checked_sub(duration_since_last_pong) - { + if duration_since_last_pong >= SERVER_TIMEOUT_GRACE_PERIOD { + if self.state.get_time() - duration_since_last_pong > 0. { frontend_events.push(Event::DisconnectionNotification( - seconds_until_kick.as_secs(), + (self.state.get_time() - duration_since_last_pong).round() as u64, )); } } @@ -591,11 +589,10 @@ impl Client { ServerMsg::Ping => self.postbox.send_message(ClientMsg::Pong), ServerMsg::Pong => { - self.last_server_pong = Instant::now(); + self.last_server_pong = self.state.get_time(); - self.last_ping_delta = Instant::now() - .duration_since(self.last_server_ping) - .as_secs_f64(); + self.last_ping_delta = + (self.state.get_time() - self.last_server_ping).round(); }, ServerMsg::ChatMsg { message, chat_type } => { frontend_events.push(Event::Chat { message, chat_type }) @@ -712,7 +709,7 @@ impl Client { } else if let Some(err) = self.postbox.error() { return Err(err.into()); // We regularily ping in the tick method - } else if Instant::now().duration_since(self.last_server_pong) > SERVER_TIMEOUT { + } else if self.state.get_time() - self.last_server_pong > SERVER_TIMEOUT { return Err(Error::ServerTimeout); } Ok(frontend_events) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 760bd4a2ef..e4e0605839 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -357,7 +357,7 @@ impl Show { fn toggle_ui(&mut self) { self.ui = !self.ui; } - fn toggle_windows(&mut self) { + fn toggle_windows(&mut self, global_state: &mut GlobalState) { if self.bag || self.esc_menu || self.map @@ -379,9 +379,21 @@ impl Show { self.character_window = false; self.open_windows = Windows::None; self.want_grab = true; + + // Unpause the game if we are on singleplayer + if let Some(ref singleplayer) = global_state.singleplayer { + singleplayer.pause(false); + global_state.paused = false; + }; } else { self.esc_menu = true; self.want_grab = false; + + // Pause the game if we are on singleplayer + if let Some(ref singleplayer) = global_state.singleplayer { + singleplayer.pause(true); + global_state.paused = true; + }; } } @@ -1992,7 +2004,7 @@ impl Hud { self.ui.focus_widget(None); } else { // Close windows on esc - self.show.toggle_windows(); + self.show.toggle_windows(global_state); } true }, diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 53536055ce..8379044eea 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -32,6 +32,7 @@ use crate::{ menu::main::MainMenuState, meta::Meta, settings::Settings, + singleplayer::Singleplayer, window::Window, }; use common::assets::{load, load_expect}; @@ -45,6 +46,8 @@ pub struct GlobalState { window: Window, audio: AudioFrontend, info_message: Option, + singleplayer: Option, + paused: bool, } impl GlobalState { @@ -135,6 +138,8 @@ fn main() { settings, meta, info_message: None, + singleplayer: None, + paused: false, }; // Try to load the localization and log missing entries diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 9ce56b48dc..504e3d6dc9 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -18,7 +18,6 @@ use ui::{Event as MainMenuEvent, MainMenuUi}; pub struct MainMenuState { main_menu_ui: MainMenuUi, - singleplayer: Option, } impl MainMenuState { @@ -26,7 +25,6 @@ impl MainMenuState { pub fn new(global_state: &mut GlobalState) -> Self { Self { main_menu_ui: MainMenuUi::new(global_state), - singleplayer: None, } } } @@ -47,7 +45,7 @@ impl PlayState for MainMenuState { } // Reset singleplayer server if it was running already - self.singleplayer = None; + global_state.singleplayer = None; loop { // Handle window events. @@ -119,7 +117,7 @@ impl PlayState for MainMenuState { // client_init contains Some(ClientInit), which spawns a thread which // contains a TcpStream::connect() call This call is // blocking TODO fix when the network rework happens - self.singleplayer = None; + global_state.singleplayer = None; client_init = None; self.main_menu_ui.cancel_connection(); }, @@ -127,7 +125,7 @@ impl PlayState for MainMenuState { MainMenuEvent::StartSingleplayer => { let (singleplayer, server_settings) = Singleplayer::new(None); // TODO: Make client and server use the same thread pool - self.singleplayer = Some(singleplayer); + global_state.singleplayer = Some(singleplayer); attempt_login( global_state, diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index a45ab1ad0f..cd79db199d 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -379,13 +379,15 @@ impl PlayState for SessionState { self.inputs.look_dir = cam_dir; - // Perform an in-game tick. - if let Err(err) = self.tick(clock.get_avg_delta()) { - global_state.info_message = - Some(localized_strings.get("common.connection_lost").to_owned()); - error!("[session] Failed to tick the scene: {:?}", err); + if !global_state.paused { + // Perform an in-game tick. + if let Err(err) = self.tick(clock.get_avg_delta()) { + global_state.info_message = + Some(localized_strings.get("common.connection_lost").to_owned()); + error!("[session] Failed to tick the scene: {:?}", err); - return PlayStateResult::Pop; + return PlayStateResult::Pop; + } } // Maintain global state. @@ -609,13 +611,15 @@ impl PlayState for SessionState { } } - // Maintain the scene. - self.scene.maintain( - global_state.window.renderer_mut(), - &mut global_state.audio, - &self.client.borrow(), - global_state.settings.graphics.gamma, - ); + if !global_state.paused { + // Maintain the scene. + self.scene.maintain( + global_state.window.renderer_mut(), + &mut global_state.audio, + &self.client.borrow(), + global_state.settings.graphics.gamma, + ); + } // Render the session. self.render(global_state.window.renderer_mut()); diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index a1b3cec031..c03e79457d 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -12,6 +12,7 @@ const TPS: u64 = 30; enum Msg { Stop, + Pause(bool), } /// Used to start and stop the background thread running the server @@ -50,6 +51,8 @@ impl Singleplayer { settings, ) } + + pub fn pause(&self, paused: bool) { let _ = self.sender.send(Msg::Pause(paused)); } } impl Drop for Singleplayer { @@ -64,8 +67,26 @@ fn run_server(mut server: Server, rec: Receiver) { // Set up an fps clock let mut clock = Clock::start(); + let mut paused = false; loop { + match rec.try_recv() { + Ok(msg) => match msg { + Msg::Stop => break, + Msg::Pause(val) => paused = val, + }, + Err(err) => match err { + TryRecvError::Empty => (), + TryRecvError::Disconnected => break, + }, + } + + if paused { + // Wait for the next tick. + clock.tick(Duration::from_millis(1000 / TPS)); + continue; + } + let events = server .tick(Input::default(), clock.get_last_delta()) .expect("Failed to tick server!"); @@ -81,14 +102,6 @@ fn run_server(mut server: Server, rec: Receiver) { // Clean up the server after a tick. server.cleanup(); - match rec.try_recv() { - Ok(_msg) => break, - Err(err) => match err { - TryRecvError::Empty => (), - TryRecvError::Disconnected => break, - }, - } - // Wait for the next tick. clock.tick(Duration::from_millis(1000 / TPS)); } From af21d19ff36a150edb1468218ada9db5b96cbc7f Mon Sep 17 00:00:00 2001 From: Capucho Date: Tue, 3 Mar 2020 19:51:15 +0000 Subject: [PATCH 061/387] Moved paused from GlobalState to SinglePlayer to prevent errors and unpauses now works using the resume button --- voxygen/src/hud/mod.rs | 11 +++++++---- voxygen/src/main.rs | 2 -- voxygen/src/session.rs | 10 ++++++++-- voxygen/src/singleplayer.rs | 24 ++++++++++++++++++------ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index e4e0605839..7b6e2ee78b 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -381,18 +381,16 @@ impl Show { self.want_grab = true; // Unpause the game if we are on singleplayer - if let Some(ref singleplayer) = global_state.singleplayer { + if let Some(singleplayer) = global_state.singleplayer.as_ref() { singleplayer.pause(false); - global_state.paused = false; }; } else { self.esc_menu = true; self.want_grab = false; // Pause the game if we are on singleplayer - if let Some(ref singleplayer) = global_state.singleplayer { + if let Some(singleplayer) = global_state.singleplayer.as_ref() { singleplayer.pause(true); - global_state.paused = true; }; } } @@ -1929,6 +1927,11 @@ impl Hud { self.show.esc_menu = false; self.show.want_grab = false; self.force_ungrab = true; + + // Unpause the game if we are on singleplayer + if let Some(singleplayer) = global_state.singleplayer.as_ref() { + singleplayer.pause(false); + }; }, Some(esc_menu::Event::Logout) => { events.push(Event::Logout); diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 8379044eea..6cb1ec4e62 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -47,7 +47,6 @@ pub struct GlobalState { audio: AudioFrontend, info_message: Option, singleplayer: Option, - paused: bool, } impl GlobalState { @@ -139,7 +138,6 @@ fn main() { meta, info_message: None, singleplayer: None, - paused: false, }; // Try to load the localization and log missing entries diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index cd79db199d..7670eb1b1e 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -379,7 +379,10 @@ impl PlayState for SessionState { self.inputs.look_dir = cam_dir; - if !global_state.paused { + // Runs if either in a multiplayer server or the singleplayer server is unpaused + if global_state.singleplayer.is_none() + || !global_state.singleplayer.as_ref().unwrap().is_paused() + { // Perform an in-game tick. if let Err(err) = self.tick(clock.get_avg_delta()) { global_state.info_message = @@ -611,7 +614,10 @@ impl PlayState for SessionState { } } - if !global_state.paused { + // Runs if either in a multiplayer server or the singleplayer server is unpaused + if global_state.singleplayer.is_none() + || !global_state.singleplayer.as_ref().unwrap().is_paused() + { // Maintain the scene. self.scene.maintain( global_state.window.renderer_mut(), diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index c03e79457d..d2538c6bf6 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -4,6 +4,7 @@ use crossbeam::channel::{unbounded, Receiver, Sender, TryRecvError}; use log::info; use server::{Event, Input, Server, ServerSettings}; use std::{ + sync::atomic::{AtomicBool, Ordering}, thread::{self, JoinHandle}, time::Duration, }; @@ -20,6 +21,8 @@ enum Msg { pub struct Singleplayer { _server_thread: JoinHandle<()>, sender: Sender, + // Wether the server is stopped or not + paused: AtomicBool, } impl Singleplayer { @@ -47,12 +50,21 @@ impl Singleplayer { Singleplayer { _server_thread: thread, sender, + paused: AtomicBool::new(false), }, settings, ) } - pub fn pause(&self, paused: bool) { let _ = self.sender.send(Msg::Pause(paused)); } + /// Returns wether or not the server is paused + pub fn is_paused(&self) -> bool { self.paused.load(Ordering::Relaxed) } + + /// Pauses if true is passed and unpauses if false (Does nothing if in that + /// state already) + pub fn pause(&self, state: bool) { + self.paused.load(Ordering::SeqCst); + let _ = self.sender.send(Msg::Pause(state)); + } } impl Drop for Singleplayer { @@ -70,6 +82,7 @@ fn run_server(mut server: Server, rec: Receiver) { let mut paused = false; loop { + // Check any event such as stopping and pausing match rec.try_recv() { Ok(msg) => match msg { Msg::Stop => break, @@ -81,9 +94,11 @@ fn run_server(mut server: Server, rec: Receiver) { }, } + // Wait for the next tick. + clock.tick(Duration::from_millis(1000 / TPS)); + + // Skip updating the server if it's paused if paused { - // Wait for the next tick. - clock.tick(Duration::from_millis(1000 / TPS)); continue; } @@ -101,8 +116,5 @@ fn run_server(mut server: Server, rec: Receiver) { // Clean up the server after a tick. server.cleanup(); - - // Wait for the next tick. - clock.tick(Duration::from_millis(1000 / TPS)); } } From f13314e3da05316241f99aef26ee72e44138a47f Mon Sep 17 00:00:00 2001 From: Capucho Date: Tue, 3 Mar 2020 21:26:59 +0000 Subject: [PATCH 062/387] Fixed the erroneous load on pause --- voxygen/src/session.rs | 4 ++++ voxygen/src/singleplayer.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 7670eb1b1e..ba92e95cdd 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -383,6 +383,10 @@ impl PlayState for SessionState { if global_state.singleplayer.is_none() || !global_state.singleplayer.as_ref().unwrap().is_paused() { + log::warn!( + "{}", + global_state.singleplayer.as_ref().unwrap().is_paused() + ); // Perform an in-game tick. if let Err(err) = self.tick(clock.get_avg_delta()) { global_state.info_message = diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index d2538c6bf6..28c7165148 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -57,12 +57,12 @@ impl Singleplayer { } /// Returns wether or not the server is paused - pub fn is_paused(&self) -> bool { self.paused.load(Ordering::Relaxed) } + pub fn is_paused(&self) -> bool { self.paused.load(Ordering::SeqCst) } /// Pauses if true is passed and unpauses if false (Does nothing if in that /// state already) pub fn pause(&self, state: bool) { - self.paused.load(Ordering::SeqCst); + self.paused.store(state, Ordering::SeqCst); let _ = self.sender.send(Msg::Pause(state)); } } From 6f6b8986b6732c4629f69d4e592a8bf288ccd1c2 Mon Sep 17 00:00:00 2001 From: Capucho Date: Tue, 3 Mar 2020 22:07:49 +0000 Subject: [PATCH 063/387] Removed logging, added the changes to the changelog and fixed the logout button --- CHANGELOG.md | 1 + voxygen/src/hud/mod.rs | 5 +++++ voxygen/src/session.rs | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 227c50b450..cd4f119c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added sfx for collecting, dropping and using inventory items - New attack animation - weapon control system +- Game pauses when in singleplayer and pause menu ### Changed diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 7b6e2ee78b..25d41537fe 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1934,6 +1934,11 @@ impl Hud { }; }, Some(esc_menu::Event::Logout) => { + // Unpause the game if we are on singleplayer so that we can logout + if let Some(singleplayer) = global_state.singleplayer.as_ref() { + singleplayer.pause(false); + }; + events.push(Event::Logout); }, Some(esc_menu::Event::Quit) => events.push(Event::Quit), diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index ba92e95cdd..7670eb1b1e 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -383,10 +383,6 @@ impl PlayState for SessionState { if global_state.singleplayer.is_none() || !global_state.singleplayer.as_ref().unwrap().is_paused() { - log::warn!( - "{}", - global_state.singleplayer.as_ref().unwrap().is_paused() - ); // Perform an in-game tick. if let Err(err) = self.tick(clock.get_avg_delta()) { global_state.info_message = From a3479f6a49ebebefa72187ca22161fb2176290ba Mon Sep 17 00:00:00 2001 From: Capucho Date: Wed, 4 Mar 2020 20:42:22 +0000 Subject: [PATCH 064/387] Fixed the bugs in the settings tab and the character button in the escape menu and unpause when there is more than 1 player --- server/src/lib.rs | 2 ++ voxygen/src/hud/mod.rs | 18 ++++++++++++++++-- voxygen/src/singleplayer.rs | 28 +++++++++++++++------------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/server/src/lib.rs b/server/src/lib.rs index 4d11efd110..d9f009a890 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -578,6 +578,8 @@ impl Server { .get(entity) .is_some() } + + pub fn number_of_players(&self) -> i64 { self.metrics.player_online.get() } } impl Drop for Server { diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 25d41537fe..d3818494d2 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1735,7 +1735,14 @@ impl Hud { settings_window::Event::ToggleHelp => self.show.help = !self.show.help, settings_window::Event::ToggleDebug => self.show.debug = !self.show.debug, settings_window::Event::ChangeTab(tab) => self.show.open_setting_tab(tab), - settings_window::Event::Close => self.show.settings(false), + settings_window::Event::Close => { + // Unpause the game if we are on singleplayer so that we can logout + if let Some(singleplayer) = global_state.singleplayer.as_ref() { + singleplayer.pause(false); + }; + + self.show.settings(false) + }, settings_window::Event::AdjustMousePan(sensitivity) => { events.push(Event::AdjustMousePan(sensitivity)); }, @@ -1942,7 +1949,14 @@ impl Hud { events.push(Event::Logout); }, Some(esc_menu::Event::Quit) => events.push(Event::Quit), - Some(esc_menu::Event::CharacterSelection) => events.push(Event::CharacterSelection), + Some(esc_menu::Event::CharacterSelection) => { + // Unpause the game if we are on singleplayer so that we can logout + if let Some(singleplayer) = global_state.singleplayer.as_ref() { + singleplayer.pause(false); + }; + + events.push(Event::CharacterSelection) + }, None => {}, } } diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index 28c7165148..a5e9e5a87d 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -4,7 +4,10 @@ use crossbeam::channel::{unbounded, Receiver, Sender, TryRecvError}; use log::info; use server::{Event, Input, Server, ServerSettings}; use std::{ - sync::atomic::{AtomicBool, Ordering}, + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }, thread::{self, JoinHandle}, time::Duration, }; @@ -13,7 +16,6 @@ const TPS: u64 = 30; enum Msg { Stop, - Pause(bool), } /// Used to start and stop the background thread running the server @@ -22,7 +24,7 @@ pub struct Singleplayer { _server_thread: JoinHandle<()>, sender: Sender, // Wether the server is stopped or not - paused: AtomicBool, + paused: Arc, } impl Singleplayer { @@ -35,6 +37,9 @@ impl Singleplayer { let thread_pool = client.map(|c| c.thread_pool().clone()); let settings2 = settings.clone(); + let paused = Arc::new(AtomicBool::new(false)); + let paused1 = paused.clone(); + let thread = thread::spawn(move || { let server = Server::new(settings2).expect("Failed to create server instance!"); @@ -43,14 +48,14 @@ impl Singleplayer { None => server, }; - run_server(server, receiver); + run_server(server, receiver, paused1); }); ( Singleplayer { _server_thread: thread, sender, - paused: AtomicBool::new(false), + paused, }, settings, ) @@ -61,10 +66,7 @@ impl Singleplayer { /// Pauses if true is passed and unpauses if false (Does nothing if in that /// state already) - pub fn pause(&self, state: bool) { - self.paused.store(state, Ordering::SeqCst); - let _ = self.sender.send(Msg::Pause(state)); - } + pub fn pause(&self, state: bool) { self.paused.store(state, Ordering::SeqCst); } } impl Drop for Singleplayer { @@ -74,19 +76,17 @@ impl Drop for Singleplayer { } } -fn run_server(mut server: Server, rec: Receiver) { +fn run_server(mut server: Server, rec: Receiver, paused: Arc) { info!("Starting server-cli..."); // Set up an fps clock let mut clock = Clock::start(); - let mut paused = false; loop { // Check any event such as stopping and pausing match rec.try_recv() { Ok(msg) => match msg { Msg::Stop => break, - Msg::Pause(val) => paused = val, }, Err(err) => match err { TryRecvError::Empty => (), @@ -98,8 +98,10 @@ fn run_server(mut server: Server, rec: Receiver) { clock.tick(Duration::from_millis(1000 / TPS)); // Skip updating the server if it's paused - if paused { + if paused.load(Ordering::SeqCst) && server.number_of_players() < 2 { continue; + } else if server.number_of_players() > 1 { + paused.store(false, Ordering::SeqCst); } let events = server From ea53dea8a7c620a9af30b30f883de8346bff74ee Mon Sep 17 00:00:00 2001 From: S Handley Date: Thu, 5 Mar 2020 19:26:07 +0000 Subject: [PATCH 065/387] Fixes https://gitlab.com/veloren/veloren/issues/484 partially by saving logs to a fixed place (defined in the settings file) --- voxygen/src/logging.rs | 22 ++++++++++++++++------ voxygen/src/settings.rs | 39 +++++++++++++++++++++++++++++++++++++-- voxygen/src/window.rs | 11 ++++++----- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/voxygen/src/logging.rs b/voxygen/src/logging.rs index 4085b3c30f..50ecbe6481 100644 --- a/voxygen/src/logging.rs +++ b/voxygen/src/logging.rs @@ -1,4 +1,5 @@ use fern::colors::{Color, ColoredLevelConfig}; +use std::fs; use crate::settings::Settings; @@ -39,12 +40,20 @@ pub fn init( )) }); - // Try to create the log file. - // Incase of it failing we simply print it out to the console. - let mut log_file_created = Ok(()); - match fern::log_file(&format!("voxygen-{}.log", time.format("%Y-%m-%d-%H"))) { - Ok(log_file) => file_cfg = file_cfg.chain(log_file), - Err(e) => log_file_created = Err(e), + // Try to create the logs file parent directories. + let mut log_file_created = fs::create_dir_all(&settings.log.logs_path); + + if log_file_created.is_ok() { + // Try to create the log file. + match fern::log_file( + settings + .log + .logs_path + .join(&format!("voxygen-{}.log", time.format("%Y-%m-%d-%H"))), + ) { + Ok(log_file) => file_cfg = file_cfg.chain(log_file), + Err(e) => log_file_created = Err(e), + } } let stdout_cfg = fern::Dispatch::new() @@ -65,6 +74,7 @@ pub fn init( .apply() .expect("Failed to setup logging!"); + // Incase that the log file creation failed simply print it to the console if let Err(e) = log_file_created { log::error!("Failed to create log file! {}", e); } diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 8d339f2837..5bae056d85 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -5,7 +5,7 @@ use crate::{ ui::ScaleMode, window::KeyMouse, }; -use directories::ProjectDirs; +use directories::{ProjectDirs, UserDirs}; use glutin::{MouseButton, VirtualKeyCode}; use log::warn; use serde_derive::{Deserialize, Serialize}; @@ -177,10 +177,28 @@ pub struct Log { // Whether to create a log file or not. // Default is to create one. pub log_to_file: bool, + // The path on which the logs will be stored + pub logs_path: PathBuf, } impl Default for Log { - fn default() -> Self { Self { log_to_file: true } } + fn default() -> Self { + let proj_dirs = ProjectDirs::from("net", "veloren", "voxygen") + .expect("System's $HOME directory path not found!"); + + // Chooses a path to store the logs by the following order: + // - The VOXYGEN_LOGS environment variable + // - The ProjectsDirs data local directory + // This only selects if there isn't already an entry in the settings file + let logs_path = std::env::var_os("VOXYGEN_LOGS") + .map(PathBuf::from) + .unwrap_or(proj_dirs.data_local_dir().join("logs")); + + Self { + log_to_file: true, + logs_path, + } + } } /// `GraphicsSettings` contains settings related to framerate and in-game @@ -273,10 +291,26 @@ pub struct Settings { // TODO: Remove at a later date, for dev testing pub logon_commands: Vec, pub language: LanguageSettings, + pub screenshots_path: PathBuf, } impl Default for Settings { fn default() -> Self { + let user_dirs = UserDirs::new().expect("System's $HOME directory path not found!"); + + // Chooses a path to store the screenshots by the following order: + // - The VOXYGEN_SCREENSHOT environment variable + // - The user's picture directory + // - The executable's directory + // This only selects if there isn't already an entry in the settings file + let screenshots_path = std::env::var_os("VOXYGEN_SCREENSHOT") + .map(PathBuf::from) + .or(user_dirs.picture_dir().map(|dir| dir.join("veloren"))) + .or(std::env::current_exe() + .ok() + .and_then(|dir| dir.parent().map(|val| PathBuf::from(val)))) + .expect("Couldn't choose a place to store the screenshots"); + Settings { controls: ControlSettings::default(), gameplay: GameplaySettings::default(), @@ -288,6 +322,7 @@ impl Default for Settings { send_logon_commands: false, logon_commands: Vec::new(), language: LanguageSettings::default(), + screenshots_path, } } } diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 1b43c15787..59c9b6c4ed 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -594,7 +594,7 @@ impl Window { }); if take_screenshot { - self.take_screenshot(); + self.take_screenshot(&settings); } if toggle_fullscreen { @@ -659,15 +659,16 @@ impl Window { pub fn send_supplement_event(&mut self, event: Event) { self.supplement_events.push(event) } - pub fn take_screenshot(&mut self) { + pub fn take_screenshot(&mut self, settings: &Settings) { match self.renderer.create_screenshot() { Ok(img) => { + let mut path = settings.screenshots_path.clone(); + std::thread::spawn(move || { - use std::{path::PathBuf, time::SystemTime}; + use std::time::SystemTime; // Check if folder exists and create it if it does not - let mut path = PathBuf::from("./screenshots"); if !path.exists() { - if let Err(err) = std::fs::create_dir(&path) { + if let Err(err) = std::fs::create_dir_all(&path) { warn!("Couldn't create folder for screenshot: {:?}", err); } } From 4a0c474be128d6b9cb8240c4c9ef08a3f8fbb52e Mon Sep 17 00:00:00 2001 From: Imbris Date: Fri, 28 Feb 2020 22:59:11 -0500 Subject: [PATCH 066/387] Remove `Client` dependency from Scene types and audio managers, add an example for using voxygen as a library to renderer images of characters --- Cargo.lock | 1 + voxygen/Cargo.toml | 2 + voxygen/examples/character_renderer.rs | 58 ++++++++ voxygen/src/audio/music.rs | 11 +- voxygen/src/audio/sfx/event_mapper/mod.rs | 16 ++- .../audio/sfx/event_mapper/movement/mod.rs | 10 +- .../src/audio/sfx/event_mapper/progression.rs | 13 +- voxygen/src/audio/sfx/mod.rs | 18 ++- voxygen/src/hud/mod.rs | 12 +- voxygen/src/lib.rs | 84 +++++++++++- voxygen/src/main.rs | 85 +----------- voxygen/src/menu/char_selection/mod.rs | 31 +++-- voxygen/src/scene/camera.rs | 41 ++++-- voxygen/src/scene/figure/mod.rs | 43 +++--- voxygen/src/scene/mod.rs | 103 ++++++++------ .../scene.rs => scene/simple.rs} | 126 +++++++++++------- voxygen/src/scene/terrain.rs | 44 +++--- voxygen/src/session.rs | 37 +++-- 18 files changed, 460 insertions(+), 275 deletions(-) create mode 100644 voxygen/examples/character_renderer.rs rename voxygen/src/{menu/char_selection/scene.rs => scene/simple.rs} (66%) diff --git a/Cargo.lock b/Cargo.lock index 399d5b6a2f..083ae3808f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3377,6 +3377,7 @@ dependencies = [ "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", "treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)", + "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-client 0.5.0", "veloren-common 0.5.0", diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 7c3e6debb0..9ae1608213 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -63,6 +63,7 @@ chrono = "0.4.9" rust-argon2 = "0.5" bincode = "1.2" deunicode = "1.0" +uvth = "3.1.1" [target.'cfg(target_os = "macos")'.dependencies] dispatch = "0.1.4" @@ -74,6 +75,7 @@ winres = "0.1" criterion = "0.3" git2 = "0.10" world = { package = "veloren-world", path = "../world" } +gfx_window_glutin = { version = "0.31.0", features = ["headless"] } [[bench]] name = "meshing_benchmark" diff --git a/voxygen/examples/character_renderer.rs b/voxygen/examples/character_renderer.rs new file mode 100644 index 0000000000..ae07183f5e --- /dev/null +++ b/voxygen/examples/character_renderer.rs @@ -0,0 +1,58 @@ +use common::{assets, comp}; +use gfx_window_glutin::init_headless; +use vek::*; +use veloren_voxygen::{render, scene::simple as scene}; + +fn main() { + // Setup renderer + let dim = (200u16, 300u16, 1, gfx::texture::AaMode::Single); + let events_loop = glutin::EventsLoop::new(); + let context = glutin::ContextBuilder::new() + .with_gl(glutin::GlRequest::Specific(glutin::Api::OpenGl, (3, 2))) + .build_headless(&events_loop, (dim.0 as u32, dim.1 as u32).into()) + .expect("Failed to build headless context"); + + let (_context, device, factory, color_view, depth_view) = init_headless(context, dim); + + let mut renderer = render::Renderer::new( + device, + factory, + color_view, + depth_view, + render::AaMode::SsaaX4, + render::CloudMode::Regular, + render::FluidMode::Shiny, + ) + .unwrap(); + + // Create character + let body = comp::humanoid::Body::random(); + const STARTER_BOW: &str = "common.items.weapons.starter_bow"; + let equipment = comp::Equipment { + main: assets::load_cloned(STARTER_BOW).ok(), + alt: None, + }; + + // Setup scene (using the character selection screen `Scene`) + let mut scene = scene::Scene::new(&mut renderer, None); + let scene_data = scene::SceneData { + time: 1.0, + delta_time: 1.0, + tick: 0, + body: Some(body.clone()), + gamma: 1.0, + }; + scene.camera_mut().set_focus_pos(Vec3::unit_z() * 0.8); + scene.camera_mut().set_distance(1.5); + scene.camera_mut().update(0.0); + scene.maintain(&mut renderer, scene_data); + + // Render + renderer.clear(); + scene.render(&mut renderer, 0, Some(body), &equipment); + + renderer.flush(); + // Get image + let img = renderer.create_screenshot().unwrap(); + img.save("character.png").unwrap(); +} diff --git a/voxygen/src/audio/music.rs b/voxygen/src/audio/music.rs index 7b46abd016..397472472f 100644 --- a/voxygen/src/audio/music.rs +++ b/voxygen/src/audio/music.rs @@ -1,6 +1,5 @@ use crate::audio::AudioFrontend; -use client::Client; -use common::assets; +use common::{assets, state::State}; use rand::{seq::IteratorRandom, thread_rng}; use serde::Deserialize; use std::time::Instant; @@ -44,18 +43,18 @@ impl MusicMgr { } } - pub fn maintain(&mut self, audio: &mut AudioFrontend, client: &Client) { + pub fn maintain(&mut self, audio: &mut AudioFrontend, state: &State) { if audio.music_enabled() && self.began_playing.elapsed().as_secs_f64() > self.next_track_change { - self.play_random_track(audio, client); + self.play_random_track(audio, state); } } - fn play_random_track(&mut self, audio: &mut AudioFrontend, client: &Client) { + fn play_random_track(&mut self, audio: &mut AudioFrontend, state: &State) { const SILENCE_BETWEEN_TRACKS_SECONDS: f64 = 45.0; - let game_time = (client.state().get_time_of_day() as u64 % 86400) as u32; + let game_time = (state.get_time_of_day() as u64 % 86400) as u32; let current_period_of_day = Self::get_current_day_period(game_time); let mut rng = thread_rng(); diff --git a/voxygen/src/audio/sfx/event_mapper/mod.rs b/voxygen/src/audio/sfx/event_mapper/mod.rs index 94905cb802..a745b4de67 100644 --- a/voxygen/src/audio/sfx/event_mapper/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/mod.rs @@ -1,11 +1,12 @@ mod movement; mod progression; +use common::state::State; + use movement::MovementEventMapper; use progression::ProgressionEventMapper; use super::SfxTriggers; -use client::Client; pub struct SfxEventMapper { progression_event_mapper: ProgressionEventMapper, @@ -20,8 +21,15 @@ impl SfxEventMapper { } } - pub fn maintain(&mut self, client: &Client, triggers: &SfxTriggers) { - self.progression_event_mapper.maintain(client, triggers); - self.movement_event_mapper.maintain(client, triggers); + pub fn maintain( + &mut self, + state: &State, + player_entity: specs::Entity, + triggers: &SfxTriggers, + ) { + self.progression_event_mapper + .maintain(state, player_entity, triggers); + self.movement_event_mapper + .maintain(state, player_entity, triggers); } } diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 617092e8d6..d222042a64 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -3,10 +3,10 @@ /// from use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; -use client::Client; use common::{ comp::{ActionState, Body, CharacterState, Item, ItemKind, MovementState, Pos, Stats, Vel}, event::{EventBus, SfxEvent, SfxEventItem}, + state::State, }; use hashbrown::HashMap; use specs::{Entity as EcsEntity, Join, WorldExt}; @@ -31,13 +31,13 @@ impl MovementEventMapper { } } - pub fn maintain(&mut self, client: &Client, triggers: &SfxTriggers) { + pub fn maintain(&mut self, state: &State, player_entity: EcsEntity, triggers: &SfxTriggers) { const SFX_DIST_LIMIT_SQR: f32 = 20000.0; - let ecs = client.state().ecs(); + let ecs = state.ecs(); let player_position = ecs .read_storage::() - .get(client.entity()) + .get(player_entity) .map_or(Vec3::zero(), |pos| pos.0); for (entity, pos, vel, body, stats, character) in ( @@ -97,7 +97,7 @@ impl MovementEventMapper { } } - self.cleanup(client.entity()); + self.cleanup(player_entity); } /// As the player explores the world, we track the last event of the nearby diff --git a/voxygen/src/audio/sfx/event_mapper/progression.rs b/voxygen/src/audio/sfx/event_mapper/progression.rs index 3edfcf1f7b..7c05db0360 100644 --- a/voxygen/src/audio/sfx/event_mapper/progression.rs +++ b/voxygen/src/audio/sfx/event_mapper/progression.rs @@ -2,10 +2,10 @@ /// and experience and emits associated SFX use crate::audio::sfx::SfxTriggers; -use client::Client; use common::{ comp::Stats, event::{EventBus, SfxEvent, SfxEventItem}, + state::State, }; use specs::WorldExt; @@ -30,13 +30,18 @@ impl ProgressionEventMapper { } } - pub fn maintain(&mut self, client: &Client, triggers: &SfxTriggers) { - let ecs = client.state().ecs(); + pub fn maintain( + &mut self, + state: &State, + player_entity: specs::Entity, + triggers: &SfxTriggers, + ) { + let ecs = state.ecs(); // level and exp changes let next_state = ecs.read_storage::() - .get(client.entity()) + .get(player_entity) .map_or(self.state.clone(), |stats| ProgressionState { level: stats.level.level(), exp: stats.exp.current(), diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 2af778a0ef..86771e86c2 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -4,11 +4,11 @@ mod event_mapper; use crate::audio::AudioFrontend; -use client::Client; use common::{ assets, comp::{Ori, Pos}, event::{EventBus, SfxEvent, SfxEventItem}, + state::State, }; use event_mapper::SfxEventMapper; use hashbrown::HashMap; @@ -50,23 +50,29 @@ impl SfxMgr { } } - pub fn maintain(&mut self, audio: &mut AudioFrontend, client: &Client) { + pub fn maintain( + &mut self, + audio: &mut AudioFrontend, + state: &State, + player_entity: specs::Entity, + ) { if !audio.sfx_enabled() { return; } - self.event_mapper.maintain(client, &self.triggers); + self.event_mapper + .maintain(state, player_entity, &self.triggers); - let ecs = client.state().ecs(); + let ecs = state.ecs(); let player_position = ecs .read_storage::() - .get(client.entity()) + .get(player_entity) .map_or(Vec3::zero(), |pos| pos.0); let player_ori = ecs .read_storage::() - .get(client.entity()) + .get(player_entity) .map_or(Vec3::zero(), |pos| pos.0); audio.set_listener_pos(&player_position, &player_ori); diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index d3818494d2..f5a0a89ad8 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -38,7 +38,7 @@ use crate::{ ecs::comp as vcomp, i18n::{i18n_asset_key, LanguageMetadata, VoxygenLocalization}, render::{AaMode, CloudMode, Consts, FluidMode, Globals, Renderer}, - scene::camera::Camera, + scene::camera::{self, Camera}, ui::{fonts::ConrodVoxygenFonts, Graphic, Ingameable, ScaleMode, Ui}, window::{Event as WinEvent, GameInput}, GlobalState, @@ -2112,9 +2112,13 @@ impl Hud { self.ui.focus_widget(maybe_id); } let events = self.update_layout(client, global_state, debug_info, dt); - let (v_mat, p_mat, _) = camera.compute_dependents(client); - self.ui - .maintain(&mut global_state.window.renderer_mut(), Some(p_mat * v_mat)); + let camera::Dependents { + view_mat, proj_mat, .. + } = camera.dependents(); + self.ui.maintain( + &mut global_state.window.renderer_mut(), + Some(proj_mat * view_mat), + ); // Check if item images need to be reloaded self.item_imgs.reload_if_changed(&mut self.ui); diff --git a/voxygen/src/lib.rs b/voxygen/src/lib.rs index 301aab5d19..56877b2131 100644 --- a/voxygen/src/lib.rs +++ b/voxygen/src/lib.rs @@ -1,6 +1,82 @@ -/// Used by benchmarks -pub mod mesh; -pub mod render; +#![deny(unsafe_code)] +#![feature(drain_filter)] +#![recursion_limit = "2048"] -// Used by tests +#[macro_use] +pub mod ui; +pub mod anim; +pub mod audio; +mod ecs; +pub mod error; +pub mod hud; pub mod i18n; +pub mod key_state; +pub mod logging; +pub mod menu; +pub mod mesh; +pub mod meta; +pub mod render; +pub mod scene; +pub mod session; +pub mod settings; +#[cfg(feature = "singleplayer")] +pub mod singleplayer; +pub mod window; + +// Reexports +pub use crate::error::Error; + +use crate::{ + audio::AudioFrontend, meta::Meta, settings::Settings, singleplayer::Singleplayer, + window::Window, +}; + +/// A type used to store state that is shared between all play states. +pub struct GlobalState { + pub settings: Settings, + pub meta: Meta, + pub window: Window, + pub audio: AudioFrontend, + pub info_message: Option, + pub singleplayer: Option, +} + +impl GlobalState { + /// Called after a change in play state has occurred (usually used to + /// reverse any temporary effects a state may have made). + pub fn on_play_state_changed(&mut self) { + self.window.grab_cursor(false); + self.window.needs_refresh_resize(); + } + + pub fn maintain(&mut self, dt: f32) { self.audio.maintain(dt); } +} + +pub enum Direction { + Forwards, + Backwards, +} + +/// States can either close (and revert to a previous state), push a new state +/// on top of themselves, or switch to a totally different state. +pub enum PlayStateResult { + /// Pop all play states in reverse order and shut down the program. + Shutdown, + /// Close the current play state and pop it from the play state stack. + Pop, + /// Push a new play state onto the play state stack. + Push(Box), + /// Switch the current play state with a new play state. + Switch(Box), +} + +/// A trait representing a playable game state. This may be a menu, a game +/// session, the title screen, etc. +pub trait PlayState { + /// Play the state until some change of state is required (i.e: a menu is + /// opened or the game is closed). + fn play(&mut self, direction: Direction, global_state: &mut GlobalState) -> PlayStateResult; + + /// Get a descriptive name for this state type. + fn name(&self) -> &'static str; +} diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 6cb1ec4e62..f2a091daf0 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -1,94 +1,21 @@ #![deny(unsafe_code)] -#![feature(drain_filter)] #![recursion_limit = "2048"] -#[macro_use] -pub mod ui; -pub mod anim; -pub mod audio; -mod ecs; -pub mod error; -pub mod hud; -pub mod i18n; -pub mod key_state; -mod logging; -pub mod menu; -pub mod mesh; -pub mod meta; -pub mod render; -pub mod scene; -pub mod session; -pub mod settings; -#[cfg(feature = "singleplayer")] -pub mod singleplayer; -pub mod window; - -// Reexports -pub use crate::error::Error; - -use crate::{ - audio::AudioFrontend, - i18n::{i18n_asset_key, VoxygenLocalization}, +use veloren_voxygen::{ + audio::{self, AudioFrontend}, + i18n::{self, i18n_asset_key, VoxygenLocalization}, + logging, menu::main::MainMenuState, meta::Meta, settings::Settings, - singleplayer::Singleplayer, window::Window, + Direction, GlobalState, PlayState, PlayStateResult, }; + use common::assets::{load, load_expect}; use log::{debug, error}; use std::{mem, panic, str::FromStr}; -/// A type used to store state that is shared between all play states. -pub struct GlobalState { - settings: Settings, - meta: Meta, - window: Window, - audio: AudioFrontend, - info_message: Option, - singleplayer: Option, -} - -impl GlobalState { - /// Called after a change in play state has occurred (usually used to - /// reverse any temporary effects a state may have made). - pub fn on_play_state_changed(&mut self) { - self.window.grab_cursor(false); - self.window.needs_refresh_resize(); - } - - pub fn maintain(&mut self, dt: f32) { self.audio.maintain(dt); } -} - -pub enum Direction { - Forwards, - Backwards, -} - -/// States can either close (and revert to a previous state), push a new state -/// on top of themselves, or switch to a totally different state. -pub enum PlayStateResult { - /// Pop all play states in reverse order and shut down the program. - Shutdown, - /// Close the current play state and pop it from the play state stack. - Pop, - /// Push a new play state onto the play state stack. - Push(Box), - /// Switch the current play state with a new play state. - Switch(Box), -} - -/// A trait representing a playable game state. This may be a menu, a game -/// session, the title screen, etc. -pub trait PlayState { - /// Play the state until some change of state is required (i.e: a menu is - /// opened or the game is closed). - fn play(&mut self, direction: Direction, global_state: &mut GlobalState) -> PlayStateResult; - - /// Get a descriptive name for this state type. - fn name(&self) -> &'static str; -} - fn main() { // Initialize logging. let term_log_level = std::env::var_os("VOXYGEN_LOG") diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 6dc28fb820..f7eaae27c2 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -1,16 +1,16 @@ -mod scene; mod ui; use crate::{ i18n::{i18n_asset_key, VoxygenLocalization}, + scene::simple::{self as scene, Scene}, session::SessionState, window::Event as WinEvent, Direction, GlobalState, PlayState, PlayStateResult, }; use client::{self, Client}; -use common::{assets, clock::Clock, comp, msg::ClientState}; +use common::{assets, clock::Clock, comp, msg::ClientState, state::DeltaTime}; use log::error; -use scene::Scene; +use specs::WorldExt; use std::{cell::RefCell, rc::Rc, time::Duration}; use ui::CharSelectionUi; @@ -26,7 +26,10 @@ impl CharSelectionState { Self { char_selection_ui: CharSelectionUi::new(global_state), client, - scene: Scene::new(global_state.window.renderer_mut()), + scene: Scene::new( + global_state.window.renderer_mut(), + Some("fixture.selection_bg"), + ), } } } @@ -95,17 +98,23 @@ impl PlayState for CharSelectionState { }); // Maintain the scene. - self.scene.maintain( - global_state.window.renderer_mut(), - &self.client.borrow(), - humanoid_body.clone(), - global_state.settings.graphics.gamma, - ); + { + let client = self.client.borrow(); + let scene_data = scene::SceneData { + time: client.state().get_time(), + delta_time: client.state().ecs().read_resource::().0, + tick: client.get_tick(), + body: humanoid_body.clone(), + gamma: global_state.settings.graphics.gamma, + }; + self.scene + .maintain(global_state.window.renderer_mut(), scene_data); + } // Render the scene. self.scene.render( global_state.window.renderer_mut(), - &self.client.borrow(), + self.client.borrow().get_tick(), humanoid_body.clone(), &comp::Equipment { main: self diff --git a/voxygen/src/scene/camera.rs b/voxygen/src/scene/camera.rs index a0d0d59e54..9eb279d3c5 100644 --- a/voxygen/src/scene/camera.rs +++ b/voxygen/src/scene/camera.rs @@ -1,4 +1,3 @@ -use client::Client; use common::vol::{ReadVol, Vox}; use std::f32::consts::PI; use treeculler::Frustum; @@ -22,6 +21,13 @@ impl Default for CameraMode { fn default() -> Self { Self::ThirdPerson } } +#[derive(Clone)] +pub struct Dependents { + pub view_mat: Mat4, + pub proj_mat: Mat4, + pub cam_pos: Vec3, +} + pub struct Camera { tgt_focus: Vec3, focus: Vec3, @@ -33,6 +39,8 @@ pub struct Camera { mode: CameraMode, last_time: Option, + + dependents: Dependents, } impl Camera { @@ -49,12 +57,18 @@ impl Camera { mode, last_time: None, + + dependents: Dependents { + view_mat: Mat4::identity(), + proj_mat: Mat4::identity(), + cam_pos: Vec3::zero(), + }, } } /// Compute the transformation matrices (view matrix and projection matrix) /// and position of the camera. - pub fn compute_dependents(&self, client: &Client) -> (Mat4, Mat4, Vec3) { + pub fn compute_dependents(&mut self, terrain: &impl ReadVol) { let dist = { let (start, end) = ( self.focus @@ -66,9 +80,7 @@ impl Camera { self.focus, ); - match client - .state() - .terrain() + match terrain .ray(start, end) .ignore_error() .max_iter(500) @@ -82,7 +94,7 @@ impl Camera { .max(0.0) }; - let view_mat = Mat4::::identity() + self.dependents.view_mat = Mat4::::identity() * Mat4::translation_3d(-Vec3::unit_z() * dist) * Mat4::rotation_z(self.ori.z) * Mat4::rotation_x(self.ori.y) @@ -90,20 +102,21 @@ impl Camera { * Mat4::rotation_3d(PI / 2.0, -Vec4::unit_x()) * Mat4::translation_3d(-self.focus); - let proj_mat = Mat4::perspective_rh_no(self.fov, self.aspect, NEAR_PLANE, FAR_PLANE); + self.dependents.proj_mat = + Mat4::perspective_rh_no(self.fov, self.aspect, NEAR_PLANE, FAR_PLANE); // TODO: Make this more efficient. - let cam_pos = Vec3::from(view_mat.inverted() * Vec4::unit_w()); - - (view_mat, proj_mat, cam_pos) + self.dependents.cam_pos = Vec3::from(self.dependents.view_mat.inverted() * Vec4::unit_w()); } - pub fn frustum(&self, client: &Client) -> Frustum { - let (view_mat, proj_mat, _) = self.compute_dependents(client); - - Frustum::from_modelview_projection((proj_mat * view_mat).into_col_arrays()) + pub fn frustum(&self) -> Frustum { + Frustum::from_modelview_projection( + (self.dependents.proj_mat * self.dependents.view_mat).into_col_arrays(), + ) } + pub fn dependents(&self) -> Dependents { self.dependents.clone() } + /// Rotate the camera about its focus by the given delta, limiting the input /// accordingly. pub fn rotate_by(&mut self, delta: Vec3) { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 9feaf4f7f1..47a0674246 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1,5 +1,5 @@ mod cache; -mod load; +pub mod load; pub use cache::FigureModelCache; pub use load::load_mesh; // TODO: Don't make this public. @@ -13,14 +13,17 @@ use crate::{ quadruped_small::QuadrupedSmallSkeleton, Animation, Skeleton, }, render::{Consts, FigureBoneData, FigureLocals, Globals, Light, Renderer, Shadow}, - scene::camera::{Camera, CameraMode}, + scene::{ + camera::{Camera, CameraMode}, + SceneData, + }, }; -use client::Client; use common::{ comp::{ ActionState::*, Body, CharacterState, ItemKind, Last, MovementState::*, Ori, Pos, Scale, Stats, Vel, }, + state::State, terrain::TerrainChunk, vol::RectRasterableVol, }; @@ -96,17 +99,18 @@ impl FigureMgr { self.biped_large_model_cache.clean(tick); } - pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client, camera: &Camera) { - let time = client.state().get_time(); - let tick = client.get_tick(); - let ecs = client.state().ecs(); - let view_distance = client.view_distance().unwrap_or(1); - let dt = client.state().get_delta_time(); - let frustum = camera.frustum(client); + pub fn maintain(&mut self, renderer: &mut Renderer, scene_data: &SceneData, camera: &Camera) { + let state = scene_data.state; + let time = state.get_time(); + let tick = scene_data.tick; + let ecs = state.ecs(); + let view_distance = scene_data.view_distance; + let dt = state.get_delta_time(); + let frustum = camera.frustum(); // Get player position. let player_pos = ecs .read_storage::() - .get(client.entity()) + .get(scene_data.player_entity) .map_or(Vec3::zero(), |pos| pos.0); for (entity, pos, ori, scale, body, character, last_character, stats) in ( @@ -1181,7 +1185,7 @@ impl FigureMgr { } } - // Clear states that have dead entities. + // Clear states that have deleted entities. self.character_states .retain(|entity, _| ecs.entities().is_alive(*entity)); self.quadruped_small_states @@ -1209,19 +1213,18 @@ impl FigureMgr { pub fn render( &mut self, renderer: &mut Renderer, - client: &mut Client, + state: &State, + player_entity: EcsEntity, + tick: u64, globals: &Consts, lights: &Consts, shadows: &Consts, camera: &Camera, ) { - let tick = client.get_tick(); - let ecs = client.state().ecs(); + let ecs = state.ecs(); - let character_state_storage = client - .state() - .read_storage::(); - let character_state = character_state_storage.get(client.entity()); + let character_state_storage = state.read_storage::(); + let character_state = character_state_storage.get(player_entity); for (entity, _, _, body, stats, _) in ( &ecs.entities(), @@ -1235,7 +1238,7 @@ impl FigureMgr { // Don't render dead entities .filter(|(_, _, _, _, stats, _)| stats.map_or(true, |s| !s.is_dead)) { - let is_player = entity == client.entity(); + let is_player = entity == player_entity; let player_camera_mode = if is_player { camera.get_mode() } else { diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 6653a75e8e..84c6aa2f3e 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -1,29 +1,29 @@ pub mod camera; pub mod figure; +pub mod simple; pub mod terrain; use self::{ camera::{Camera, CameraMode}, figure::FigureMgr, - music::MusicMgr, terrain::Terrain, }; use crate::{ anim::character::SkeletonAttr, - audio::{music, sfx::SfxMgr, AudioFrontend}, + audio::{music::MusicMgr, sfx::SfxMgr, AudioFrontend}, render::{ create_pp_mesh, create_skybox_mesh, Consts, Globals, Light, Model, PostProcessLocals, PostProcessPipeline, Renderer, Shadow, SkyboxLocals, SkyboxPipeline, }, window::Event, }; -use client::Client; use common::{ comp, + state::State, terrain::{BlockKind, TerrainChunk}, vol::ReadVol, }; -use specs::{Join, WorldExt}; +use specs::{Entity as EcsEntity, Join, WorldExt}; use vek::*; // TODO: Don't hard-code this. @@ -62,6 +62,15 @@ pub struct Scene { music_mgr: MusicMgr, } +pub struct SceneData<'a> { + pub state: &'a State, + pub player_entity: specs::Entity, + pub loaded_distance: f32, + pub view_distance: u32, + pub tick: u64, + pub thread_pool: &'a uvth::ThreadPool, +} + impl Scene { /// Create a new `Scene` with default parameters. pub fn new(renderer: &mut Renderer) -> Self { @@ -148,29 +157,29 @@ impl Scene { &mut self, renderer: &mut Renderer, audio: &mut AudioFrontend, - client: &Client, + scene_data: &SceneData, gamma: f32, ) { // Get player position. - let player_pos = client - .state() + let player_pos = scene_data + .state .ecs() .read_storage::() - .get(client.entity()) + .get(scene_data.player_entity) .map_or(Vec3::zero(), |pos| pos.0); - let player_rolling = client - .state() + let player_rolling = scene_data + .state .ecs() .read_storage::() - .get(client.entity()) + .get(scene_data.player_entity) .map_or(false, |cs| cs.action.is_roll()); - let player_scale = match client - .state() + let player_scale = match scene_data + .state .ecs() .read_storage::() - .get(client.entity()) + .get(scene_data.player_entity) { Some(comp::Body::Humanoid(body)) => SkeletonAttr::calculate_scale(body), _ => 1_f32, @@ -196,25 +205,30 @@ impl Scene { ); // Tick camera for interpolation. - self.camera.update(client.state().get_time()); + self.camera.update(scene_data.state.get_time()); // Compute camera matrices. - let (view_mat, proj_mat, cam_pos) = self.camera.compute_dependents(client); + self.camera.compute_dependents(&*scene_data.state.terrain()); + let camera::Dependents { + view_mat, + proj_mat, + cam_pos, + } = self.camera.dependents(); // Update chunk loaded distance smoothly for nice shader fog - let loaded_distance = client.loaded_distance(); - self.loaded_distance = (0.98 * self.loaded_distance + 0.02 * loaded_distance).max(0.01); + self.loaded_distance = + (0.98 * self.loaded_distance + 0.02 * scene_data.loaded_distance).max(0.01); // Update light constants let mut lights = ( - &client.state().ecs().read_storage::(), - client.state().ecs().read_storage::().maybe(), - client - .state() + &scene_data.state.ecs().read_storage::(), + scene_data.state.ecs().read_storage::().maybe(), + scene_data + .state .ecs() .read_storage::() .maybe(), - &client.state().ecs().read_storage::(), + &scene_data.state.ecs().read_storage::(), ) .join() .filter(|(pos, _, _, _)| { @@ -247,15 +261,15 @@ impl Scene { // Update shadow constants let mut shadows = ( - &client.state().ecs().read_storage::(), - client - .state() + &scene_data.state.ecs().read_storage::(), + scene_data + .state .ecs() .read_storage::() .maybe(), - client.state().ecs().read_storage::().maybe(), - &client.state().ecs().read_storage::(), - &client.state().ecs().read_storage::(), + scene_data.state.ecs().read_storage::().maybe(), + &scene_data.state.ecs().read_storage::(), + &scene_data.state.ecs().read_storage::(), ) .join() .filter(|(_, _, _, _, stats)| !stats.is_dead) @@ -285,13 +299,13 @@ impl Scene { cam_pos, self.camera.get_focus_pos(), self.loaded_distance, - client.state().get_time_of_day(), - client.state().get_time(), + scene_data.state.get_time_of_day(), + scene_data.state.get_time(), renderer.get_resolution(), lights.len(), shadows.len(), - client - .state() + scene_data + .state .terrain() .get(cam_pos.map(|e| e.floor() as i32)) .map(|b| b.kind()) @@ -304,7 +318,7 @@ impl Scene { // Maintain the terrain. self.terrain.maintain( renderer, - client, + &scene_data, self.camera.get_focus_pos(), self.loaded_distance, view_mat, @@ -312,22 +326,31 @@ impl Scene { ); // Maintain the figures. - self.figure_mgr.maintain(renderer, client, &self.camera); + self.figure_mgr.maintain(renderer, scene_data, &self.camera); // Remove unused figures. - self.figure_mgr.clean(client.get_tick()); + self.figure_mgr.clean(scene_data.tick); // Maintain audio - self.sfx_mgr.maintain(audio, client); - self.music_mgr.maintain(audio, client); + self.sfx_mgr + .maintain(audio, scene_data.state, scene_data.player_entity); + self.music_mgr.maintain(audio, scene_data.state); } /// Render the scene using the provided `Renderer`. - pub fn render(&mut self, renderer: &mut Renderer, client: &mut Client) { + pub fn render( + &mut self, + renderer: &mut Renderer, + state: &State, + player_entity: EcsEntity, + tick: u64, + ) { // Render terrain and figures. self.figure_mgr.render( renderer, - client, + state, + player_entity, + tick, &self.globals, &self.lights, &self.shadows, diff --git a/voxygen/src/menu/char_selection/scene.rs b/voxygen/src/scene/simple.rs similarity index 66% rename from voxygen/src/menu/char_selection/scene.rs rename to voxygen/src/scene/simple.rs index c09f794013..e319c44942 100644 --- a/voxygen/src/menu/char_selection/scene.rs +++ b/voxygen/src/scene/simple.rs @@ -9,21 +9,37 @@ use crate::{ PostProcessLocals, PostProcessPipeline, Renderer, Shadow, SkyboxLocals, SkyboxPipeline, }, scene::{ - camera::{Camera, CameraMode}, + camera::{self, Camera, CameraMode}, figure::{load_mesh, FigureModelCache, FigureState}, }, window::{Event, PressState}, }; -use client::Client; use common::{ comp::{humanoid, Body, Equipment}, - state::DeltaTime, terrain::BlockKind, + vol::{BaseVol, ReadVol, Vox}, }; use log::error; -use specs::WorldExt; use vek::*; +#[derive(PartialEq, Eq, Copy, Clone)] +struct VoidVox; +impl Vox for VoidVox { + fn empty() -> Self { VoidVox } + + fn is_empty(&self) -> bool { true } + + fn or(self, _other: Self) -> Self { VoidVox } +} +struct VoidVol; +impl BaseVol for VoidVol { + type Error = (); + type Vox = VoidVox; +} +impl ReadVol for VoidVol { + fn get<'a>(&'a self, _pos: Vec3) -> Result<&'a Self::Vox, Self::Error> { Ok(&VoidVox) } +} + struct Skybox { model: Model, locals: Consts, @@ -42,8 +58,7 @@ pub struct Scene { skybox: Skybox, postprocess: PostProcess, - backdrop_model: Model, - backdrop_state: FigureState, + backdrop: Option<(Model, FigureState)>, figure_model_cache: FigureModelCache, figure_state: FigureState, @@ -52,15 +67,28 @@ pub struct Scene { char_ori: f32, } +pub struct SceneData { + pub time: f64, + pub delta_time: f32, + pub tick: u64, + pub body: Option, + pub gamma: f32, +} + impl Scene { - pub fn new(renderer: &mut Renderer) -> Self { + pub fn new(renderer: &mut Renderer, backdrop: Option<&str>) -> Self { let resolution = renderer.get_resolution().map(|e| e as f32); + let mut camera = Camera::new(resolution.x / resolution.y, CameraMode::ThirdPerson); + camera.set_focus_pos(Vec3::unit_z() * 1.5); + camera.set_distance(3.0); // 4.2 + camera.set_orientation(Vec3::new(0.0, 0.0, 0.0)); + Self { globals: renderer.create_consts(&[Globals::default()]).unwrap(), lights: renderer.create_consts(&[Light::default(); 32]).unwrap(), shadows: renderer.create_consts(&[Shadow::default(); 32]).unwrap(), - camera: Camera::new(resolution.x / resolution.y, CameraMode::ThirdPerson), + camera, skybox: Skybox { model: renderer.create_model(&create_skybox_mesh()).unwrap(), @@ -75,13 +103,14 @@ impl Scene { figure_model_cache: FigureModelCache::new(), figure_state: FigureState::new(renderer, CharacterSkeleton::new()), - backdrop_model: renderer - .create_model(&load_mesh( - "fixture.selection_bg", - Vec3::new(-55.0, -49.5, -2.0), - )) - .unwrap(), - backdrop_state: FigureState::new(renderer, FixtureSkeleton::new()), + backdrop: backdrop.map(|specifier| { + ( + renderer + .create_model(&load_mesh(specifier, Vec3::new(-55.0, -49.5, -2.0))) + .unwrap(), + FigureState::new(renderer, FixtureSkeleton::new()), + ) + }), turning: false, char_ori: 0.0, @@ -90,6 +119,8 @@ impl Scene { pub fn globals(&self) -> &Consts { &self.globals } + pub fn camera_mut(&mut self) -> &mut Camera { &mut self.camera } + /// Handle an incoming user input event (e.g.: cursor moved, key pressed, /// window closed). /// @@ -114,20 +145,18 @@ impl Scene { } } - pub fn maintain( - &mut self, - renderer: &mut Renderer, - client: &Client, - body: Option, - gamma: f32, - ) { - self.camera.set_focus_pos(Vec3::unit_z() * 1.5); - self.camera.update(client.state().get_time()); - self.camera.set_distance(3.0); // 4.2 - self.camera - .set_orientation(Vec3::new(client.state().get_time() as f32 * 0.0, 0.0, 0.0)); + pub fn maintain(&mut self, renderer: &mut Renderer, scene_data: SceneData) { + self.camera.update(scene_data.time); - let (view_mat, proj_mat, cam_pos) = self.camera.compute_dependents(client); + //self.camera + // .set_orientation(Vec3::new(scene_data.time as f32 * 0.0, 0.0, 0.0)); + + self.camera.compute_dependents(&VoidVol); + let camera::Dependents { + view_mat, + proj_mat, + cam_pos, + } = self.camera.dependents(); const VD: f32 = 115.0; //View Distance const TIME: f64 = 43200.0; // hours*3600 seconds if let Err(err) = renderer.update_consts(&mut self.globals, &[Globals::new( @@ -137,31 +166,30 @@ impl Scene { self.camera.get_focus_pos(), VD, TIME, - client.state().get_time(), + scene_data.time, renderer.get_resolution(), 0, 0, BlockKind::Air, None, - gamma, + scene_data.gamma, )]) { error!("Renderer failed to update: {:?}", err); } - self.figure_model_cache.clean(client.get_tick()); + self.figure_model_cache.clean(scene_data.tick); - if let Some(body) = body { + if let Some(body) = scene_data.body { let tgt_skeleton = IdleAnimation::update_skeleton( self.figure_state.skeleton_mut(), - client.state().get_time(), - client.state().get_time(), + scene_data.time, + scene_data.time, &mut 0.0, &SkeletonAttr::from(&body), ); - self.figure_state.skeleton_mut().interpolate( - &tgt_skeleton, - client.state().ecs().read_resource::().0, - ); + self.figure_state + .skeleton_mut() + .interpolate(&tgt_skeleton, scene_data.delta_time); } self.figure_state.update( @@ -182,7 +210,7 @@ impl Scene { pub fn render( &mut self, renderer: &mut Renderer, - client: &Client, + tick: u64, body: Option, equipment: &Equipment, ) { @@ -195,7 +223,7 @@ impl Scene { renderer, Body::Humanoid(body), Some(equipment), - client.get_tick(), + tick, CameraMode::default(), None, ) @@ -211,14 +239,16 @@ impl Scene { ); } - renderer.render_figure( - &self.backdrop_model, - &self.globals, - self.backdrop_state.locals(), - self.backdrop_state.bone_consts(), - &self.lights, - &self.shadows, - ); + if let Some((model, state)) = &self.backdrop { + renderer.render_figure( + model, + &self.globals, + state.locals(), + state.bone_consts(), + &self.lights, + &self.shadows, + ); + } renderer.render_post_process( &self.postprocess.model, diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index c6c41f4928..be5f7c40c3 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -6,7 +6,7 @@ use crate::{ }, }; -use client::Client; +use super::SceneData; use common::{ assets, figure::Segment, @@ -1083,26 +1083,26 @@ impl Terrain { pub fn maintain( &mut self, renderer: &mut Renderer, - client: &Client, + scene_data: &SceneData, focus_pos: Vec3, loaded_distance: f32, view_mat: Mat4, proj_mat: Mat4, ) { - let current_tick = client.get_tick(); - let current_time = client.state().get_time(); + let current_tick = scene_data.tick; + let current_time = scene_data.state.get_time(); // Add any recently created or changed chunks to the list of chunks to be // meshed. - for (modified, pos) in client - .state() + for (modified, pos) in scene_data + .state .terrain_changes() .modified_chunks .iter() .map(|c| (true, c)) .chain( - client - .state() + scene_data + .state .terrain_changes() .new_chunks .iter() @@ -1121,8 +1121,8 @@ impl Terrain { let mut neighbours = true; for i in -1..2 { for j in -1..2 { - neighbours &= client - .state() + neighbours &= scene_data + .state .terrain() .get_key(pos + Vec2::new(i, j)) .is_some(); @@ -1143,20 +1143,20 @@ impl Terrain { // Add the chunks belonging to recently changed blocks to the list of chunks to // be meshed - for pos in client - .state() + for pos in scene_data + .state .terrain_changes() .modified_blocks .iter() .map(|(p, _)| *p) { - let chunk_pos = client.state().terrain().pos_key(pos); + let chunk_pos = scene_data.state.terrain().pos_key(pos); // Only mesh if this chunk has all its neighbors let mut neighbours = true; for i in -1..2 { for j in -1..2 { - neighbours &= client - .state() + neighbours &= scene_data + .state .terrain() .get_key(chunk_pos + Vec2::new(i, j)) .is_some(); @@ -1178,15 +1178,15 @@ impl Terrain { for x in -1..2 { for y in -1..2 { let neighbour_pos = pos + Vec3::new(x, y, 0); - let neighbour_chunk_pos = client.state().terrain().pos_key(neighbour_pos); + let neighbour_chunk_pos = scene_data.state.terrain().pos_key(neighbour_pos); if neighbour_chunk_pos != chunk_pos { // Only remesh if this chunk has all its neighbors let mut neighbours = true; for i in -1..2 { for j in -1..2 { - neighbours &= client - .state() + neighbours &= scene_data + .state .terrain() .get_key(neighbour_chunk_pos + Vec2::new(i, j)) .is_some(); @@ -1205,7 +1205,7 @@ impl Terrain { } // Remove any models for chunks that have been recently removed. - for pos in &client.state().terrain_changes().removed_chunks { + for pos in &scene_data.state.terrain_changes().removed_chunks { self.chunks.remove(pos); self.mesh_todo.remove(pos); } @@ -1220,7 +1220,7 @@ impl Terrain { }) .min_by_key(|todo| todo.active_worker.unwrap_or(todo.started_tick)) { - if client.thread_pool().queued_jobs() > 0 { + if scene_data.thread_pool.queued_jobs() > 0 { break; } @@ -1239,7 +1239,7 @@ impl Terrain { // Copy out the chunk data we need to perform the meshing. We do this by taking // a sample of the terrain that includes both the chunk we want and // its neighbours. - let volume = match client.state().terrain().sample(aabr) { + let volume = match scene_data.state.terrain().sample(aabr) { Ok(sample) => sample, // Either this chunk or its neighbours doesn't yet exist, so we keep it in the // queue to be processed at a later date when we have its neighbours. @@ -1266,7 +1266,7 @@ impl Terrain { // Queue the worker thread. let started_tick = todo.started_tick; - client.thread_pool().execute(move || { + scene_data.thread_pool.execute(move || { let _ = send.send(mesh_worker( pos, (min_z as f32, max_z as f32), diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 7670eb1b1e..cf47210669 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -4,7 +4,7 @@ use crate::{ i18n::{i18n_asset_key, VoxygenLocalization}, key_state::KeyState, render::Renderer, - scene::Scene, + scene::{camera, Scene, SceneData}, window::{Event, GameInput}, Direction, Error, GlobalState, PlayState, PlayStateResult, }; @@ -108,7 +108,11 @@ impl SessionState { renderer.clear(); // Render the screen using the global renderer - self.scene.render(renderer, &mut self.client.borrow_mut()); + { + let client = self.client.borrow(); + self.scene + .render(renderer, client.state(), client.entity(), client.get_tick()); + } // Draw the UI to the screen self.hud.render(renderer, self.scene.globals()); @@ -145,10 +149,12 @@ impl PlayState for SessionState { let mut current_client_state = self.client.borrow().get_client_state(); while let ClientState::Pending | ClientState::Character = current_client_state { // Compute camera data - let (view_mat, _, cam_pos) = self - .scene - .camera() - .compute_dependents(&self.client.borrow()); + self.scene + .camera_mut() + .compute_dependents(&*self.client.borrow().state().terrain()); + let camera::Dependents { + view_mat, cam_pos, .. + } = self.scene.camera().dependents(); let cam_dir: Vec3 = Vec3::from(view_mat.inverted() * -Vec4::unit_z()); // Check to see whether we're aiming at anything @@ -396,6 +402,10 @@ impl PlayState for SessionState { // Maintain global state. global_state.maintain(clock.get_last_delta().as_secs_f32()); + // Recompute dependents just in case some input modified the camera + self.scene + .camera_mut() + .compute_dependents(&*self.client.borrow().state().terrain()); // Extract HUD events ensuring the client borrow gets dropped. let mut hud_events = self.hud.maintain( &self.client.borrow(), @@ -555,6 +565,9 @@ impl PlayState for SessionState { global_state.settings.graphics.fov = new_fov; global_state.settings.save_to_file_warn(); self.scene.camera_mut().set_fov_deg(new_fov); + self.scene + .camera_mut() + .compute_dependents(&*self.client.borrow().state().terrain()); }, HudEvent::ChangeGamma(new_gamma) => { global_state.settings.graphics.gamma = new_gamma; @@ -618,11 +631,19 @@ impl PlayState for SessionState { if global_state.singleplayer.is_none() || !global_state.singleplayer.as_ref().unwrap().is_paused() { - // Maintain the scene. + let client = self.client.borrow(); + let scene_data = SceneData { + state: client.state(), + player_entity: client.entity(), + loaded_distance: client.loaded_distance(), + view_distance: client.view_distance().unwrap_or(1), + tick: client.get_tick(), + thread_pool: client.thread_pool(), + }; self.scene.maintain( global_state.window.renderer_mut(), &mut global_state.audio, - &self.client.borrow(), + &scene_data, global_state.settings.graphics.gamma, ); } From ed5afaec8ae9728de7db0abb3c4cbefd4fc9bed6 Mon Sep 17 00:00:00 2001 From: Imbris Date: Thu, 5 Mar 2020 19:07:48 -0500 Subject: [PATCH 067/387] Fix tests --- voxygen/src/scene/simple.rs | 7 ++----- voxygen/src/ui/img_ids.rs | 7 ++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/voxygen/src/scene/simple.rs b/voxygen/src/scene/simple.rs index e319c44942..c12a6f9641 100644 --- a/voxygen/src/scene/simple.rs +++ b/voxygen/src/scene/simple.rs @@ -148,17 +148,14 @@ impl Scene { pub fn maintain(&mut self, renderer: &mut Renderer, scene_data: SceneData) { self.camera.update(scene_data.time); - //self.camera - // .set_orientation(Vec3::new(scene_data.time as f32 * 0.0, 0.0, 0.0)); - self.camera.compute_dependents(&VoidVol); let camera::Dependents { view_mat, proj_mat, cam_pos, } = self.camera.dependents(); - const VD: f32 = 115.0; //View Distance - const TIME: f64 = 43200.0; // hours*3600 seconds + const VD: f32 = 115.0; // View Distance + const TIME: f64 = 43200.0; // 12 hours*3600 seconds if let Err(err) = renderer.update_consts(&mut self.globals, &[Globals::new( view_mat, proj_mat, diff --git a/voxygen/src/ui/img_ids.rs b/voxygen/src/ui/img_ids.rs index f3cfc0f65f..ea5a8ac294 100644 --- a/voxygen/src/ui/img_ids.rs +++ b/voxygen/src/ui/img_ids.rs @@ -114,7 +114,12 @@ pub struct Rotations { /// corresponding ImgIds and create a struct with all of them. /// /// Example usage: -/// ``` +/// ```ignore +/// use veloren_voxygen::{ +/// image_ids, +/// ui::img_ids::{BlankGraphic, ImageGraphic, VoxelGraphic}, +/// }; +/// /// image_ids! { /// pub struct Imgs { /// From c433e5e64dfac36ebf86bb6666d962a2916b5fd8 Mon Sep 17 00:00:00 2001 From: Songtronix Date: Mon, 30 Dec 2019 14:01:37 +0100 Subject: [PATCH 068/387] add: CODEOWNERS file introduces the need of approval by a specific group/person for the MR to be merged based on which part of the codebase is being touched --- .gitlab/CODEOWNERS | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .gitlab/CODEOWNERS diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS new file mode 100644 index 0000000000..c1aa0c58d8 --- /dev/null +++ b/.gitlab/CODEOWNERS @@ -0,0 +1,28 @@ +# Defines people who should approve to certain parts of the codebase + +/assets/ @assetsandvisualdesign @frontend +/chat-cli/ @frontend +/client/ @backend @networking +/common/ @backend @networking +/server/ @backend @networking +/server-cli/ @frontend +#/voxygen/ @someone +/voxygen/anim/ @animation +/voxygen/audio/ @audio +#/voxygen/hud/ @someone +#/voxygen/menu / @someone +#/voxygen/mesh/ @someone +/voxygen/render/ @rendering +#/voxygen/scene/ @someone +#/voxygen/ui/ @someone +/world/ @worldgen + +# All files related to documentation or game unrelated content needs to be approved by the meta group +*.md @meta +*.nix @meta +.gitignore @meta +.gitattributes @meta +.gitlab-ci.yml @meta +rust-toolchain @meta +LICENSE @meta +.cargo/ @meta \ No newline at end of file From b1d1299fe69aac472a2ee70e222cbb118e6bb106 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 7 Mar 2020 10:15:02 -0800 Subject: [PATCH 069/387] Clean up character states --- common/src/comp/ability.rs | 37 ++-- common/src/comp/character_state.rs | 124 ++++-------- common/src/comp/mod.rs | 4 +- common/src/msg/ecs_packet.rs | 12 +- common/src/state.rs | 2 +- common/src/states/basic_attack.rs | 103 +++++----- common/src/states/basic_block.rs | 27 ++- common/src/states/charge_attack.rs | 127 +++++------- common/src/states/climb.rs | 153 +++++++------- common/src/states/equipping.rs | 38 ++++ common/src/states/fall.rs | 8 +- common/src/states/glide.rs | 108 +++++----- common/src/states/idle.rs | 47 ++--- common/src/states/jump.rs | 8 +- common/src/states/mod.rs | 21 +- common/src/states/roll.rs | 70 +++---- common/src/states/sit.rs | 50 ++--- common/src/states/stand.rs | 12 +- common/src/states/swim.rs | 114 +++++------ common/src/states/utils.rs | 186 +++++++++++++----- common/src/states/wielded.rs | 51 ----- common/src/states/wielding.rs | 77 +++----- common/src/sys/character_state.rs | 146 +++++++++----- common/src/sys/stats.rs | 4 +- .../audio/sfx/event_mapper/movement/mod.rs | 14 +- .../audio/sfx/event_mapper/movement/tests.rs | 24 +-- voxygen/src/scene/figure/cache.rs | 8 +- voxygen/src/scene/figure/mod.rs | 44 +++-- 28 files changed, 758 insertions(+), 861 deletions(-) create mode 100644 common/src/states/equipping.rs delete mode 100644 common/src/states/wielded.rs diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 39be87db17..4f9daa7162 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1,39 +1,34 @@ -use crate::comp; -use specs::{Component, FlaggedStorage, HashMapStorage, VecStorage}; +use specs::{Component, DenseVecStorage, FlaggedStorage, HashMapStorage}; #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub enum AbilityActionKind { - Primary, - Secondary, - Dodge, - Block, - // UpdatePool? +pub enum AbilityState { + BasicAttack, + BasicBlock, + Roll, } -impl Default for AbilityActionKind { - fn default() -> Self { Self::Primary } +impl Default for AbilityState { + fn default() -> Self { Self::BasicAttack } } -#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct AbilityAction(pub AbilityActionKind); -impl Component for AbilityAction { - type Storage = FlaggedStorage>; +impl Component for AbilityState { + type Storage = DenseVecStorage; } #[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct AbilityPool { - pub primary: Option, - pub secondary: Option, - pub block: Option, - pub dodge: Option, + pub primary: Option, + pub secondary: Option, + pub block: Option, + pub dodge: Option, } impl Default for AbilityPool { fn default() -> Self { Self { - primary: Some(comp::CharacterState::BasicAttack(None)), - secondary: Some(comp::CharacterState::BasicBlock(None)), + primary: Some(AbilityState::BasicAttack), + secondary: Some(AbilityState::BasicAttack), block: None, - dodge: Some(comp::CharacterState::Roll(None)), + dodge: Some(AbilityState::Roll), } } } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 589eeaeca0..22c49e0fe7 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -1,33 +1,12 @@ use crate::{ - comp::{ - AbilityPool, Body, ControllerInputs, Energy, Ori, PhysicsState, Pos, Stats, ToolData, Vel, - }, + comp::{Energy, Ori, Pos, ToolData, Vel}, event::{LocalEvent, ServerEvent}, - state::DeltaTime, - states::*, - sync::Uid, }; use serde::{Deserialize, Serialize}; -use specs::{Component, Entity, FlaggedStorage, HashMapStorage, LazyUpdate, VecStorage}; -use std::collections::VecDeque; - -pub struct EcsStateData<'a> { - pub entity: &'a Entity, - pub uid: &'a Uid, - pub character: &'a CharacterState, - pub pos: &'a Pos, - pub vel: &'a Vel, - pub ori: &'a Ori, - pub dt: &'a DeltaTime, - pub inputs: &'a ControllerInputs, - pub stats: &'a Stats, - pub energy: &'a Energy, - pub body: &'a Body, - pub physics: &'a PhysicsState, - pub ability_pool: &'a AbilityPool, - pub updater: &'a LazyUpdate, -} +use specs::{Component, FlaggedStorage, HashMapStorage, VecStorage}; +use std::{collections::VecDeque, time::Duration}; +/// Data returned from character behavior fn's to Character Behavior System. pub struct StateUpdate { pub character: CharacterState, pub pos: Pos, @@ -40,45 +19,63 @@ pub struct StateUpdate { #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub enum CharacterState { - Idle(Option), - Climb(Option), - Sit(Option), - Wielding(Option), - Wielded(Option), - Glide(Option), - BasicAttack(Option), - BasicBlock(Option), - //Charge(Option), - Roll(Option), + Idle {}, + Climb {}, + Sit {}, + Equipping { + /// The weapon being equipped + tool: ToolData, + /// Time left before next state + time_left: Duration, + }, + Wielding { + /// The weapon being wielded + tool: ToolData, + }, + Glide {}, + /// A basic attacking state + BasicAttack { + /// How long the state has until exiting + remaining_duration: Duration, + /// Whether the attack can deal more damage + exhausted: bool, + }, + /// A basic blocking state + BasicBlock {}, + //Charge{}, + Roll { + /// How long the state has until exiting + remaining_duration: Duration, + }, } impl CharacterState { pub fn is_wielded(&self) -> bool { match self { - CharacterState::Wielded(_) => true, - CharacterState::BasicAttack(_) => true, - CharacterState::BasicBlock(_) => true, + CharacterState::Wielding { .. } => true, + CharacterState::BasicAttack { .. } => true, + CharacterState::BasicBlock { .. } => true, _ => false, } } pub fn is_attack(&self) -> bool { match self { - CharacterState::BasicAttack(_) => true, + CharacterState::BasicAttack { .. } => true, _ => false, } } pub fn is_block(&self) -> bool { match self { - CharacterState::BasicBlock(_) => true, + CharacterState::BasicBlock { .. } => true, _ => false, } } pub fn is_dodge(&self) -> bool { match self { - CharacterState::Roll(_) => true, + CharacterState::Roll { .. } => true, _ => false, } } @@ -88,53 +85,10 @@ impl CharacterState { // Check if state is the same without looking at the inner data std::mem::discriminant(self) == std::mem::discriminant(other) } - - /// Passes data to variant or subvariant handlers - /// States contain `Option`s, and will be - /// `None` if state data has not been initialized. So we have to - /// check and intialize new state data if so. - pub fn update(&self, ecs_data: &EcsStateData) -> StateUpdate { - match self { - CharacterState::Idle(opt_state) => opt_state - // If data hasn't been initialized, initialize a new one - .unwrap_or_else(|| idle::State::new(ecs_data)) - // Call handler - .handle(ecs_data), - CharacterState::Climb(opt_state) => opt_state - .unwrap_or_else(|| climb::State::new(ecs_data)) - .handle(ecs_data), - CharacterState::Sit(opt_state) => opt_state - .unwrap_or_else(|| sit::State::new(ecs_data)) - .handle(ecs_data), - CharacterState::Wielding(opt_state) => opt_state - .unwrap_or_else(|| wielding::State::new(ecs_data)) - .handle(ecs_data), - CharacterState::Wielded(opt_state) => opt_state - .unwrap_or_else(|| wielded::State::new(ecs_data)) - .handle(ecs_data), - CharacterState::BasicAttack(opt_state) => opt_state - .unwrap_or_else(|| basic_attack::State::new(ecs_data)) - .handle(ecs_data), - CharacterState::BasicBlock(opt_state) => opt_state - .unwrap_or_else(|| basic_block::State::new(ecs_data)) - .handle(ecs_data), - /*CharacterState::Charge(opt_state) => opt_state - .unwrap_or_else(|| charge_attack::State::new(ecs_data)) - .handle(ecs_data),*/ - CharacterState::Roll(opt_state) => opt_state - .unwrap_or_else(|| roll::State::new(ecs_data)) - .handle(ecs_data), - CharacterState::Glide(opt_state) => opt_state - .unwrap_or_else(|| glide::State::new(ecs_data)) - .handle(ecs_data), - /* All states should be explicitly handled - * DO NOT use default match: _ => {}, */ - } - } } impl Default for CharacterState { - fn default() -> Self { Self::Idle(None) } + fn default() -> Self { Self::Idle {} } } impl Component for CharacterState { diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index eb8f6cda25..0d08898d7e 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -16,14 +16,14 @@ mod stats; mod visual; // Reexports -pub use ability::{AbilityAction, AbilityActionKind, AbilityPool}; +pub use ability::{AbilityPool, AbilityState}; pub use admin::Admin; pub use agent::{Agent, Alignment}; pub use body::{ biped_large, bird_medium, bird_small, critter, dragon, fish_medium, fish_small, humanoid, object, quadruped_medium, quadruped_small, AllBodies, Body, BodyData, }; -pub use character_state::{Attacking, CharacterState, EcsStateData, StateUpdate}; +pub use character_state::{Attacking, CharacterState, StateUpdate}; pub use controller::{ ControlEvent, Controller, ControllerInputs, Input, InputState, InventoryManip, MountState, Mounting, diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index cd62d556e5..91d78d35d7 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -21,7 +21,7 @@ sum_type! { Mass(comp::Mass), Gravity(comp::Gravity), Sticky(comp::Sticky), - AbilityAction(comp::AbilityAction), + AbilityState(comp::AbilityState), AbilityPool(comp::AbilityPool), Attacking(comp::Attacking), CharacterState(comp::CharacterState), @@ -45,7 +45,7 @@ sum_type! { Mass(PhantomData), Gravity(PhantomData), Sticky(PhantomData), - AbilityAction(PhantomData), + AbilityState(PhantomData), AbilityPool(PhantomData), Attacking(PhantomData), CharacterState(PhantomData), @@ -69,7 +69,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Mass(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world), - EcsCompPacket::AbilityAction(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::AbilityState(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Attacking(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::CharacterState(comp) => sync::handle_insert(comp, entity, world), @@ -91,7 +91,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::Mass(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world), - EcsCompPacket::AbilityAction(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::AbilityState(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::AbilityPool(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Attacking(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::CharacterState(comp) => sync::handle_modify(comp, entity, world), @@ -115,8 +115,8 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPhantom::Mass(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Gravity(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Sticky(_) => sync::handle_remove::(entity, world), - EcsCompPhantom::AbilityAction(_) => { - sync::handle_remove::(entity, world) + EcsCompPhantom::AbilityState(_) => { + sync::handle_remove::(entity, world) }, EcsCompPhantom::AbilityPool(_) => { sync::handle_remove::(entity, world) diff --git a/common/src/state.rs b/common/src/state.rs index 3064a58553..2c5224697a 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -107,7 +107,7 @@ impl State { ecs.register_sync_marker(); // Register server -> all clients synced components. ecs.register::(); - ecs.register::(); + ecs.register::(); ecs.register::(); ecs.register::(); ecs.register::(); diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index 1574abed2e..e144420f8f 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -1,85 +1,72 @@ use crate::{ - comp::{Attacking, CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, - states::StateHandler, + comp::{Attacking, CharacterState, ItemKind::Tool, StateUpdate}, + states::utils::*, + sys::character_state::JoinData, }; use std::{collections::VecDeque, time::Duration}; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State { - /// How long the state has until exitting - pub remaining_duration: Duration, - /// Whether the attack can deal more damage - pub exhausted: bool, -} +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + character: *data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; -impl StateHandler for State { - fn new(ecs_data: &EcsStateData) -> Self { - let remaining_duration = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data.attack_duration() - } else { - Duration::from_millis(300) - }; - Self { - remaining_duration, - exhausted: false, - } - } + if let CharacterState::BasicAttack { + exhausted, + remaining_duration, + } = data.character + { + handle_move(data, &mut update); - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - character: *ecs_data.character, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }; - - let tool_kind = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind); - - let can_apply_damage = !self.exhausted - && if let Some(Tool(data)) = tool_kind { - (self.remaining_duration < data.attack_recover_duration()) + let tool_kind = data.stats.equipment.main.as_ref().map(|i| i.kind); + let can_apply_damage = !*exhausted + && if let Some(Tool(tool)) = tool_kind { + *remaining_duration < tool.attack_recover_duration() } else { true }; - let mut exhausted = self.exhausted; + let mut new_exhausted = *exhausted; if can_apply_damage { - if let Some(Tool(data)) = tool_kind { - ecs_data - .updater - .insert(*ecs_data.entity, Attacking { weapon: Some(data) }); + if let Some(Tool(tool)) = tool_kind { + data.updater + .insert(data.entity, Attacking { weapon: Some(tool) }); } else { - ecs_data - .updater - .insert(*ecs_data.entity, Attacking { weapon: None }); + data.updater.insert(data.entity, Attacking { weapon: None }); } - exhausted = true; + new_exhausted = true; } else { - ecs_data.updater.remove::(*ecs_data.entity); + data.updater.remove::(data.entity); } - let remaining_duration = self - .remaining_duration - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + let new_remaining_duration = remaining_duration + .checked_sub(Duration::from_secs_f32(data.dt.0)) .unwrap_or_default(); // Tick down - update.character = CharacterState::BasicAttack(Some(State { - remaining_duration, - exhausted, - })); + update.character = CharacterState::BasicAttack { + remaining_duration: new_remaining_duration, + exhausted: new_exhausted, + }; // Check if attack duration has expired - if remaining_duration == Duration::default() { - update.character = CharacterState::Wielded(None); - ecs_data.updater.remove::(*ecs_data.entity); + if new_remaining_duration == Duration::default() { + update.character = if let Some(Tool(tool)) = tool_kind { + CharacterState::Wielding { tool } + } else { + CharacterState::Idle {} + }; + data.updater.remove::(data.entity); } + update + } else { update } } diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index 18d7dd1ce2..9781b7cc10 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -1,35 +1,30 @@ use super::utils::*; use crate::{ - comp::{CharacterState, EcsStateData, StateUpdate}, - states::StateHandler, + comp::{CharacterEntityData, CharacterState, StateUpdate}, }; use std::{collections::VecDeque, time::Duration}; use vek::Vec2; +use crate::sys::character_state::JoinData; const BLOCK_ACCEL: f32 = 30.0; const BLOCK_SPEED: f32 = 75.0; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State {} -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { Self {} } - - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + pub fn handle(data: &JoinData) -> StateUpdate { let mut update = StateUpdate { - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - character: *ecs_data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + character: *data.character, local_events: VecDeque::new(), server_events: VecDeque::new(), }; - handle_move_dir(&ecs_data, &mut update); + handle_move(&data, &mut update); - if !ecs_data.physics.on_ground || !ecs_data.inputs.secondary.is_pressed() { - update.character = CharacterState::Wielded(None); + if !data.physics.on_ground || !data.inputs.secondary.is_pressed() { + update.character = CharacterState::Wielding{}; } update diff --git a/common/src/states/charge_attack.rs b/common/src/states/charge_attack.rs index c5f11ffc1e..5dbd9001a4 100644 --- a/common/src/states/charge_attack.rs +++ b/common/src/states/charge_attack.rs @@ -1,89 +1,62 @@ use super::utils::*; -use crate::comp::{ - ActionState::Attack, AttackKind::Charge, EcsStateData, HealthChange, HealthSource, - ItemKind::Tool, MoveState::Run, StateUpdate, ToolData, +use crate::{ + comp::{ + ActionState::Attack, AttackKind::Charge, CharacterEntityData, HealthChange, HealthSource, + ItemKind::Tool, MoveState::Run, StateUpdate, ToolData, + }, + event::ServerEvent, + sys::character_state::JoinData, }; -use crate::event::ServerEvent; -use crate::states::StateHandler; use std::time::Duration; use vek::Vec3; const CHARGE_SPEED: f32 = 20.0; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State { - /// How long the state has until exitting - pub remaining_duration: Duration, -} +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + character: *data.character, + }; -impl StateHandler for State { - fn new(ecs_data: &EcsStateData) -> Self { - let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data - } else { - ToolData::default() - }; - Self { - remaining_duration: tool_data.attack_duration(), - } + // Move player + update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) + + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) + + 1.5 * data.inputs.move_dir.try_normalized().unwrap_or_default()) + .try_normalized() + .unwrap_or_default() + * CHARGE_SPEED; + + // Check if hitting another entity + if let Some(uid_b) = data.physics.touch_entity { + // Send Damage event + data.server_bus.emitter().emit(ServerEvent::Damage { + uid: uid_b, + change: HealthChange { + amount: -20, + cause: HealthSource::Attack { by: *data.uid }, + }, + }); + + // Go back to wielding or idling + update.character.action_state = attempt_wield(data.stats); + return update; } - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - character: *ecs_data.character, - }; - - // Prevent move state handling, handled here - update.character.move_state = Run(None); - - // Move player - update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) - + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) - + 1.5 - * ecs_data - .inputs - .move_dir - .try_normalized() - .unwrap_or_default()) - .try_normalized() - .unwrap_or_default() - * CHARGE_SPEED; - - // Check if hitting another entity - if let Some(uid_b) = ecs_data.physics.touch_entity { - // Send Damage event - ecs_data.server_bus.emitter().emit(ServerEvent::Damage { - uid: uid_b, - change: HealthChange { - amount: -20, - cause: HealthSource::Attack { by: *ecs_data.uid }, - }, - }); - - // Go back to wielding or idling - update.character.action_state = attempt_wield(ecs_data.stats); - return update; - } - - // Check if charge timed out or can't keep moving forward - if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 - { - update.character.action_state = attempt_wield(ecs_data.stats); - return update; - } - - // Tick remaining-duration and keep charging - update.character.action_state = Attack(Charge(Some(State { - remaining_duration: self - .remaining_duration - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) - .unwrap_or_default(), - }))); - - update + // Check if charge timed out or can't keep moving forward + if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { + update.character.action_state = attempt_wield(data.stats); + return update; } + + // Tick remaining-duration and keep charging + update.character.action_state = Attack(Charge(Some(State { + remaining_duration: self + .remaining_duration + .checked_sub(Duration::from_secs_f32(data.dt.0)) + .unwrap_or_default(), + }))); + + update } diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index 8c73c9b31b..ee7bf3257d 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -1,7 +1,7 @@ use crate::{ - comp::{CharacterState, EcsStateData, EnergySource, StateUpdate}, - states::StateHandler, - sys::phys::GRAVITY, + comp::{CharacterState, EnergySource, StateUpdate}, + event::LocalEvent, + sys::{character_state::JoinData, phys::GRAVITY}, }; use std::collections::VecDeque; use vek::{ @@ -12,91 +12,84 @@ use vek::{ const HUMANOID_CLIMB_ACCEL: f32 = 5.0; const CLIMB_SPEED: f32 = 5.0; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State; +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + character: *data.character, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { Self {} } + if let Err(_) = update.energy.try_change_by(-5, EnergySource::Climb) { + update.character = CharacterState::Idle {}; + } - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - character: *ecs_data.character, - energy: *ecs_data.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), + // If no wall is in front of character ... + if data.physics.on_wall.is_none() || data.physics.on_ground { + if data.inputs.jump.is_pressed() { + // They've climbed atop something, give them a boost + update + .local_events + .push_front(LocalEvent::Jump(data.entity)); + } + update.character = CharacterState::Idle {}; + return update; + } + + // Move player + update.vel.0 += Vec2::broadcast(data.dt.0) + * data.inputs.move_dir + * if update.vel.0.magnitude_squared() < CLIMB_SPEED.powf(2.0) { + HUMANOID_CLIMB_ACCEL + } else { + 0.0 }; - if let Err(_) = update.energy.try_change_by(-5, EnergySource::Climb) { - update.character = CharacterState::Idle(None); - } - - // If no wall is in front of character ... - if ecs_data.physics.on_wall.is_none() || ecs_data.physics.on_ground { - if ecs_data.inputs.jump.is_pressed() { - // They've climbed atop something, give them a boost - //TODO: JUMP EVENT - } - update.character = CharacterState::Idle(None); - return update; - } - - // Move player - update.vel.0 += Vec2::broadcast(ecs_data.dt.0) - * ecs_data.inputs.move_dir - * if update.vel.0.magnitude_squared() < CLIMB_SPEED.powf(2.0) { - HUMANOID_CLIMB_ACCEL - } else { - 0.0 - }; - - // Set orientation direction based on wall direction - let ori_dir = if let Some(wall_dir) = ecs_data.physics.on_wall { - if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { - Vec2::from(wall_dir).normalized() - } else { - Vec2::from(update.vel.0) - } + // Set orientation direction based on wall direction + let ori_dir = if let Some(wall_dir) = data.physics.on_wall { + if Vec2::::from(wall_dir).magnitude_squared() > 0.001 { + Vec2::from(wall_dir).normalized() } else { Vec2::from(update.vel.0) - }; + } + } else { + Vec2::from(update.vel.0) + }; - // Smooth orientation - if ori_dir.magnitude_squared() > 0.0001 - && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() - > 0.001 - { - update.ori.0 = vek::ops::Slerp::slerp( - update.ori.0, - ori_dir.into(), - if ecs_data.physics.on_ground { 9.0 } else { 2.0 } * ecs_data.dt.0, + // Smooth orientation + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = vek::ops::Slerp::slerp( + update.ori.0, + ori_dir.into(), + if data.physics.on_ground { 9.0 } else { 2.0 } * data.dt.0, + ); + } + + // Apply Vertical Climbing Movement + if let (true, Some(_wall_dir)) = ( + (data.inputs.climb.is_pressed() | data.inputs.climb_down.is_pressed()) + && update.vel.0.z <= CLIMB_SPEED, + data.physics.on_wall, + ) { + if data.inputs.climb_down.is_pressed() && !data.inputs.climb.is_pressed() { + update.vel.0 -= data.dt.0 * update.vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); + } else if data.inputs.climb.is_pressed() && !data.inputs.climb_down.is_pressed() { + update.vel.0.z = (update.vel.0.z + data.dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); + } else { + update.vel.0.z = update.vel.0.z + data.dt.0 * GRAVITY * 1.5; + update.vel.0 = Lerp::lerp( + update.vel.0, + Vec3::zero(), + 30.0 * data.dt.0 / (1.0 - update.vel.0.z.min(0.0) * 5.0), ); } - - // Apply Vertical Climbing Movement - if let (true, Some(_wall_dir)) = ( - (ecs_data.inputs.climb.is_pressed() | ecs_data.inputs.climb_down.is_pressed()) - && update.vel.0.z <= CLIMB_SPEED, - ecs_data.physics.on_wall, - ) { - if ecs_data.inputs.climb_down.is_pressed() && !ecs_data.inputs.climb.is_pressed() { - update.vel.0 -= - ecs_data.dt.0 * update.vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0); - } else if ecs_data.inputs.climb.is_pressed() && !ecs_data.inputs.climb_down.is_pressed() - { - update.vel.0.z = (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED); - } else { - update.vel.0.z = update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.5; - update.vel.0 = Lerp::lerp( - update.vel.0, - Vec3::zero(), - 30.0 * ecs_data.dt.0 / (1.0 - update.vel.0.z.min(0.0) * 5.0), - ); - } - } - - update } + + update } diff --git a/common/src/states/equipping.rs b/common/src/states/equipping.rs new file mode 100644 index 0000000000..8d6004114f --- /dev/null +++ b/common/src/states/equipping.rs @@ -0,0 +1,38 @@ +use super::utils::*; +use crate::{ + comp::{CharacterState, StateUpdate}, + sys::character_state::JoinData, +}; +use std::{collections::VecDeque, time::Duration}; + +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + character: *data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; + + handle_move(&data, &mut update); + handle_jump(&data, &mut update); + + if let CharacterState::Equipping { tool, time_left } = data.character { + if *time_left == Duration::default() { + // Wield delay has expired + update.character = CharacterState::Wielding { tool: *tool }; + } else { + // Wield delay hasn't expired yet + // Update wield delay + update.character = CharacterState::Equipping { + time_left: time_left + .checked_sub(Duration::from_secs_f32(data.dt.0)) + .unwrap_or_default(), + tool: *tool, + }; + } + } + update +} diff --git a/common/src/states/fall.rs b/common/src/states/fall.rs index 0ee2ae18f7..8d90711eb2 100644 --- a/common/src/states/fall.rs +++ b/common/src/states/fall.rs @@ -1,4 +1,4 @@ -use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; +use crate::comp::{ActionState, CharacterEntityData, MoveState, StateUpdate}; use super::utils::*; use crate::states::StateHandler; @@ -11,11 +11,9 @@ const HUMANOID_AIR_SPEED: f32 = 100.0; pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &CharacterEntityData) -> Self { Self {} } - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + fn handle(&self, ecs_data: &CharacterEntityData) -> StateUpdate { let mut update = StateUpdate { pos: *ecs_data.pos, vel: *ecs_data.vel, diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index ba0d4f8bea..4a7d22c997 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -1,6 +1,6 @@ use crate::{ - comp::{CharacterState, EcsStateData, StateUpdate}, - states::StateHandler, + comp::{CharacterState, StateUpdate}, + sys::character_state::JoinData, }; use std::collections::VecDeque; use vek::{Vec2, Vec3}; @@ -10,65 +10,57 @@ const GLIDE_ANTIGRAV: f32 = crate::sys::phys::GRAVITY * 0.96; const GLIDE_ACCEL: f32 = 15.0; const GLIDE_SPEED: f32 = 45.0; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State; +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + character: *data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { Self {} } + // If glide button isn't held or player is on ground, end glide + if !data.inputs.glide.is_pressed() || data.physics.on_ground { + update.character = CharacterState::Idle {}; + } - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - character: *ecs_data.character, - local_events: VecDeque::new(), - server_events: VecDeque::new(), + // If there is a wall in front of character go to climb + if let Some(_) = data.physics.on_wall { + update.character = CharacterState::Climb {}; + } + + // Move player according to movement direction vector + update.vel.0 += Vec2::broadcast(data.dt.0) + * data.inputs.move_dir + * if data.vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) { + GLIDE_ACCEL + } else { + 0.0 }; - // If glide button isn't held or player is on ground, end glide - if !ecs_data.inputs.glide.is_pressed() || ecs_data.physics.on_ground { - update.character = CharacterState::Idle(None); - } - - // If there is a wall in front of character go to climb - if let Some(_) = ecs_data.physics.on_wall { - update.character = CharacterState::Climb(None); - } - - // Move player according to movement direction vector - update.vel.0 += Vec2::broadcast(ecs_data.dt.0) - * ecs_data.inputs.move_dir - * if ecs_data.vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) { - GLIDE_ACCEL - } else { - 0.0 - }; - - // Determine orientation vector from movement direction vector - let ori_dir = Vec2::from(update.vel.0); - if ori_dir.magnitude_squared() > 0.0001 - && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() - > 0.001 - { - update.ori.0 = - vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 2.0 * ecs_data.dt.0); - } - - // Apply Glide antigrav lift - if Vec2::::from(update.vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) - && update.vel.0.z < 0.0 - { - let lift = GLIDE_ANTIGRAV + update.vel.0.z.abs().powf(2.0) * 0.15; - update.vel.0.z += ecs_data.dt.0 - * lift - * (Vec2::::from(update.vel.0).magnitude() * 0.075) - .min(1.0) - .max(0.2); - } - - // Otherwise keep gliding - update + // Determine orientation vector from movement direction vector + let ori_dir = Vec2::from(update.vel.0); + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 2.0 * data.dt.0); } + + // Apply Glide antigrav lift + if Vec2::::from(update.vel.0).magnitude_squared() < GLIDE_SPEED.powf(2.0) + && update.vel.0.z < 0.0 + { + let lift = GLIDE_ANTIGRAV + update.vel.0.z.abs().powf(2.0) * 0.15; + update.vel.0.z += data.dt.0 + * lift + * (Vec2::::from(update.vel.0).magnitude() * 0.075) + .min(1.0) + .max(0.2); + } + + // Otherwise keep gliding + update } diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index b07456e891..3e16c39f64 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -1,33 +1,24 @@ use super::utils::*; -use crate::comp::{EcsStateData, StateUpdate}; +use crate::{comp::StateUpdate, sys::character_state::JoinData}; use std::collections::VecDeque; -use crate::states::StateHandler; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State; +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + character: *data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; + handle_move(data, &mut update); + handle_jump(data, &mut update); + handle_wield(data, &mut update); + handle_sit(data, &mut update); + handle_climb(data, &mut update); + handle_glide(data, &mut update); + handle_dodge(data, &mut update); -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { Self {} } - - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }; - - handle_move_dir(ecs_data, &mut update); - handle_jump(ecs_data, &mut update); - handle_wield(ecs_data, &mut update); - handle_sit(ecs_data, &mut update); - handle_climb(ecs_data, &mut update); - handle_glide(ecs_data, &mut update); - handle_dodge(ecs_data, &mut update); - - update - } + update } diff --git a/common/src/states/jump.rs b/common/src/states/jump.rs index 13fcd80e81..bb23131736 100644 --- a/common/src/states/jump.rs +++ b/common/src/states/jump.rs @@ -1,15 +1,13 @@ -use super::{EcsStateData, MoveState, StateHandler, StateUpdate}; +use super::{CharacterEntityData, MoveState, StateHandler, StateUpdate}; use crate::event::LocalEvent; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &CharacterEntityData) -> Self { Self {} } - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + fn handle(&self, ecs_data: &CharacterEntityData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 016362d5be..9a9c62a9b3 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -1,28 +1,11 @@ // Module declarations pub mod basic_attack; -pub mod basic_block; +// pub mod basic_block; pub mod climb; +pub mod equipping; pub mod glide; pub mod idle; pub mod roll; pub mod sit; pub mod utils; -pub mod wielded; pub mod wielding; - -use crate::comp::{EcsStateData, StateUpdate}; - -/// ## A type for implementing State Handling Behavior. -/// -/// Called by state machines' update functions to allow current states to handle -/// updating their parent machine's current state. -/// -/// Structures must implement a `handle()` fn to handle update behavior, and a -/// `new()` for instantiating new instances of a state. `handle()` function -/// recieves `EcsStateData`, a struct of readonly ECS Component data, and -/// returns a `StateUpdate` tuple, with new components that will overwrite an -/// entitie's old components. -pub trait StateHandler: Default { - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate; - fn new(ecs_data: &EcsStateData) -> Self; -} diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index be3944ba13..ee62145bb8 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,51 +1,28 @@ use crate::{ - comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, - states::StateHandler, + comp::{CharacterState, StateUpdate}, + sys::character_state::JoinData, }; use std::{collections::VecDeque, time::Duration}; use vek::Vec3; const ROLL_SPEED: f32 = 17.0; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State { - /// How long the state has until exitting - remaining_duration: Duration, -} - -impl StateHandler for State { - fn new(ecs_data: &EcsStateData) -> Self { - let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data - } else { - ToolData::default() - }; - Self { - remaining_duration: tool_data.attack_duration(), - } - } - - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }; +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + character: *data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; + if let CharacterState::Roll { remaining_duration } = data.character { // Update velocity update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) - + 1.5 - * ecs_data - .inputs - .move_dir - .try_normalized() - .unwrap_or_default()) + + 1.5 * data.inputs.move_dir.try_normalized().unwrap_or_default()) .try_normalized() .unwrap_or_default() * ROLL_SPEED; @@ -57,22 +34,21 @@ impl StateHandler for State { > 0.001 { update.ori.0 = - vek::ops::Slerp::slerp(update.ori.0, update.vel.0.into(), 9.0 * ecs_data.dt.0); + vek::ops::Slerp::slerp(update.ori.0, update.vel.0.into(), 9.0 * data.dt.0); } - if self.remaining_duration == Duration::default() { + if *remaining_duration == Duration::default() { // Roll duration has expired - update.character = CharacterState::Idle(None); + update.character = CharacterState::Idle {}; } else { // Otherwise, tick down remaining_duration - update.character = CharacterState::Roll(Some(State { - remaining_duration: self - .remaining_duration - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) + update.character = CharacterState::Roll { + remaining_duration: remaining_duration + .checked_sub(Duration::from_secs_f32(data.dt.0)) .unwrap_or_default(), - })); + }; } - - update } + + update } diff --git a/common/src/states/sit.rs b/common/src/states/sit.rs index 1da5fb6df3..9f329e83b3 100644 --- a/common/src/states/sit.rs +++ b/common/src/states/sit.rs @@ -1,38 +1,30 @@ use super::utils::*; use crate::{ - comp::{CharacterState, EcsStateData, StateUpdate}, - states::StateHandler, + comp::{CharacterState, StateUpdate}, + sys::character_state::JoinData, }; use std::collections::VecDeque; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State; +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + character: *data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { Self {} } + handle_wield(data, &mut update); - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }; - - //handle_jump(ecs_data, &mut update); - handle_wield(ecs_data, &mut update); - - // Try to Fall/Stand up/Move - if !ecs_data.physics.on_ground - || ecs_data.inputs.sit.is_just_pressed() - || ecs_data.inputs.move_dir.magnitude_squared() > 0.0 - { - update.character = CharacterState::Idle(None); - } - - update + // Try to Fall/Stand up/Move + if !data.physics.on_ground + || data.inputs.sit.is_just_pressed() + || data.inputs.move_dir.magnitude_squared() > 0.0 + { + update.character = CharacterState::Idle {}; } + + update } diff --git a/common/src/states/stand.rs b/common/src/states/stand.rs index 37dd3c4bbe..c21a024b45 100644 --- a/common/src/states/stand.rs +++ b/common/src/states/stand.rs @@ -1,16 +1,16 @@ use super::utils::*; -use crate::comp::{EcsStateData, MoveState, StateUpdate}; -use crate::states::StateHandler; +use crate::{ + comp::{CharacterEntityData, MoveState, StateUpdate}, + states::StateHandler, +}; #[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct State; impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } + fn new(_ecs_data: &CharacterEntityData) -> Self { Self {} } - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { + fn handle(&self, ecs_data: &CharacterEntityData) -> StateUpdate { let mut update = StateUpdate { character: *ecs_data.character, pos: *ecs_data.pos, diff --git a/common/src/states/swim.rs b/common/src/states/swim.rs index 675e7b0478..4267731249 100644 --- a/common/src/states/swim.rs +++ b/common/src/states/swim.rs @@ -1,82 +1,56 @@ -use crate::comp::{ActionState, EcsStateData, MoveState, StateUpdate}; -use crate::states::StateHandler; -use crate::sys::phys::GRAVITY; +use crate::{ + comp::StateUpdate, + sys::{character_state::JoinData, phys::GRAVITY}, +}; use std::time::Duration; use vek::{Vec2, Vec3}; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State; - const HUMANOID_WATER_ACCEL: f32 = 70.0; const HUMANOID_WATER_SPEED: f32 = 120.0; -impl StateHandler for State { - fn new(_ecs_data: &EcsStateData) -> Self { - Self {} - } +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + character: *data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, + // Update velocity + update.vel.0 += Vec2::broadcast(data.dt.0) + * data.inputs.move_dir + * if update.vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { + HUMANOID_WATER_ACCEL + } else { + 0.0 }; - // Update velocity - update.vel.0 += Vec2::broadcast(ecs_data.dt.0) - * ecs_data.inputs.move_dir - * if update.vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { - HUMANOID_WATER_ACCEL - } else { - 0.0 - }; + // Set direction based on move direction when on the ground + let ori_dir = if update.character.is_attack() || update.character.is_block() { + Vec2::from(data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; - // Set direction based on move direction when on the ground - let ori_dir = - if let ActionState::Attack(_) | ActionState::Block(_) = update.character.action_state { - Vec2::from(ecs_data.inputs.look_dir).normalized() - } else { - Vec2::from(update.vel.0) - }; - - if ori_dir.magnitude_squared() > 0.0001 - && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() - > 0.001 - { - update.ori.0 = vek::ops::Slerp::slerp( - update.ori.0, - ori_dir.into(), - if ecs_data.physics.on_ground { 9.0 } else { 2.0 } * ecs_data.dt.0, - ); - } - - // Force players to press jump in a slow rhythmic fashion to swim up - if ecs_data.inputs.jump.is_pressed() - && !ecs_data - .inputs - .jump - .is_long_press(Duration::from_millis(600)) - { - update.vel.0.z = - (update.vel.0.z + ecs_data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); - } - - // Not on ground - if !ecs_data.physics.on_ground { - update.character.move_state = MoveState::Swim(None); - update - } - // On ground - else { - // Return to running or standing based on move inputs - update.character.move_state = if ecs_data.inputs.move_dir.magnitude_squared() > 0.0 { - MoveState::Run(None) - } else { - MoveState::Stand(None) - }; - - update - } + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 + { + update.ori.0 = vek::ops::Slerp::slerp( + update.ori.0, + ori_dir.into(), + if data.physics.on_ground { 9.0 } else { 2.0 } * data.dt.0, + ); } + + // Force players to pulse jump button to swim up + if data.inputs.jump.is_pressed() && !data.inputs.jump.is_long_press(Duration::from_millis(600)) + { + update.vel.0.z = (update.vel.0.z + data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); + } + + update } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 14294a3631..73a51ed801 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,12 +1,24 @@ use crate::{ - comp::{Attacking, CharacterState, EcsStateData, EnergySource, ItemKind::Tool, StateUpdate}, + comp::{AbilityState, CharacterState, EnergySource, ItemKind::Tool, StateUpdate}, event::LocalEvent, + sys::{character_state::JoinData, phys::GRAVITY}, }; use std::time::Duration; use vek::vec::{Vec2, Vec3}; -pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { - let (accel, speed): (f32, f32) = if ecs_data.physics.on_ground { +const HUMANOID_WATER_ACCEL: f32 = 70.0; +const HUMANOID_WATER_SPEED: f32 = 120.0; + +pub fn handle_move(data: &JoinData, update: &mut StateUpdate) { + if data.physics.in_fluid { + handle_swim_move(data, update); + } else { + handle_ground_move(data, update); + } +} + +pub fn handle_ground_move(data: &JoinData, update: &mut StateUpdate) { + let (accel, speed): (f32, f32) = if data.physics.on_ground { let accel = 100.0; let speed = 8.0; (accel, speed) @@ -18,8 +30,7 @@ pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { // Move player according to move_dir if update.vel.0.magnitude_squared() < speed.powf(2.0) { - update.vel.0 = - update.vel.0 + Vec2::broadcast(ecs_data.dt.0) * ecs_data.inputs.move_dir * accel; + update.vel.0 = update.vel.0 + Vec2::broadcast(data.dt.0) * data.inputs.move_dir * accel; let mag2 = update.vel.0.magnitude_squared(); if mag2 > speed.powf(2.0) { update.vel.0 = update.vel.0.normalized() * speed; @@ -31,7 +42,7 @@ pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { || update.character.is_attack() || update.character.is_block() { - Vec2::from(ecs_data.inputs.look_dir).normalized() + Vec2::from(data.inputs.look_dir).normalized() } else { Vec2::from(update.vel.0) }; @@ -41,94 +52,165 @@ pub fn handle_move_dir(ecs_data: &EcsStateData, update: &mut StateUpdate) { && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() > 0.001 { - update.ori.0 = vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * ecs_data.dt.0); + update.ori.0 = vek::ops::Slerp::slerp(update.ori.0, ori_dir.into(), 9.0 * data.dt.0); } } -pub fn handle_wield(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if ecs_data.inputs.primary.is_pressed() { - update.character = CharacterState::Wielding(None); - } -} +pub fn handle_swim_move(data: &JoinData, update: &mut StateUpdate) { + // Update velocity + update.vel.0 += Vec2::broadcast(data.dt.0) + * data.inputs.move_dir + * if update.vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { + HUMANOID_WATER_ACCEL + } else { + 0.0 + }; -pub fn handle_sit(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if ecs_data.inputs.sit.is_pressed() && ecs_data.physics.on_ground && ecs_data.body.is_humanoid() + // Set direction based on move direction when on the ground + let ori_dir = if update.character.is_attack() || update.character.is_block() { + Vec2::from(data.inputs.look_dir).normalized() + } else { + Vec2::from(update.vel.0) + }; + + if ori_dir.magnitude_squared() > 0.0001 + && (update.ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared() + > 0.001 { - update.character = CharacterState::Sit(None); + update.ori.0 = vek::ops::Slerp::slerp( + update.ori.0, + ori_dir.into(), + if data.physics.on_ground { 9.0 } else { 2.0 } * data.dt.0, + ); + } + + // Force players to pulse jump button to swim up + if data.inputs.jump.is_pressed() && !data.inputs.jump.is_long_press(Duration::from_millis(600)) + { + update.vel.0.z = (update.vel.0.z + data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); } } -pub fn handle_climb(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if (ecs_data.inputs.climb.is_pressed() || ecs_data.inputs.climb_down.is_pressed()) - && ecs_data.physics.on_wall.is_some() - && !ecs_data.physics.on_ground +pub fn handle_wield(data: &JoinData, update: &mut StateUpdate) { + if data.inputs.primary.is_pressed() { + if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { + update.character = CharacterState::Equipping { + tool, + time_left: tool.equip_time(), + }; + } else { + update.character = CharacterState::Idle {}; + }; + } +} + +pub fn handle_sit(data: &JoinData, update: &mut StateUpdate) { + if data.inputs.sit.is_pressed() && data.physics.on_ground && data.body.is_humanoid() { + update.character = CharacterState::Sit {}; + } +} + +pub fn handle_climb(data: &JoinData, update: &mut StateUpdate) { + if (data.inputs.climb.is_pressed() || data.inputs.climb_down.is_pressed()) + && data.physics.on_wall.is_some() + && !data.physics.on_ground //&& update.vel.0.z < 0.0 - && ecs_data.body.is_humanoid() + && data.body.is_humanoid() { - update.character = CharacterState::Climb(None); + update.character = CharacterState::Climb {}; } } -pub fn handle_unwield(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if let CharacterState::Wielded(_) = update.character { - if ecs_data.inputs.toggle_wield.is_pressed() { - update.character = CharacterState::Idle(None); +pub fn handle_unwield(data: &JoinData, update: &mut StateUpdate) { + if let CharacterState::Wielding { .. } = update.character { + if data.inputs.toggle_wield.is_pressed() { + update.character = CharacterState::Idle {}; } } } -pub fn handle_glide(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if let CharacterState::Idle(_) | CharacterState::Wielded(_) = update.character { - if ecs_data.inputs.glide.is_pressed() - && !ecs_data.physics.on_ground - && ecs_data.body.is_humanoid() - { - update.character = CharacterState::Glide(None); +pub fn handle_glide(data: &JoinData, update: &mut StateUpdate) { + if let CharacterState::Idle { .. } | CharacterState::Wielding { .. } = update.character { + if data.inputs.glide.is_pressed() && !data.physics.on_ground && data.body.is_humanoid() { + update.character = CharacterState::Glide {}; } } } -pub fn handle_jump(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if ecs_data.inputs.jump.is_pressed() && ecs_data.physics.on_ground { +pub fn handle_jump(data: &JoinData, update: &mut StateUpdate) { + if data.inputs.jump.is_pressed() && data.physics.on_ground { update .local_events - .push_front(LocalEvent::Jump(*ecs_data.entity)); + .push_front(LocalEvent::Jump(data.entity)); } } -pub fn handle_primary(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if let Some(state) = ecs_data.ability_pool.primary { - if let CharacterState::Wielded(_) = update.character { - if ecs_data.inputs.primary.is_pressed() { - update.character = state; +pub fn handle_primary(data: &JoinData, update: &mut StateUpdate) { + if let Some(state) = data.ability_pool.primary { + if let CharacterState::Wielding { .. } = update.character { + if data.inputs.primary.is_pressed() { + // data.updater.insert(data.entity, state); + update.character = character_state_from_ability(data, state); } } } } -pub fn handle_secondary(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if let Some(state) = ecs_data.ability_pool.secondary { - if let CharacterState::Wielded(_) = update.character { - if ecs_data.inputs.secondary.is_pressed() { - update.character = state; +pub fn handle_secondary(data: &JoinData, update: &mut StateUpdate) { + if let Some(state) = data.ability_pool.secondary { + if let CharacterState::Wielding { .. } = update.character { + if data.inputs.secondary.is_pressed() { + // data.updater.insert(data.entity, state); + update.character = character_state_from_ability(data, state); } } } } -pub fn handle_dodge(ecs_data: &EcsStateData, update: &mut StateUpdate) { - if let Some(state) = ecs_data.ability_pool.dodge { - if let CharacterState::Idle(_) | CharacterState::Wielded(_) = update.character { - if ecs_data.inputs.roll.is_pressed() - && ecs_data.physics.on_ground - && ecs_data.body.is_humanoid() +pub fn handle_dodge(data: &JoinData, update: &mut StateUpdate) { + if let Some(state) = data.ability_pool.dodge { + if let CharacterState::Idle { .. } | CharacterState::Wielding { .. } = update.character { + if data.inputs.roll.is_pressed() + && data.physics.on_ground + && data.body.is_humanoid() && update .energy .try_change_by(-200, EnergySource::Roll) .is_ok() { - update.character = state; + // let tool_data = + // if let Some(Tool(data)) = data.stats.equipment.main.as_ref().map(|i| + // i.kind) { data + // } else { + // ToolData::default() + // }; + update.character = CharacterState::Roll { + remaining_duration: Duration::from_millis(600), // tool_data.attack_duration(), + }; + data.updater.insert(data.entity, state); } } } } + +pub fn character_state_from_ability( + data: &JoinData, + ability_state: AbilityState, +) -> CharacterState { + match ability_state { + AbilityState::BasicAttack { .. } => { + if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { + CharacterState::BasicAttack { + exhausted: false, + remaining_duration: tool.attack_duration(), + } + } else { + CharacterState::Idle {} + } + }, + AbilityState::BasicBlock { .. } => CharacterState::BasicBlock {}, + AbilityState::Roll { .. } => CharacterState::Roll { + remaining_duration: Duration::from_millis(600), + }, + } +} diff --git a/common/src/states/wielded.rs b/common/src/states/wielded.rs deleted file mode 100644 index 545a38dca6..0000000000 --- a/common/src/states/wielded.rs +++ /dev/null @@ -1,51 +0,0 @@ -use super::utils::*; -use crate::{ - comp::{EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, - states::StateHandler, -}; -use std::{collections::VecDeque, time::Duration}; - -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State { - /// How long before a new action can be performed - /// after equipping - pub equip_delay: Duration, -} - -impl StateHandler for State { - fn new(ecs_data: &EcsStateData) -> Self { - let tool_data = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data - } else { - ToolData::default() - }; - Self { - equip_delay: tool_data.equip_time(), - } - } - - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }; - - handle_move_dir(&ecs_data, &mut update); - handle_jump(&ecs_data, &mut update); - handle_sit(&ecs_data, &mut update); - handle_climb(&ecs_data, &mut update); - handle_glide(&ecs_data, &mut update); - handle_unwield(&ecs_data, &mut update); - handle_primary(&ecs_data, &mut update); - handle_secondary(&ecs_data, &mut update); - handle_dodge(&ecs_data, &mut update); - - update - } -} diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index 58da3c22b0..eaf054762f 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -1,56 +1,27 @@ use super::utils::*; -use crate::{ - comp::{CharacterState, EcsStateData, ItemKind::Tool, StateUpdate, ToolData}, - states::StateHandler, -}; -use std::{collections::VecDeque, time::Duration}; +use crate::{comp::StateUpdate, sys::character_state::JoinData}; +use std::collections::VecDeque; -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] -pub struct State { - /// How long before a new action can be performed - /// after equipping - pub equip_delay: Duration, -} - -impl StateHandler for State { - fn new(ecs_data: &EcsStateData) -> Self { - let equip_delay = - if let Some(Tool(data)) = ecs_data.stats.equipment.main.as_ref().map(|i| i.kind) { - data.equip_time() - } else { - Duration::default() - }; - - Self { equip_delay } - } - - fn handle(&self, ecs_data: &EcsStateData) -> StateUpdate { - let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }; - - handle_move_dir(&ecs_data, &mut update); - - if self.equip_delay == Duration::default() { - // Wield delay has expired - update.character = CharacterState::Wielded(None); - } else { - // Wield delay hasn't expired yet - // Update wield delay - update.character = CharacterState::Wielding(Some(State { - equip_delay: self - .equip_delay - .checked_sub(Duration::from_secs_f32(ecs_data.dt.0)) - .unwrap_or_default(), - })); - } - - update - } +pub fn behavior(ecs_data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + character: *ecs_data.character, + pos: *ecs_data.pos, + vel: *ecs_data.vel, + ori: *ecs_data.ori, + energy: *ecs_data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; + + handle_move(&ecs_data, &mut update); + handle_jump(&ecs_data, &mut update); + handle_sit(&ecs_data, &mut update); + handle_climb(&ecs_data, &mut update); + handle_glide(&ecs_data, &mut update); + handle_unwield(&ecs_data, &mut update); + handle_primary(&ecs_data, &mut update); + handle_secondary(&ecs_data, &mut update); + handle_dodge(&ecs_data, &mut update); + + update } diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_state.rs index a87a7b92ab..b703617cf6 100644 --- a/common/src/sys/character_state.rs +++ b/common/src/sys/character_state.rs @@ -1,20 +1,79 @@ use crate::{ comp::{ - AbilityPool, Body, CharacterState, Controller, EcsStateData, Energy, Mounting, Ori, - PhysicsState, Pos, Stats, Vel, + AbilityPool, Body, CharacterState, Controller, ControllerInputs, Energy, Mounting, Ori, + PhysicsState, Pos, StateUpdate, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, + states, sync::{Uid, UidAllocator}, }; -use specs::{Entities, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; +use specs::{Entities, Entity, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; -/// ## Character State System +use std::collections::VecDeque; + +/// Read-Only Data sent from Character Behavior System to bahvior fn's +pub struct JoinData<'a> { + pub entity: Entity, + pub uid: &'a Uid, + pub character: &'a CharacterState, + pub pos: &'a Pos, + pub vel: &'a Vel, + pub ori: &'a Ori, + pub dt: &'a DeltaTime, + pub controller: &'a Controller, + pub inputs: &'a ControllerInputs, + pub stats: &'a Stats, + pub energy: &'a Energy, + pub body: &'a Body, + pub physics: &'a PhysicsState, + pub ability_pool: &'a AbilityPool, + pub updater: &'a LazyUpdate, +} + +pub type JoinTuple<'a> = ( + Entity, + &'a Uid, + &'a mut CharacterState, + &'a mut Pos, + &'a mut Vel, + &'a mut Ori, + &'a mut Energy, + &'a Controller, + &'a Stats, + &'a Body, + &'a PhysicsState, + &'a AbilityPool, +); + +impl<'a> JoinData<'a> { + fn new(j: &'a JoinTuple<'a>, updater: &'a LazyUpdate, dt: &'a DeltaTime) -> Self { + Self { + entity: j.0, + uid: j.1, + character: j.2, + pos: j.3, + vel: j.4, + ori: j.5, + energy: j.6, + controller: j.7, + inputs: &j.7.inputs, + stats: j.8, + body: j.9, + physics: j.10, + ability_pool: j.11, + updater, + dt, + } + } +} + +/// /// ## Character State System /// #### Calls updates to `CharacterState`s. Acts on tuples of ( /// `CharacterState`, `Pos`, `Vel`, and `Ori` ). /// -/// _System forms `EcsStateData` tuples and passes those to `ActionState` +/// _System forms `CharacterEntityData` tuples and passes those to `ActionState` /// `update()` fn, then does the same for `MoveState` `update`_ pub struct Sys; @@ -63,20 +122,7 @@ impl<'a> System<'a> for Sys { mountings, ): Self::SystemData, ) { - for ( - entity, - uid, - character, - pos, - vel, - ori, - energy, - controller, - stats, - body, - physics, - ability_pool, - ) in ( + let mut join_iter = ( &entities, &uids, &mut character_states, @@ -90,50 +136,56 @@ impl<'a> System<'a> for Sys { &physics_states, &ability_pools, ) - .join() - { - let inputs = &controller.inputs; + .join(); + + while let Some(tuple) = join_iter.next() { + let j = JoinData::new(&tuple, &updater, &dt); + let inputs = &j.inputs; // Being dead overrides all other states - if stats.is_dead { + if j.stats.is_dead { // Only options: click respawn // prevent instant-respawns (i.e. player was holding attack) // by disallowing while input is held down if inputs.respawn.is_pressed() && !inputs.respawn.is_held_down() { - server_bus.emitter().emit(ServerEvent::Respawn(entity)); + server_bus.emitter().emit(ServerEvent::Respawn(j.entity)); } // Or do nothing return; } // If mounted, character state is controlled by mount // TODO: Make mounting a state - if let Some(Mounting(_)) = mountings.get(entity) { - *character = CharacterState::Sit(None); + if let Some(Mounting(_)) = mountings.get(j.entity) { + *tuple.2 = CharacterState::Sit {}; return; } - let mut state_update = character.update(&EcsStateData { - entity: &entity, - uid, - character, - pos, - vel, - ori, - energy, - dt: &dt, - inputs, - stats, - body, - physics, - updater: &updater, - ability_pool, - }); + let mut state_update = match j.character { + CharacterState::Idle { .. } => states::idle::behavior(&j), + CharacterState::Climb { .. } => states::climb::behavior(&j), + CharacterState::Glide { .. } => states::glide::behavior(&j), + CharacterState::Roll { .. } => states::roll::behavior(&j), + CharacterState::Wielding { .. } => states::wielding::behavior(&j), + CharacterState::Equipping { .. } => states::equipping::behavior(&j), + CharacterState::BasicAttack { .. } => states::basic_attack::behavior(&j), + CharacterState::Sit { .. } => states::sit::behavior(&j), - *character = state_update.character; - *pos = state_update.pos; - *vel = state_update.vel; - *ori = state_update.ori; - *energy = state_update.energy; + _ => StateUpdate { + character: *j.character, + pos: *j.pos, + vel: *j.vel, + ori: *j.ori, + energy: *j.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }, + }; + + *tuple.2 = state_update.character; + *tuple.3 = state_update.pos; + *tuple.4 = state_update.vel; + *tuple.5 = state_update.ori; + *tuple.6 = state_update.energy; local_bus.emitter().append(&mut state_update.local_events); server_bus.emitter().append(&mut state_update.server_events); } diff --git a/common/src/sys/stats.rs b/common/src/sys/stats.rs index 20c1ce2dc4..25b92017dd 100644 --- a/common/src/sys/stats.rs +++ b/common/src/sys/stats.rs @@ -75,7 +75,7 @@ impl<'a> System<'a> for Sys { // Accelerate recharging energy if not wielding. match character_state { - CharacterState::Idle(_) => { + CharacterState::Idle { .. } => { if { let energy = energy.get_unchecked(); energy.current() < energy.maximum() @@ -92,7 +92,7 @@ impl<'a> System<'a> for Sys { } }, // Wield does not regen and sets the rate back to zero. - CharacterState::Wielded(_) => { + CharacterState::Wielding { .. } => { if energy.get_unchecked().regen_rate != 0.0 { energy.get_mut_unchecked().regen_rate = 0.0 } diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 87479d6c01..025a1ae72f 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -202,10 +202,10 @@ impl MovementEventMapper { // Match all other Movemement and Action states match (previous_state.event, character_state) { - (_, CharacterState::Roll(_)) => SfxEvent::Roll, - (_, CharacterState::Climb(_)) => SfxEvent::Climb, - (SfxEvent::Glide, CharacterState::Idle(_)) => SfxEvent::GliderClose, - (previous_event, CharacterState::Glide(_)) => { + (_, CharacterState::Roll { .. }) => SfxEvent::Roll, + (_, CharacterState::Climb { .. }) => SfxEvent::Climb, + (SfxEvent::Glide, CharacterState::Idle { .. }) => SfxEvent::GliderClose, + (previous_event, CharacterState::Glide { .. }) => { if previous_event != SfxEvent::GliderOpen && previous_event != SfxEvent::Glide { SfxEvent::GliderOpen } else { @@ -226,13 +226,13 @@ impl MovementEventMapper { } /// This helps us determine whether we should be emitting the Wield/Unwield - /// events. For now, consider either CharacterState::Wielded or - /// ::Wielding to mean the weapon is drawn. This will need updating if the + /// events. For now, consider either CharacterState::Wielding or + /// ::Equipping to mean the weapon is drawn. This will need updating if the /// animations change to match the wield_duration associated with the weapon fn weapon_drawn(character: &CharacterState) -> bool { character.is_wielded() || match character { - CharacterState::Wielding(_) => true, + CharacterState::Equipping { .. } => true, _ => false, } } diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 5d898ca73f..c978efc55d 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -91,7 +91,7 @@ fn maps_idle() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: true, on_wall: None, @@ -120,7 +120,7 @@ fn maps_run_with_sufficient_velocity() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: true, on_wall: None, @@ -149,7 +149,7 @@ fn does_not_map_run_with_insufficient_velocity() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: true, on_wall: None, @@ -178,7 +178,7 @@ fn does_not_map_run_with_sufficient_velocity_but_not_on_ground() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: false, on_wall: None, @@ -207,7 +207,7 @@ fn maps_roll() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Roll(None), + &CharacterState::Roll {}, &PhysicsState { on_ground: true, on_wall: None, @@ -236,7 +236,7 @@ fn maps_land_on_ground_to_run() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: true, on_wall: None, @@ -265,7 +265,7 @@ fn maps_glider_open() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Glide(None), + &CharacterState::Glide {}, &PhysicsState { on_ground: false, on_wall: None, @@ -294,7 +294,7 @@ fn maps_glide() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Glide(None), + &CharacterState::Glide {}, &PhysicsState { on_ground: false, on_wall: None, @@ -323,7 +323,7 @@ fn maps_glider_close_when_closing_mid_flight() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: false, on_wall: None, @@ -352,7 +352,7 @@ fn maps_glider_close_when_landing() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Idle(None), + &CharacterState::Idle {}, &PhysicsState { on_ground: true, on_wall: None, @@ -383,7 +383,7 @@ fn maps_wield() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Wielding(None), + &CharacterState::Equipping {}, &PhysicsState { on_ground: true, on_wall: None, @@ -443,7 +443,7 @@ fn does_not_map_wield_when_no_main_weapon() { ); let result = MovementEventMapper::map_movement_event( - &CharacterState::Wielded(None), + &CharacterState::Wielding {}, &PhysicsState { on_ground: true, on_wall: None, diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 3290c3fc23..35bdf5cbcc 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -170,10 +170,10 @@ impl FigureModelCache { if camera_mode != CameraMode::FirstPerson || character_state .map(|cs| match cs { - CharacterState::BasicAttack(_) - | CharacterState::BasicBlock(_) - | CharacterState::Wielding(_) - | CharacterState::Wielded(_) => true, + CharacterState::BasicAttack { .. } + | CharacterState::BasicBlock { .. } + | CharacterState::Equipping { .. } + | CharacterState::Wielding { .. } => true, _ => false, }) .unwrap_or_default() diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 4313677564..80eea9d095 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -441,14 +441,16 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::Roll(_) => anim::character::RollAnimation::update_skeleton( - &target_base, - (active_tool_kind, ori.0, state.last_ori, time), - state.state_time, - &mut state_animation_rate, - skeleton_attr, - ), - CharacterState::BasicAttack(_) => { + CharacterState::Roll { .. } => { + anim::character::RollAnimation::update_skeleton( + &target_base, + (active_tool_kind, ori.0, state.last_ori, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + }, + CharacterState::BasicAttack { .. } => { anim::character::AttackAnimation::update_skeleton( &target_base, (active_tool_kind, time), @@ -457,7 +459,7 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::BasicBlock(_) => { + CharacterState::BasicBlock { .. } => { anim::character::BlockIdleAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, time), @@ -476,7 +478,7 @@ impl FigureMgr { skeleton_attr, ) }*/ - CharacterState::Wielding(_) => { + CharacterState::Equipping { .. } => { anim::character::WieldAnimation::update_skeleton( &target_base, (active_tool_kind, vel.0.magnitude(), time), @@ -485,7 +487,7 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::Wielded(_) => { + CharacterState::Wielding { .. } => { anim::character::WieldAnimation::update_skeleton( &target_base, (active_tool_kind, vel.0.magnitude(), time), @@ -494,7 +496,7 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::Glide(_) => { + CharacterState::Glide { .. } => { anim::character::GlidingAnimation::update_skeleton( &target_base, (active_tool_kind, vel.0, ori.0, state.last_ori, time), @@ -503,7 +505,7 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::Climb(_) => { + CharacterState::Climb { .. } => { anim::character::ClimbAnimation::update_skeleton( &CharacterSkeleton::new(), (active_tool_kind, vel.0, ori.0, time), @@ -512,13 +514,15 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::Sit(_) => anim::character::SitAnimation::update_skeleton( - &CharacterSkeleton::new(), - (active_tool_kind, time), - state.state_time, - &mut state_animation_rate, - skeleton_attr, - ), + CharacterState::Sit { .. } => { + anim::character::SitAnimation::update_skeleton( + &CharacterSkeleton::new(), + (active_tool_kind, time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + }, _ => target_base, }; From d4332c31380318b6812638c958eb0f0a3f82964f Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 7 Mar 2020 13:26:46 -0500 Subject: [PATCH 070/387] eagle adjustments --- assets/common/npc_names.json | 4 +++ .../voxel/bird_medium_center_manifest.ron | 28 +++++++++++++++ .../voxel/bird_medium_lateral_manifest.ron | 36 +++++++++++++++++++ .../voxygen/voxel/npc/eagle/female/head.vox | 3 ++ .../voxygen/voxel/npc/eagle/female/leg_l.vox | 3 ++ .../voxygen/voxel/npc/eagle/female/leg_r.vox | 3 ++ .../voxygen/voxel/npc/eagle/female/tail.vox | 3 ++ .../voxygen/voxel/npc/eagle/female/torso.vox | 3 ++ .../voxygen/voxel/npc/eagle/female/wing_l.vox | 3 ++ .../voxygen/voxel/npc/eagle/female/wing_r.vox | 3 ++ assets/voxygen/voxel/npc/eagle/male/head.vox | 3 ++ assets/voxygen/voxel/npc/eagle/male/leg_l.vox | 3 ++ assets/voxygen/voxel/npc/eagle/male/leg_r.vox | 3 ++ assets/voxygen/voxel/npc/eagle/male/tail.vox | 3 ++ assets/voxygen/voxel/npc/eagle/male/torso.vox | 3 ++ .../voxygen/voxel/npc/eagle/male/wing_l.vox | 3 ++ .../voxygen/voxel/npc/eagle/male/wing_r.vox | 3 ++ .../quadruped_medium_central_manifest.ron | 4 +-- common/src/comp/body/bird_medium.rs | 6 +++- voxygen/src/anim/bird_medium/mod.rs | 5 +++ 20 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 assets/voxygen/voxel/npc/eagle/female/head.vox create mode 100644 assets/voxygen/voxel/npc/eagle/female/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/eagle/female/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/eagle/female/tail.vox create mode 100644 assets/voxygen/voxel/npc/eagle/female/torso.vox create mode 100644 assets/voxygen/voxel/npc/eagle/female/wing_l.vox create mode 100644 assets/voxygen/voxel/npc/eagle/female/wing_r.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/head.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/tail.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/torso.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/wing_l.vox create mode 100644 assets/voxygen/voxel/npc/eagle/male/wing_r.vox diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index f3fb272e08..d8bb02f0a7 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -459,6 +459,10 @@ "peacock": { "keyword": "peacock", "generic": "Peacock" + }, + "eagle": { + "keyword": "eagle", + "generic": "Eagle" } } }, diff --git a/assets/voxygen/voxel/bird_medium_center_manifest.ron b/assets/voxygen/voxel/bird_medium_center_manifest.ron index 8dde25c342..10451e3827 100644 --- a/assets/voxygen/voxel/bird_medium_center_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_center_manifest.ron @@ -111,4 +111,32 @@ center: ("npc.peacock.female.tail"), ) ), + (Eagle, Male): ( + head: ( + offset: (-2.0, -2.0, -3.5), + center: ("npc.eagle.female.head"), + ), + torso: ( + offset: (-3.0, -5.0, -4.5), + center: ("npc.eagle.female.torso"), + ), + tail: ( + offset: (-2.0, -2.5, -2.5), + center: ("npc.eagle.female.tail"), + ) + ), + (Eagle, Female): ( + head: ( + offset: (-2.0, -2.0, -3.5), + center: ("npc.eagle.female.head"), + ), + torso: ( + offset: (-3.0, -5.0, -4.5), + center: ("npc.eagle.female.torso"), + ), + tail: ( + offset: (-2.0, -2.5, -2.5), + center: ("npc.eagle.female.tail"), + ) + ), }) \ No newline at end of file diff --git a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron index 3fef62853c..a934c5695e 100644 --- a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron @@ -143,4 +143,40 @@ lateral: ("npc.peacock.female.leg_r"), ) ), + (Eagle, Male): ( + wing_l: ( + offset: (-1.0, -3.5, -13.0), + lateral: ("npc.eagle.male.wing_l"), + ), + wing_r: ( + offset: (-1.0, -3.5, -13.0), + lateral: ("npc.eagle.male.wing_r"), + ), + foot_l: ( + offset: (-1.5, 0.0, -8.0), + lateral: ("npc.eagle.male.leg_l"), + ), + foot_r: ( + offset: (-1.5, 0.0, -8.0), + lateral: ("npc.eagle.male.leg_r"), + ) + ), + (Eagle, Female): ( + wing_l: ( + offset: (-1.0, -3.5, -13.0), + lateral: ("npc.eagle.female.wing_l"), + ), + wing_r: ( + offset: (-1.0, -3.5, -13.0), + lateral: ("npc.eagle.female.wing_r"), + ), + foot_l: ( + offset: (-1.5, 0.0, -8.0), + lateral: ("npc.eagle.female.leg_l"), + ), + foot_r: ( + offset: (-1.5, 0.0, -8.0), + lateral: ("npc.eagle.female.leg_r"), + ) + ), }) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/eagle/female/head.vox b/assets/voxygen/voxel/npc/eagle/female/head.vox new file mode 100644 index 0000000000..3aeffecc8c --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b36eeef95b39217885e50d9c33d711187a90b1245a088c54d045ea484ca18491 +size 1608 diff --git a/assets/voxygen/voxel/npc/eagle/female/leg_l.vox b/assets/voxygen/voxel/npc/eagle/female/leg_l.vox new file mode 100644 index 0000000000..38e5e2c5c6 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6e82c2c806c245f8fdebb830b0763a1aa796593c041ad4ace556c8e413f5aa9 +size 55651 diff --git a/assets/voxygen/voxel/npc/eagle/female/leg_r.vox b/assets/voxygen/voxel/npc/eagle/female/leg_r.vox new file mode 100644 index 0000000000..a2ec2f7233 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ecb3129efdb691a6b81d691bd34e01920bf0c9703d9e76bd6fafaeac978146f +size 55651 diff --git a/assets/voxygen/voxel/npc/eagle/female/tail.vox b/assets/voxygen/voxel/npc/eagle/female/tail.vox new file mode 100644 index 0000000000..be6931c740 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/tail.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6691b2b369904e7682a044632d33d46f97055c7ac0d41d7872657608a546148c +size 55651 diff --git a/assets/voxygen/voxel/npc/eagle/female/torso.vox b/assets/voxygen/voxel/npc/eagle/female/torso.vox new file mode 100644 index 0000000000..01868dbddc --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/torso.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c841accf87e906e10639ca045f218490bd07b6584a474afe88aac8c2f1018f7 +size 2168 diff --git a/assets/voxygen/voxel/npc/eagle/female/wing_l.vox b/assets/voxygen/voxel/npc/eagle/female/wing_l.vox new file mode 100644 index 0000000000..c989207c3c --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/wing_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9c4bc7aac5811e9189116501858b5a1cf12187e6e08d6798e6810c04154ffdf +size 56027 diff --git a/assets/voxygen/voxel/npc/eagle/female/wing_r.vox b/assets/voxygen/voxel/npc/eagle/female/wing_r.vox new file mode 100644 index 0000000000..b2aa360724 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/female/wing_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65369f781827ace2267b450a5c40027748f1077a1245d5493c166571349af727 +size 56027 diff --git a/assets/voxygen/voxel/npc/eagle/male/head.vox b/assets/voxygen/voxel/npc/eagle/male/head.vox new file mode 100644 index 0000000000..3aeffecc8c --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b36eeef95b39217885e50d9c33d711187a90b1245a088c54d045ea484ca18491 +size 1608 diff --git a/assets/voxygen/voxel/npc/eagle/male/leg_l.vox b/assets/voxygen/voxel/npc/eagle/male/leg_l.vox new file mode 100644 index 0000000000..38e5e2c5c6 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6e82c2c806c245f8fdebb830b0763a1aa796593c041ad4ace556c8e413f5aa9 +size 55651 diff --git a/assets/voxygen/voxel/npc/eagle/male/leg_r.vox b/assets/voxygen/voxel/npc/eagle/male/leg_r.vox new file mode 100644 index 0000000000..a2ec2f7233 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ecb3129efdb691a6b81d691bd34e01920bf0c9703d9e76bd6fafaeac978146f +size 55651 diff --git a/assets/voxygen/voxel/npc/eagle/male/tail.vox b/assets/voxygen/voxel/npc/eagle/male/tail.vox new file mode 100644 index 0000000000..be6931c740 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/tail.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6691b2b369904e7682a044632d33d46f97055c7ac0d41d7872657608a546148c +size 55651 diff --git a/assets/voxygen/voxel/npc/eagle/male/torso.vox b/assets/voxygen/voxel/npc/eagle/male/torso.vox new file mode 100644 index 0000000000..01868dbddc --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/torso.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c841accf87e906e10639ca045f218490bd07b6584a474afe88aac8c2f1018f7 +size 2168 diff --git a/assets/voxygen/voxel/npc/eagle/male/wing_l.vox b/assets/voxygen/voxel/npc/eagle/male/wing_l.vox new file mode 100644 index 0000000000..c989207c3c --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/wing_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9c4bc7aac5811e9189116501858b5a1cf12187e6e08d6798e6810c04154ffdf +size 56027 diff --git a/assets/voxygen/voxel/npc/eagle/male/wing_r.vox b/assets/voxygen/voxel/npc/eagle/male/wing_r.vox new file mode 100644 index 0000000000..b2aa360724 --- /dev/null +++ b/assets/voxygen/voxel/npc/eagle/male/wing_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65369f781827ace2267b450a5c40027748f1077a1245d5493c166571349af727 +size 56027 diff --git a/assets/voxygen/voxel/quadruped_medium_central_manifest.ron b/assets/voxygen/voxel/quadruped_medium_central_manifest.ron index 6afce36256..8e3d3b12d6 100644 --- a/assets/voxygen/voxel/quadruped_medium_central_manifest.ron +++ b/assets/voxygen/voxel/quadruped_medium_central_manifest.ron @@ -386,7 +386,7 @@ central: ("npc.lion.male.ears"), ), tail: ( - offset: (-0.5, -1.0, -8.0), + offset: (-0.5, -1.0, -1.0), central: ("npc.lion.male.tail"), ), ), @@ -417,7 +417,7 @@ ), tail: ( offset: (-0.5, -1.0, -1.0), - central: ("npc.lion.male.tail"), + central: ("npc.lion.female.tail"), ), ), (Tarasque, Male): ( diff --git a/common/src/comp/body/bird_medium.rs b/common/src/comp/body/bird_medium.rs index 477250c767..6447925f3a 100644 --- a/common/src/comp/body/bird_medium.rs +++ b/common/src/comp/body/bird_medium.rs @@ -31,6 +31,7 @@ pub enum Species { Chicken = 1, Goose = 2, Peacock = 3, + Eagle = 4, } /// Data representing per-species generic data. @@ -42,6 +43,7 @@ pub struct AllSpecies { pub chicken: SpeciesMeta, pub goose: SpeciesMeta, pub peacock: SpeciesMeta, + pub eagle: SpeciesMeta, } impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { @@ -54,15 +56,17 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies Species::Chicken => &self.chicken, Species::Goose => &self.goose, Species::Peacock => &self.peacock, + Species::Eagle => &self.eagle, } } } -pub const ALL_SPECIES: [Species; 4] = [ +pub const ALL_SPECIES: [Species; 5] = [ Species::Duck, Species::Chicken, Species::Goose, Species::Peacock, + Species::Eagle, ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index d5e7832e74..a3ac5dc4a7 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/mod.rs @@ -103,30 +103,35 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Chicken, _) => (4.0, 3.0), (Goose, _) => (5.0, 5.0), (Peacock, _) => (4.0, 7.0), + (Eagle, _) => (3.5, 5.0), }, chest: match (body.species, body.body_type) { (Duck, _) => (0.0, 5.0), (Chicken, _) => (0.0, 5.0), (Goose, _) => (0.0, 8.0), (Peacock, _) => (0.0, 10.0), + (Eagle, _) => (0.0, 8.0), }, tail: match (body.species, body.body_type) { (Duck, _) => (-3.0, 1.5), (Chicken, _) => (-3.0, 1.5), (Goose, _) => (-5.0, 3.0), (Peacock, _) => (-5.5, 2.0), + (Eagle, _) => (-4.5, -5.0), }, wing: match (body.species, body.body_type) { (Duck, _) => (2.75, 0.0, 6.0), (Chicken, _) => (2.75, 0.0, 6.0), (Goose, _) => (3.75, -1.0, 9.0), (Peacock, _) => (3.0, 0.0, 9.0), + (Eagle, _) => (3.0, -8.0, 4.0), }, foot: match (body.species, body.body_type) { (Duck, _) => (2.0, -1.5, 4.0), (Chicken, _) => (2.0, -1.5, 4.0), (Goose, _) => (2.0, -1.5, 7.0), (Peacock, _) => (2.0, -2.5, 8.0), + (Eagle, _) => (2.0, -2.0, 8.0), }, } } From cb9e3859daf62155e6fa47d6f765dc1395bfa8fd Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 7 Mar 2020 11:02:54 -0800 Subject: [PATCH 071/387] Rename character behavior sys --- common/src/states/basic_attack.rs | 2 +- common/src/states/basic_block.rs | 2 +- common/src/states/charge_attack.rs | 2 +- common/src/states/climb.rs | 2 +- common/src/states/equipping.rs | 2 +- common/src/states/glide.rs | 2 +- common/src/states/idle.rs | 2 +- common/src/states/roll.rs | 2 +- common/src/states/sit.rs | 2 +- common/src/states/swim.rs | 2 +- common/src/states/utils.rs | 2 +- common/src/states/wielding.rs | 2 +- .../src/sys/{character_state.rs => character_behavior.rs} | 0 common/src/sys/mod.rs | 8 +++++--- 14 files changed, 17 insertions(+), 15 deletions(-) rename common/src/sys/{character_state.rs => character_behavior.rs} (100%) diff --git a/common/src/states/basic_attack.rs b/common/src/states/basic_attack.rs index e144420f8f..a2ea1838c3 100644 --- a/common/src/states/basic_attack.rs +++ b/common/src/states/basic_attack.rs @@ -1,7 +1,7 @@ use crate::{ comp::{Attacking, CharacterState, ItemKind::Tool, StateUpdate}, states::utils::*, - sys::character_state::JoinData, + sys::character_behavior::JoinData, }; use std::{collections::VecDeque, time::Duration}; diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index 9781b7cc10..6dc909b1ec 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -4,7 +4,7 @@ use crate::{ }; use std::{collections::VecDeque, time::Duration}; use vek::Vec2; -use crate::sys::character_state::JoinData; +use crate::sys::character_behavior::JoinData; const BLOCK_ACCEL: f32 = 30.0; const BLOCK_SPEED: f32 = 75.0; diff --git a/common/src/states/charge_attack.rs b/common/src/states/charge_attack.rs index 5dbd9001a4..82e229de78 100644 --- a/common/src/states/charge_attack.rs +++ b/common/src/states/charge_attack.rs @@ -5,7 +5,7 @@ use crate::{ ItemKind::Tool, MoveState::Run, StateUpdate, ToolData, }, event::ServerEvent, - sys::character_state::JoinData, + sys::character_behavior::JoinData, }; use std::time::Duration; use vek::Vec3; diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index ee7bf3257d..6d5f09b1ea 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -1,7 +1,7 @@ use crate::{ comp::{CharacterState, EnergySource, StateUpdate}, event::LocalEvent, - sys::{character_state::JoinData, phys::GRAVITY}, + sys::{character_behavior::JoinData, phys::GRAVITY}, }; use std::collections::VecDeque; use vek::{ diff --git a/common/src/states/equipping.rs b/common/src/states/equipping.rs index 8d6004114f..27ae4f1122 100644 --- a/common/src/states/equipping.rs +++ b/common/src/states/equipping.rs @@ -1,7 +1,7 @@ use super::utils::*; use crate::{ comp::{CharacterState, StateUpdate}, - sys::character_state::JoinData, + sys::character_behavior::JoinData, }; use std::{collections::VecDeque, time::Duration}; diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index 4a7d22c997..239f250f72 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -1,6 +1,6 @@ use crate::{ comp::{CharacterState, StateUpdate}, - sys::character_state::JoinData, + sys::character_behavior::JoinData, }; use std::collections::VecDeque; use vek::{Vec2, Vec3}; diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index 3e16c39f64..c2df18be36 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -1,5 +1,5 @@ use super::utils::*; -use crate::{comp::StateUpdate, sys::character_state::JoinData}; +use crate::{comp::StateUpdate, sys::character_behavior::JoinData}; use std::collections::VecDeque; pub fn behavior(data: &JoinData) -> StateUpdate { diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index ee62145bb8..cc2a570b7b 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,6 +1,6 @@ use crate::{ comp::{CharacterState, StateUpdate}, - sys::character_state::JoinData, + sys::character_behavior::JoinData, }; use std::{collections::VecDeque, time::Duration}; use vek::Vec3; diff --git a/common/src/states/sit.rs b/common/src/states/sit.rs index 9f329e83b3..89c312d3c2 100644 --- a/common/src/states/sit.rs +++ b/common/src/states/sit.rs @@ -1,7 +1,7 @@ use super::utils::*; use crate::{ comp::{CharacterState, StateUpdate}, - sys::character_state::JoinData, + sys::character_behavior::JoinData, }; use std::collections::VecDeque; diff --git a/common/src/states/swim.rs b/common/src/states/swim.rs index 4267731249..0cb327296e 100644 --- a/common/src/states/swim.rs +++ b/common/src/states/swim.rs @@ -1,6 +1,6 @@ use crate::{ comp::StateUpdate, - sys::{character_state::JoinData, phys::GRAVITY}, + sys::{character_behavior::JoinData, phys::GRAVITY}, }; use std::time::Duration; use vek::{Vec2, Vec3}; diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 73a51ed801..7608c671d3 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,7 +1,7 @@ use crate::{ comp::{AbilityState, CharacterState, EnergySource, ItemKind::Tool, StateUpdate}, event::LocalEvent, - sys::{character_state::JoinData, phys::GRAVITY}, + sys::{character_behavior::JoinData, phys::GRAVITY}, }; use std::time::Duration; use vek::vec::{Vec2, Vec3}; diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index eaf054762f..1edc0bf78c 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -1,5 +1,5 @@ use super::utils::*; -use crate::{comp::StateUpdate, sys::character_state::JoinData}; +use crate::{comp::StateUpdate, sys::character_behavior::JoinData}; use std::collections::VecDeque; pub fn behavior(ecs_data: &JoinData) -> StateUpdate { diff --git a/common/src/sys/character_state.rs b/common/src/sys/character_behavior.rs similarity index 100% rename from common/src/sys/character_state.rs rename to common/src/sys/character_behavior.rs diff --git a/common/src/sys/mod.rs b/common/src/sys/mod.rs index 6deb55ff11..1e478ea87c 100644 --- a/common/src/sys/mod.rs +++ b/common/src/sys/mod.rs @@ -1,5 +1,5 @@ pub mod agent; -pub mod character_state; +pub mod character_behavior; mod combat; pub mod controller; mod mount; @@ -11,7 +11,7 @@ mod stats; use specs::DispatcherBuilder; // System names -pub const CHARACTER_STATE_SYS: &str = "character_state_sys"; +pub const CHARACTER_BEHAVIOR_SYS: &str = "character_behavior_sys"; pub const COMBAT_SYS: &str = "combat_sys"; pub const AGENT_SYS: &str = "agent_sys"; pub const CONTROLLER_SYS: &str = "controller_sys"; @@ -24,7 +24,9 @@ pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(agent::Sys, AGENT_SYS, &[]); dispatch_builder.add(mount::Sys, MOUNT_SYS, &[AGENT_SYS]); dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS, MOUNT_SYS]); - dispatch_builder.add(character_state::Sys, CHARACTER_STATE_SYS, &[CONTROLLER_SYS]); + dispatch_builder.add(character_behavior::Sys, CHARACTER_BEHAVIOR_SYS, &[ + CONTROLLER_SYS, + ]); dispatch_builder.add(stats::Sys, STATS_SYS, &[]); dispatch_builder.add(phys::Sys, PHYS_SYS, &[CONTROLLER_SYS, MOUNT_SYS, STATS_SYS]); dispatch_builder.add(projectile::Sys, PROJECTILE_SYS, &[PHYS_SYS]); From c678ca95409c8924ade93bbe818a01b0945e111b Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 7 Mar 2020 11:55:15 -0800 Subject: [PATCH 072/387] Re-add blocking --- common/src/comp/ability.rs | 2 +- common/src/states/basic_block.rs | 49 +++++++++++++++------------- common/src/states/mod.rs | 2 +- common/src/sys/character_behavior.rs | 1 + 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 4f9daa7162..9210ee6b02 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -26,7 +26,7 @@ impl Default for AbilityPool { fn default() -> Self { Self { primary: Some(AbilityState::BasicAttack), - secondary: Some(AbilityState::BasicAttack), + secondary: Some(AbilityState::BasicBlock), block: None, dodge: Some(AbilityState::Roll), } diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index 6dc909b1ec..8c5444b6bf 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -1,32 +1,35 @@ use super::utils::*; use crate::{ - comp::{CharacterEntityData, CharacterState, StateUpdate}, + comp::{CharacterState, ItemKind, StateUpdate}, + sys::character_behavior::JoinData, }; -use std::{collections::VecDeque, time::Duration}; -use vek::Vec2; -use crate::sys::character_behavior::JoinData; +use std::collections::VecDeque; -const BLOCK_ACCEL: f32 = 30.0; -const BLOCK_SPEED: f32 = 75.0; +// const BLOCK_ACCEL: f32 = 30.0; +// const BLOCK_SPEED: f32 = 75.0; +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + character: *data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; - pub fn handle(data: &JoinData) -> StateUpdate { - let mut update = StateUpdate { - pos: *data.pos, - vel: *data.vel, - ori: *data.ori, - energy: *data.energy, - character: *data.character, - local_events: VecDeque::new(), - server_events: VecDeque::new(), + handle_move(&data, &mut update); + + if !data.physics.on_ground || !data.inputs.secondary.is_pressed() { + if let Some(ItemKind::Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { + update.character = CharacterState::Equipping { + tool, + time_left: tool.equip_time(), + }; + } else { + update.character = CharacterState::Idle {}; }; - - handle_move(&data, &mut update); - - if !data.physics.on_ground || !data.inputs.secondary.is_pressed() { - update.character = CharacterState::Wielding{}; - } - - update } + update } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 9a9c62a9b3..2375e7d586 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -1,6 +1,6 @@ // Module declarations pub mod basic_attack; -// pub mod basic_block; +pub mod basic_block; pub mod climb; pub mod equipping; pub mod glide; diff --git a/common/src/sys/character_behavior.rs b/common/src/sys/character_behavior.rs index b703617cf6..576e95c30d 100644 --- a/common/src/sys/character_behavior.rs +++ b/common/src/sys/character_behavior.rs @@ -168,6 +168,7 @@ impl<'a> System<'a> for Sys { CharacterState::Wielding { .. } => states::wielding::behavior(&j), CharacterState::Equipping { .. } => states::equipping::behavior(&j), CharacterState::BasicAttack { .. } => states::basic_attack::behavior(&j), + CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j), CharacterState::Sit { .. } => states::sit::behavior(&j), _ => StateUpdate { From 54a7112ad9386c1b247402346718b25899b0b9e8 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 7 Mar 2020 12:49:48 -0800 Subject: [PATCH 073/387] resolve conflicts merging master -> clientstates --- common/src/comp/character_state.rs | 2 +- common/src/comp/inventory/mod.rs | 2 +- common/src/event.rs | 6 +-- common/src/states/utils.rs | 2 +- common/src/sys/movement.rs | 2 +- voxygen/src/anim/character/attack.rs | 2 +- voxygen/src/anim/character/block.rs | 2 +- voxygen/src/anim/character/blockidle.rs | 2 +- voxygen/src/anim/character/cidle.rs | 2 +- voxygen/src/anim/character/crun.rs | 16 +++--- voxygen/src/anim/character/stand.rs | 2 +- voxygen/src/anim/character/wield.rs | 2 +- .../audio/sfx/event_mapper/movement/mod.rs | 50 +------------------ voxygen/src/scene/figure/cache.rs | 4 +- voxygen/src/scene/mod.rs | 2 +- 15 files changed, 24 insertions(+), 74 deletions(-) diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 22c49e0fe7..bdabd39759 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -50,7 +50,7 @@ pub enum CharacterState { } impl CharacterState { - pub fn is_wielded(&self) -> bool { + pub fn is_wield(&self) -> bool { match self { CharacterState::Wielding { .. } => true, CharacterState::BasicAttack { .. } => true, diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index f192208b5c..9f15789a9d 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -1,7 +1,7 @@ pub mod item; // Reexports -pub use item::{Consumable, Debug, Item, ItemKind, Tool}; +pub use item::{Consumable, Debug, Item, ItemKind, SwordKind, ToolData, ToolKind}; use crate::assets; use specs::{Component, FlaggedStorage, HashMapStorage}; diff --git a/common/src/event.rs b/common/src/event.rs index 188c994ae8..e14ac62bfb 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -1,5 +1,5 @@ use crate::{comp, sync::Uid}; -use comp::{item::Tool, InventoryUpdateEvent}; +use comp::{item::ToolData, InventoryUpdateEvent}; use parking_lot::Mutex; use serde::Deserialize; use specs::Entity as EcsEntity; @@ -40,8 +40,8 @@ pub enum SfxEvent { Fall, ExperienceGained, LevelUp, - Wield(Tool), - Unwield(Tool), + Wield(ToolData), + Unwield(ToolData), Inventory(InventoryUpdateEvent), } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 7608c671d3..2745e1fc86 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -38,7 +38,7 @@ pub fn handle_ground_move(data: &JoinData, update: &mut StateUpdate) { } // Set direction based on move direction - let ori_dir = if update.character.is_wielded() + let ori_dir = if update.character.is_wield() || update.character.is_attack() || update.character.is_block() { diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index 439ff9ceea..b0f41858f4 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -121,7 +121,7 @@ impl<'a> System<'a> for Sys { let inputs = &controller.inputs; - if character.action.is_roll() { + if character.action.is_dodge() { vel.0 = Vec3::new(0.0, 0.0, vel.0.z) + (vel.0 * Vec3::new(1.0, 1.0, 0.0) + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index e9701476d4..8e376c6f7b 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -62,7 +62,7 @@ impl Animation for AttackAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword(_)) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(0.0, 1.0, 0.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.04; diff --git a/voxygen/src/anim/character/block.rs b/voxygen/src/anim/character/block.rs index 6c55878e96..62195f3853 100644 --- a/voxygen/src/anim/character/block.rs +++ b/voxygen/src/anim/character/block.rs @@ -62,7 +62,7 @@ impl Animation for BlockAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword(_)) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.04; diff --git a/voxygen/src/anim/character/blockidle.rs b/voxygen/src/anim/character/blockidle.rs index 94f18c2571..8e7ec674e3 100644 --- a/voxygen/src/anim/character/blockidle.rs +++ b/voxygen/src/anim/character/blockidle.rs @@ -61,7 +61,7 @@ impl Animation for BlockIdleAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword(_)) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.04; diff --git a/voxygen/src/anim/character/cidle.rs b/voxygen/src/anim/character/cidle.rs index 71e61a55cc..d72262fb69 100644 --- a/voxygen/src/anim/character/cidle.rs +++ b/voxygen/src/anim/character/cidle.rs @@ -62,7 +62,7 @@ impl Animation for CidleAnimation { match active_tool_kind { //TODO: Inventory - Some(Tool::Sword(_)) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(-0.25, -5.0, -5.0); next.l_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2); next.l_hand.scale = Vec3::one() * 1.04; diff --git a/voxygen/src/anim/character/crun.rs b/voxygen/src/anim/character/crun.rs index bc6448ac5b..fe28dc3770 100644 --- a/voxygen/src/anim/character/crun.rs +++ b/voxygen/src/anim/character/crun.rs @@ -37,9 +37,9 @@ impl Animation for WieldAnimation { * 0.1, ); - match Tool::Bow { + match ToolKind::Bow { //TODO: Inventory - Some(Tool::Sword(_)) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.04; @@ -58,7 +58,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.control.scale = Vec3::one(); }, - Tool::Axe => { + ToolKind::Axe => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -75,7 +75,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.weapon.scale = Vec3::one(); }, - Tool::Hammer => { + ToolKind::Hammer => { next.l_hand.offset = Vec3::new(-7.0, 8.25, 3.0); next.l_hand.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(-1.2) @@ -96,7 +96,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(wave * -0.25); next.weapon.scale = Vec3::one(); }, - Tool::Staff => { + ToolKind::Staff => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -113,7 +113,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.weapon.scale = Vec3::one(); }, - Tool::SwordShield => { + ToolKind::SwordShield => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; @@ -130,7 +130,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.0); next.weapon.scale = Vec3::one(); }, - Tool::Bow => { + ToolKind::Bow => { next.l_hand.offset = Vec3::new(-4.0, 5.0, 0.0); next.l_hand.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(-1.9) @@ -151,7 +151,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(0.85 + 3.14); next.weapon.scale = Vec3::one(); }, - Tool::Daggers => { + ToolKind::Daggers => { next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.scale = Vec3::one() * 1.01; diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index 6e2cb811e8..c66afb21b4 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -1,5 +1,5 @@ use super::{super::Animation, CharacterSkeleton, SkeletonAttr}; -use common::comp::item::Tool; +use common::comp::item::ToolKind; use std::ops::Mul; use vek::*; diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 0a9384f270..2efe46c798 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -29,7 +29,7 @@ impl Animation for WieldAnimation { let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); match active_tool_kind { //TODO: Inventory - Some(Tool::Sword(_)) => { + Some(ToolKind::Sword(_)) => { next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.04; diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 494477af45..fee6ddd4ea 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -158,54 +158,6 @@ impl MovementEventMapper { vel: Vec3, stats: &Stats, ) -> SfxEvent { - // Handle any weapon wielding changes up front. Doing so here first simplifies - // handling the movement/action state later, since they don't require querying - // stats or previous wield state. - if let Some(Item { - kind: ItemKind::Tool(ToolData { kind, .. }), - .. - }) = stats.equipment.main - { - if let Some(wield_event) = match ( - previous_event.weapon_drawn, - current_event.action.is_roll(), - Self::has_weapon_drawn(current_event.action), - ) { - (false, false, true) => Some(SfxEvent::Wield(kind)), - (true, false, false) => Some(SfxEvent::Unwield(kind)), - _ => None, - } { - return wield_event; - } - } - - // Match all other Movemement and Action states - match ( - current_event.movement, - current_event.action, - previous_event.event.clone(), - ) { - (_, ActionState::Roll { .. }, _) => SfxEvent::Roll, - (MovementState::Climb, ..) => SfxEvent::Climb, - (MovementState::Swim, ..) => SfxEvent::Swim, - (MovementState::Run, ..) => { - // If the entitys's velocity is very low, they may be stuck, or walking into a - // solid object. We should not trigger the run SFX in this case, - // even if their move state indicates running. The 0.1 value is - // an approximation from playtesting scenarios where this can occur. - if vel.magnitude() > 0.1 { - SfxEvent::Run - } else { - Some(SfxEvent::Run) - } - }, - (false, true) => Some(SfxEvent::Jump), - _ => None, - } - { - return jump_or_fall_event; - } - // Match run state if physics_state.on_ground && vel.magnitude() > 0.1 { return SfxEvent::Run; @@ -241,7 +193,7 @@ impl MovementEventMapper { /// ::Equipping to mean the weapon is drawn. This will need updating if the /// animations change to match the wield_duration associated with the weapon fn weapon_drawn(character: &CharacterState) -> bool { - character.is_wielded() + character.is_wield() || match character { CharacterState::Equipping { .. } => true, _ => false, diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 01b9323f8f..3cd35ebb13 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -183,9 +183,7 @@ impl FigureModelCache { if camera_mode != CameraMode::FirstPerson || character_state .map(|cs| { - cs.action.is_attack() - || cs.action.is_block() - || cs.action.is_wield() + cs.is_attack() || cs.is_block() || cs.is_wield() }) .unwrap_or_default() { diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 84c6aa2f3e..ebf7825b2a 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -173,7 +173,7 @@ impl Scene { .ecs() .read_storage::() .get(scene_data.player_entity) - .map_or(false, |cs| cs.action.is_roll()); + .map_or(false, |cs| cs.is_dodge()); let player_scale = match scene_data .state From 49c714314486ece9c97c3b63cf2224f4de49b33e Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 7 Mar 2020 13:03:10 -0800 Subject: [PATCH 074/387] Clean up warnings --- common/src/comp/controller.rs | 2 +- common/src/sys/character_behavior.rs | 22 +++++++++---------- common/src/sys/combat.rs | 14 ++++++------ common/src/sys/controller.rs | 11 ++++------ voxygen/src/anim/mod.rs | 3 +++ .../audio/sfx/event_mapper/movement/mod.rs | 4 ++-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index a513f619cc..8b88f488c4 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -67,7 +67,7 @@ impl Input { /// Whether input has been pressed for longer than `threshold` pub fn is_long_press(&self, threshold: Duration) -> bool { - (self.is_pressed() && self.duration >= threshold) + self.is_pressed() && self.duration >= threshold } /// Handles logic of updating state of Input diff --git a/common/src/sys/character_behavior.rs b/common/src/sys/character_behavior.rs index 576e95c30d..1179a3c196 100644 --- a/common/src/sys/character_behavior.rs +++ b/common/src/sys/character_behavior.rs @@ -1,7 +1,7 @@ use crate::{ comp::{ AbilityPool, Body, CharacterState, Controller, ControllerInputs, Energy, Mounting, Ori, - PhysicsState, Pos, StateUpdate, Stats, Vel, + PhysicsState, Pos, Stats, Vel, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, @@ -11,7 +11,7 @@ use crate::{ use specs::{Entities, Entity, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage}; -use std::collections::VecDeque; +// use std::collections::VecDeque; /// Read-Only Data sent from Character Behavior System to bahvior fn's pub struct JoinData<'a> { @@ -171,15 +171,15 @@ impl<'a> System<'a> for Sys { CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j), CharacterState::Sit { .. } => states::sit::behavior(&j), - _ => StateUpdate { - character: *j.character, - pos: *j.pos, - vel: *j.vel, - ori: *j.ori, - energy: *j.energy, - local_events: VecDeque::new(), - server_events: VecDeque::new(), - }, + // _ => StateUpdate { + // character: *j.character, + // pos: *j.pos, + // vel: *j.vel, + // ori: *j.ori, + // energy: *j.energy, + // local_events: VecDeque::new(), + // server_events: VecDeque::new(), + // }, }; *tuple.2 = state_update.character; diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 0024e639a5..6918df5eab 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -1,14 +1,14 @@ use crate::{ comp::{ - Attacking, Body, CharacterState, Controller, HealthChange, HealthSource, Item, ItemKind, - Ori, Pos, Scale, Stats, + Attacking, Body, CharacterState, Controller, HealthChange, HealthSource, Ori, Pos, Scale, + Stats, }, event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, sync::Uid, }; use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage}; -use std::time::Duration; +// use std::time::Duration; use vek::*; const BLOCK_EFFICIENCY: f32 = 0.9; @@ -42,8 +42,8 @@ impl<'a> System<'a> for Sys { ( entities, server_bus, - local_bus, - dt, + _local_bus, + _dt, uids, positions, orientations, @@ -52,11 +52,11 @@ impl<'a> System<'a> for Sys { bodies, stats, mut attacking_storage, - mut character_states, + character_states, ): Self::SystemData, ) { // Attacks - for (entity, uid, pos, ori, scale_maybe, _, attacker_stats, attack) in ( + for (entity, uid, pos, ori, scale_maybe, _, _attacker_stats, attack) in ( &entities, &uids, &positions, diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index b8dee638b2..4a0e033651 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -1,9 +1,6 @@ use crate::{ - comp::{ - item, projectile, Body, ControlEvent, Controller, ControllerInputs, Energy, EnergySource, - HealthChange, HealthSource, ItemKind, Mounting, PhysicsState, Projectile, Stats, Vel, - }, - event::{Emitter, EventBus, LocalEvent, ServerEvent}, + comp::{ControlEvent, Controller}, + event::{EventBus, LocalEvent, ServerEvent}, state::DeltaTime, sync::{Uid, UidAllocator}, }; @@ -12,8 +9,8 @@ use specs::{ Entities, Join, Read, ReadStorage, System, WriteStorage, }; -const CHARGE_COST: i32 = 200; -const ROLL_COST: i32 = 30; +// const CHARGE_COST: i32 = 200; +// const ROLL_COST: i32 = 30; pub struct Sys; diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index 590f67abb1..df32446f5c 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -58,6 +58,9 @@ pub trait Skeleton: Send + Sync + 'static { fn interpolate(&mut self, target: &Self, dt: f32); } +// rustc complains that `SkeletonAttr` fields are never read. +// Pls remove when they are. +#[allow(dead_code)] pub struct SkeletonAttr { scaler: f32, head_scale: f32, diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index fee6ddd4ea..084dc47ea2 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -4,7 +4,7 @@ use crate::audio::sfx::{SfxTriggerItem, SfxTriggers}; use common::{ - comp::{Body, CharacterState, Item, ItemKind, PhysicsState, Pos, Stats, ToolData, Vel}, + comp::{Body, CharacterState, PhysicsState, Pos, Stats, Vel}, event::{EventBus, SfxEvent, SfxEventItem}, state::State, }; @@ -156,7 +156,7 @@ impl MovementEventMapper { physics_state: &PhysicsState, previous_state: &PreviousEntityState, vel: Vec3, - stats: &Stats, + _stats: &Stats, ) -> SfxEvent { // Match run state if physics_state.on_ground && vel.magnitude() > 0.1 { From 99e64d06b9ca4eadf8959773ec21537b92bba348 Mon Sep 17 00:00:00 2001 From: Capucho Date: Sat, 7 Mar 2020 22:14:21 +0000 Subject: [PATCH 075/387] Janky fix of the logout timeout problem --- client/src/lib.rs | 3 ++- common/src/msg/mod.rs | 1 + server/src/sys/message.rs | 7 +++++++ voxygen/src/session.rs | 31 +++++++++++++++++++++++-------- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 5bb2068dc6..6a7239e606 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -197,7 +197,7 @@ impl Client { /// Send disconnect message to the server pub fn request_logout(&mut self) { self.postbox.send_message(ClientMsg::Disconnect); - self.client_state = ClientState::Pending; + self.client_state = ClientState::Disconnected; } /// Request a state transition to `ClientState::Registered` from an ingame @@ -703,6 +703,7 @@ impl Client { }, ServerMsg::Disconnect => { frontend_events.push(Event::Disconnect); + self.client_state = ClientState::Disconnected; }, } } diff --git a/common/src/msg/mod.rs b/common/src/msg/mod.rs index 1baee67e15..411763607f 100644 --- a/common/src/msg/mod.rs +++ b/common/src/msg/mod.rs @@ -16,6 +16,7 @@ pub enum ClientState { Registered, Spectator, Character, + Disconnected, } pub const MAX_BYTES_CHAT_MSG: usize = 256; diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index f68d32f9e6..6fbf50e840 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -111,6 +111,7 @@ impl<'a> System<'a> for Sys { server_emitter.emit(ServerEvent::ExitIngame { entity }); }, ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, // Request spectator state ClientMsg::Spectate => match client.client_state { @@ -121,6 +122,7 @@ impl<'a> System<'a> for Sys { client.allow_state(ClientState::Spectator) }, ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, // Valid player ClientMsg::Register { player, password } if player.is_valid() => { @@ -187,6 +189,7 @@ impl<'a> System<'a> for Sys { }, ClientState::Character => client.error_state(RequestStateError::Already), ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, ClientMsg::ControllerInputs(inputs) => match client.client_state { ClientState::Connected @@ -200,6 +203,7 @@ impl<'a> System<'a> for Sys { } }, ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, ClientMsg::ControlEvent(event) => match client.client_state { ClientState::Connected @@ -213,6 +217,7 @@ impl<'a> System<'a> for Sys { } }, ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, ClientMsg::ChatMsg { message } => match client.client_state { ClientState::Connected => client.error_state(RequestStateError::Impossible), @@ -227,6 +232,7 @@ impl<'a> System<'a> for Sys { ), }, ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, ClientMsg::PlayerPhysics { pos, vel, ori } => match client.client_state { ClientState::Character => { @@ -267,6 +273,7 @@ impl<'a> System<'a> for Sys { } }, ClientState::Pending => {}, + ClientState::Disconnected => unreachable!(), }, // Always possible. ClientMsg::Ping => client.postbox.send_message(ServerMsg::Pong), diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index cf47210669..234db82d4f 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -33,6 +33,14 @@ pub struct SessionState { selected_block: Block, } +/// The action to perform after a tick +enum TickAction { + // Continue executing + Continue, + // Disconnected (i.e. go to main menu) + Disconnect, +} + /// Represents an active game session (i.e., the one being played). impl SessionState { /// Create a new `SessionState`. @@ -65,7 +73,7 @@ impl SessionState { impl SessionState { /// Tick the session (and the client attached to it). - fn tick(&mut self, dt: Duration) -> Result<(), Error> { + fn tick(&mut self, dt: Duration) -> Result { self.inputs.tick(dt); for event in self.client.borrow_mut().tick( self.inputs.clone(), @@ -79,7 +87,10 @@ impl SessionState { } => { self.hud.new_message(event); }, - client::Event::Disconnect => {}, // TODO + client::Event::Disconnect => { + log::warn!("disconnect"); + return Ok(TickAction::Disconnect); + }, client::Event::DisconnectionNotification(time) => { let message = match time { 0 => String::from("Goodbye!"), @@ -94,7 +105,7 @@ impl SessionState { } } - Ok(()) + Ok(TickAction::Continue) } /// Clean up the session (and the client attached to it) after a tick. @@ -390,12 +401,16 @@ impl PlayState for SessionState { || !global_state.singleplayer.as_ref().unwrap().is_paused() { // Perform an in-game tick. - if let Err(err) = self.tick(clock.get_avg_delta()) { - global_state.info_message = - Some(localized_strings.get("common.connection_lost").to_owned()); - error!("[session] Failed to tick the scene: {:?}", err); + match self.tick(clock.get_avg_delta()) { + Ok(TickAction::Continue) => {}, // Do nothing + Ok(TickAction::Disconnect) => return PlayStateResult::Pop, // Go to main menu + Err(err) => { + global_state.info_message = + Some(localized_strings.get("common.connection_lost").to_owned()); + error!("[session] Failed to tick the scene: {:?}", err); - return PlayStateResult::Pop; + return PlayStateResult::Pop; + }, } } From 5a9a8323f2c9aa35675103ebc1034684e4b5c356 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sat, 7 Mar 2020 15:45:10 -0800 Subject: [PATCH 076/387] Update utils/handle_move fn's --- common/src/states/utils.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 2745e1fc86..a4e75c7cda 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -11,16 +11,16 @@ const HUMANOID_WATER_SPEED: f32 = 120.0; pub fn handle_move(data: &JoinData, update: &mut StateUpdate) { if data.physics.in_fluid { - handle_swim_move(data, update); + swim_move(data, update); } else { - handle_ground_move(data, update); + ground_move(data, update); } } -pub fn handle_ground_move(data: &JoinData, update: &mut StateUpdate) { +fn ground_move(data: &JoinData, update: &mut StateUpdate) { let (accel, speed): (f32, f32) = if data.physics.on_ground { let accel = 100.0; - let speed = 8.0; + let speed = 9.0; (accel, speed) } else { let accel = 100.0; @@ -56,7 +56,7 @@ pub fn handle_ground_move(data: &JoinData, update: &mut StateUpdate) { } } -pub fn handle_swim_move(data: &JoinData, update: &mut StateUpdate) { +fn swim_move(data: &JoinData, update: &mut StateUpdate) { // Update velocity update.vel.0 += Vec2::broadcast(data.dt.0) * data.inputs.move_dir From ca6d5ab506330890c5d809b16f3a914d633f60be Mon Sep 17 00:00:00 2001 From: Capucho Date: Sun, 8 Mar 2020 08:06:22 +0000 Subject: [PATCH 077/387] Proper fix to the logout timeout problem using Disconnect ACK --- client/src/lib.rs | 10 +++++++++- common/src/msg/client.rs | 1 + server/src/sys/message.rs | 4 +++- voxygen/src/menu/char_selection/mod.rs | 7 ++++++- voxygen/src/session.rs | 21 +++++++++------------ 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 6a7239e606..c44c787e6b 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -77,6 +77,8 @@ pub struct Client { loaded_distance: f32, pending_chunks: HashMap, Instant>, + + disconnected: bool, } impl Client { @@ -163,6 +165,8 @@ impl Client { loaded_distance: 0.0, pending_chunks: HashMap::new(), + + disconnected: false, }) } @@ -702,8 +706,9 @@ impl Client { ); }, ServerMsg::Disconnect => { + self.disconnected = true; frontend_events.push(Event::Disconnect); - self.client_state = ClientState::Disconnected; + self.postbox.send_message(ClientMsg::Terminate); }, } } @@ -716,6 +721,9 @@ impl Client { Ok(frontend_events) } + // Get's whether or not the client just disconnected + pub fn disconnected(&self) -> bool { self.disconnected } + /// Get the player's entity. pub fn entity(&self) -> EcsEntity { self.entity } diff --git a/common/src/msg/client.rs b/common/src/msg/client.rs index b4022483ad..4ef051ef60 100644 --- a/common/src/msg/client.rs +++ b/common/src/msg/client.rs @@ -35,4 +35,5 @@ pub enum ClientMsg { key: Vec2, }, Disconnect, + Terminate, } diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index 6fbf50e840..b040b20a2d 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -281,6 +281,9 @@ impl<'a> System<'a> for Sys { ClientMsg::Disconnect => { disconnect = true; }, + ClientMsg::Terminate => { + server_emitter.emit(ServerEvent::ClientDisconnect(entity)); + }, } } @@ -295,7 +298,6 @@ impl<'a> System<'a> for Sys { ServerMsg::broadcast(format!("{} went offline.", &player.alias)), )); } - server_emitter.emit(ServerEvent::ClientDisconnect(entity)); client.postbox.send_message(ServerMsg::Disconnect); } } diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index f7eaae27c2..0931126e37 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -39,6 +39,11 @@ impl PlayState for CharSelectionState { // Set up an fps clock. let mut clock = Clock::start(); + // Check if we just disconnected, if so go to main menu + if self.client.borrow().disconnected() { + return PlayStateResult::Pop; + } + let mut current_client_state = self.client.borrow().get_client_state(); while let ClientState::Pending | ClientState::Registered = current_client_state { // Handle window events @@ -141,7 +146,7 @@ impl PlayState for CharSelectionState { ) { global_state.info_message = Some(localized_strings.get("common.connection_lost").to_owned()); - error!("[session] Failed to tick the scene: {:?}", err); + error!("[char_selection] Failed to tick the scene: {:?}", err); return PlayStateResult::Pop; } diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 234db82d4f..7e36d44543 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -24,6 +24,14 @@ use specs::{Join, WorldExt}; use std::{cell::RefCell, rc::Rc, time::Duration}; use vek::*; +/// The action to perform after a tick +enum TickAction { + // Continue executing + Continue, + // Disconnected (i.e. go to main menu) + Disconnect, +} + pub struct SessionState { scene: Scene, client: Rc>, @@ -33,14 +41,6 @@ pub struct SessionState { selected_block: Block, } -/// The action to perform after a tick -enum TickAction { - // Continue executing - Continue, - // Disconnected (i.e. go to main menu) - Disconnect, -} - /// Represents an active game session (i.e., the one being played). impl SessionState { /// Create a new `SessionState`. @@ -87,10 +87,7 @@ impl SessionState { } => { self.hud.new_message(event); }, - client::Event::Disconnect => { - log::warn!("disconnect"); - return Ok(TickAction::Disconnect); - }, + client::Event::Disconnect => return Ok(TickAction::Disconnect), client::Event::DisconnectionNotification(time) => { let message = match time { 0 => String::from("Goodbye!"), From fb4aba9bb7455d14b47ae7728f636b789d0bd91d Mon Sep 17 00:00:00 2001 From: Capucho Date: Sun, 8 Mar 2020 08:54:29 +0000 Subject: [PATCH 078/387] Fix the spam on disconnect --- client/src/lib.rs | 5 +---- common/src/msg/mod.rs | 1 - server/src/sys/message.rs | 9 +-------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index c44c787e6b..aa2447ce30 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -199,10 +199,7 @@ impl Client { } /// Send disconnect message to the server - pub fn request_logout(&mut self) { - self.postbox.send_message(ClientMsg::Disconnect); - self.client_state = ClientState::Disconnected; - } + pub fn request_logout(&mut self) { self.postbox.send_message(ClientMsg::Disconnect); } /// Request a state transition to `ClientState::Registered` from an ingame /// state. diff --git a/common/src/msg/mod.rs b/common/src/msg/mod.rs index 411763607f..1baee67e15 100644 --- a/common/src/msg/mod.rs +++ b/common/src/msg/mod.rs @@ -16,7 +16,6 @@ pub enum ClientState { Registered, Spectator, Character, - Disconnected, } pub const MAX_BYTES_CHAT_MSG: usize = 256; diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index b040b20a2d..d86101687e 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -91,7 +91,7 @@ impl<'a> System<'a> for Sys { || client.postbox.error().is_some() // Postbox error { - disconnect = true; + server_emitter.emit(ServerEvent::ClientDisconnect(entity)); } else if time - client.last_ping > CLIENT_TIMEOUT * 0.5 { // Try pinging the client if the timeout is nearing. client.postbox.send_message(ServerMsg::Ping); @@ -111,7 +111,6 @@ impl<'a> System<'a> for Sys { server_emitter.emit(ServerEvent::ExitIngame { entity }); }, ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, // Request spectator state ClientMsg::Spectate => match client.client_state { @@ -122,7 +121,6 @@ impl<'a> System<'a> for Sys { client.allow_state(ClientState::Spectator) }, ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, // Valid player ClientMsg::Register { player, password } if player.is_valid() => { @@ -189,7 +187,6 @@ impl<'a> System<'a> for Sys { }, ClientState::Character => client.error_state(RequestStateError::Already), ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, ClientMsg::ControllerInputs(inputs) => match client.client_state { ClientState::Connected @@ -203,7 +200,6 @@ impl<'a> System<'a> for Sys { } }, ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, ClientMsg::ControlEvent(event) => match client.client_state { ClientState::Connected @@ -217,7 +213,6 @@ impl<'a> System<'a> for Sys { } }, ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, ClientMsg::ChatMsg { message } => match client.client_state { ClientState::Connected => client.error_state(RequestStateError::Impossible), @@ -232,7 +227,6 @@ impl<'a> System<'a> for Sys { ), }, ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, ClientMsg::PlayerPhysics { pos, vel, ori } => match client.client_state { ClientState::Character => { @@ -273,7 +267,6 @@ impl<'a> System<'a> for Sys { } }, ClientState::Pending => {}, - ClientState::Disconnected => unreachable!(), }, // Always possible. ClientMsg::Ping => client.postbox.send_message(ServerMsg::Pong), From 1b9d1dc33391673ad0487a7d941e72dab18efacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Sun, 8 Mar 2020 13:05:38 +0100 Subject: [PATCH 079/387] update toolchain to `nightly-2020-03-05` --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index 47892367f9..be5bcdaf12 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-02-06 +nightly-2020-03-05 From 72b2334434478ba3a3117b7d227d95a2dd1bf95a Mon Sep 17 00:00:00 2001 From: Snow Date: Sun, 8 Mar 2020 15:07:47 +0000 Subject: [PATCH 080/387] more eagle adjustements --- assets/voxygen/voxel/bird_medium_center_manifest.ron | 8 ++++---- assets/voxygen/voxel/npc/eagle/female/tail.vox | 4 ++-- assets/voxygen/voxel/npc/eagle/female/torso.vox | 4 ++-- assets/voxygen/voxel/npc/eagle/male/tail.vox | 4 ++-- assets/voxygen/voxel/npc/eagle/male/torso.vox | 4 ++-- voxygen/src/anim/bird_medium/mod.rs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/assets/voxygen/voxel/bird_medium_center_manifest.ron b/assets/voxygen/voxel/bird_medium_center_manifest.ron index 10451e3827..6951c0e7af 100644 --- a/assets/voxygen/voxel/bird_medium_center_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_center_manifest.ron @@ -117,11 +117,11 @@ center: ("npc.eagle.female.head"), ), torso: ( - offset: (-3.0, -5.0, -4.5), + offset: (-3.0, -4.5, -4.5), center: ("npc.eagle.female.torso"), ), tail: ( - offset: (-2.0, -2.5, -2.5), + offset: (-2.0, -3.5, -3.5), center: ("npc.eagle.female.tail"), ) ), @@ -131,11 +131,11 @@ center: ("npc.eagle.female.head"), ), torso: ( - offset: (-3.0, -5.0, -4.5), + offset: (-3.0, -4.5, -4.5), center: ("npc.eagle.female.torso"), ), tail: ( - offset: (-2.0, -2.5, -2.5), + offset: (-2.0, -3.5, -3.5), center: ("npc.eagle.female.tail"), ) ), diff --git a/assets/voxygen/voxel/npc/eagle/female/tail.vox b/assets/voxygen/voxel/npc/eagle/female/tail.vox index be6931c740..f7bfb10410 100644 --- a/assets/voxygen/voxel/npc/eagle/female/tail.vox +++ b/assets/voxygen/voxel/npc/eagle/female/tail.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6691b2b369904e7682a044632d33d46f97055c7ac0d41d7872657608a546148c -size 55651 +oid sha256:10fe121790e8434a04bcfc1288693d8ac30171aa991a15e7533fcb62290e2368 +size 55675 diff --git a/assets/voxygen/voxel/npc/eagle/female/torso.vox b/assets/voxygen/voxel/npc/eagle/female/torso.vox index 01868dbddc..c299b03331 100644 --- a/assets/voxygen/voxel/npc/eagle/female/torso.vox +++ b/assets/voxygen/voxel/npc/eagle/female/torso.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c841accf87e906e10639ca045f218490bd07b6584a474afe88aac8c2f1018f7 -size 2168 +oid sha256:0f2df57bf231b5cdf34ce748f51394bc5fa67fff021244408babd2fbb40ce7f3 +size 56619 diff --git a/assets/voxygen/voxel/npc/eagle/male/tail.vox b/assets/voxygen/voxel/npc/eagle/male/tail.vox index be6931c740..f7bfb10410 100644 --- a/assets/voxygen/voxel/npc/eagle/male/tail.vox +++ b/assets/voxygen/voxel/npc/eagle/male/tail.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6691b2b369904e7682a044632d33d46f97055c7ac0d41d7872657608a546148c -size 55651 +oid sha256:10fe121790e8434a04bcfc1288693d8ac30171aa991a15e7533fcb62290e2368 +size 55675 diff --git a/assets/voxygen/voxel/npc/eagle/male/torso.vox b/assets/voxygen/voxel/npc/eagle/male/torso.vox index 01868dbddc..c299b03331 100644 --- a/assets/voxygen/voxel/npc/eagle/male/torso.vox +++ b/assets/voxygen/voxel/npc/eagle/male/torso.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c841accf87e906e10639ca045f218490bd07b6584a474afe88aac8c2f1018f7 -size 2168 +oid sha256:0f2df57bf231b5cdf34ce748f51394bc5fa67fff021244408babd2fbb40ce7f3 +size 56619 diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index a3ac5dc4a7..8e15bdaef2 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/mod.rs @@ -117,14 +117,14 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Chicken, _) => (-3.0, 1.5), (Goose, _) => (-5.0, 3.0), (Peacock, _) => (-5.5, 2.0), - (Eagle, _) => (-4.5, -5.0), + (Eagle, _) => (-8.0, -4.0), }, wing: match (body.species, body.body_type) { (Duck, _) => (2.75, 0.0, 6.0), (Chicken, _) => (2.75, 0.0, 6.0), (Goose, _) => (3.75, -1.0, 9.0), (Peacock, _) => (3.0, 0.0, 9.0), - (Eagle, _) => (3.0, -8.0, 4.0), + (Eagle, _) => (3.0, -8.0, 5.0), }, foot: match (body.species, body.body_type) { (Duck, _) => (2.0, -1.5, 4.0), From adf34d4f0fe5a3038e2ffc7b400d53f3fd48bf61 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 8 Mar 2020 08:38:53 -0700 Subject: [PATCH 081/387] User constants, faster characters --- common/src/states/utils.rs | 44 +++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index a4e75c7cda..0f936efddc 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -6,8 +6,25 @@ use crate::{ use std::time::Duration; use vek::vec::{Vec2, Vec3}; -const HUMANOID_WATER_ACCEL: f32 = 70.0; -const HUMANOID_WATER_SPEED: f32 = 120.0; +const BASE_HUMANOID_ACCEL: f32 = 100.0; +const BASE_HUMANOID_SPEED: f32 = 150.0; +const BASE_HUMANOID_AIR_ACCEL: f32 = 15.0; +const BASE_HUMANOID_AIR_SPEED: f32 = 8.0; +const BASE_HUMANOID_WATER_ACCEL: f32 = 70.0; +const BASE_HUMANOID_WATER_SPEED: f32 = 120.0; +// const BASE_HUMANOID_CLIMB_ACCEL: f32 = 10.0; +// const ROLL_SPEED: f32 = 17.0; +// const CHARGE_SPEED: f32 = 20.0; +// const GLIDE_ACCEL: f32 = 15.0; +// const GLIDE_SPEED: f32 = 45.0; +// const BLOCK_ACCEL: f32 = 30.0; +// const BLOCK_SPEED: f32 = 75.0; +// // Gravity is 9.81 * 4, so this makes gravity equal to .15 +// const GLIDE_ANTIGRAV: f32 = GRAVITY * 0.96; +// const CLIMB_SPEED: f32 = 5.0; +// const CLIMB_COST: i32 = 5; + +pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; pub fn handle_move(data: &JoinData, update: &mut StateUpdate) { if data.physics.in_fluid { @@ -19,13 +36,9 @@ pub fn handle_move(data: &JoinData, update: &mut StateUpdate) { fn ground_move(data: &JoinData, update: &mut StateUpdate) { let (accel, speed): (f32, f32) = if data.physics.on_ground { - let accel = 100.0; - let speed = 9.0; - (accel, speed) + (BASE_HUMANOID_ACCEL, BASE_HUMANOID_SPEED) } else { - let accel = 100.0; - let speed = 8.0; - (accel, speed) + (BASE_HUMANOID_AIR_ACCEL, BASE_HUMANOID_AIR_SPEED) }; // Move player according to move_dir @@ -60,8 +73,8 @@ fn swim_move(data: &JoinData, update: &mut StateUpdate) { // Update velocity update.vel.0 += Vec2::broadcast(data.dt.0) * data.inputs.move_dir - * if update.vel.0.magnitude_squared() < HUMANOID_WATER_SPEED.powf(2.0) { - HUMANOID_WATER_ACCEL + * if update.vel.0.magnitude_squared() < BASE_HUMANOID_WATER_SPEED.powf(2.0) { + BASE_HUMANOID_WATER_ACCEL } else { 0.0 }; @@ -87,7 +100,8 @@ fn swim_move(data: &JoinData, update: &mut StateUpdate) { // Force players to pulse jump button to swim up if data.inputs.jump.is_pressed() && !data.inputs.jump.is_long_press(Duration::from_millis(600)) { - update.vel.0.z = (update.vel.0.z + data.dt.0 * GRAVITY * 1.25).min(HUMANOID_WATER_SPEED); + update.vel.0.z = + (update.vel.0.z + data.dt.0 * GRAVITY * 1.25).min(BASE_HUMANOID_WATER_SPEED); } } @@ -146,22 +160,22 @@ pub fn handle_jump(data: &JoinData, update: &mut StateUpdate) { } pub fn handle_primary(data: &JoinData, update: &mut StateUpdate) { - if let Some(state) = data.ability_pool.primary { + if let Some(ability_state) = data.ability_pool.primary { if let CharacterState::Wielding { .. } = update.character { if data.inputs.primary.is_pressed() { // data.updater.insert(data.entity, state); - update.character = character_state_from_ability(data, state); + update.character = character_state_from_ability(data, ability_state); } } } } pub fn handle_secondary(data: &JoinData, update: &mut StateUpdate) { - if let Some(state) = data.ability_pool.secondary { + if let Some(ability_state) = data.ability_pool.secondary { if let CharacterState::Wielding { .. } = update.character { if data.inputs.secondary.is_pressed() { // data.updater.insert(data.entity, state); - update.character = character_state_from_ability(data, state); + update.character = character_state_from_ability(data, ability_state); } } } From f769c74bf4d1cc04160090a5768231262f3abf4b Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 8 Mar 2020 10:04:26 -0700 Subject: [PATCH 082/387] Add charging back --- common/src/comp/ability.rs | 3 +- common/src/comp/character_state.rs | 7 ++- common/src/states/basic_block.rs | 9 +--- common/src/states/charge_attack.rs | 79 ++++++++++++++-------------- common/src/states/mod.rs | 1 + common/src/states/utils.rs | 26 ++++++--- common/src/states/wielding.rs | 30 +++++------ common/src/sys/character_behavior.rs | 1 + 8 files changed, 83 insertions(+), 73 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 9210ee6b02..05fadd2ab4 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -5,6 +5,7 @@ pub enum AbilityState { BasicAttack, BasicBlock, Roll, + ChargeAttack, } impl Default for AbilityState { fn default() -> Self { Self::BasicAttack } @@ -26,7 +27,7 @@ impl Default for AbilityPool { fn default() -> Self { Self { primary: Some(AbilityState::BasicAttack), - secondary: Some(AbilityState::BasicBlock), + secondary: Some(AbilityState::ChargeAttack), block: None, dodge: Some(AbilityState::Roll), } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index bdabd39759..4726226ec1 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -42,7 +42,10 @@ pub enum CharacterState { }, /// A basic blocking state BasicBlock {}, - //Charge{}, + ChargeAttack { + /// How long the state has until exiting + remaining_duration: Duration, + }, Roll { /// How long the state has until exiting remaining_duration: Duration, @@ -61,7 +64,7 @@ impl CharacterState { pub fn is_attack(&self) -> bool { match self { - CharacterState::BasicAttack { .. } => true, + CharacterState::BasicAttack { .. } | CharacterState::ChargeAttack { .. } => true, _ => false, } } diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index 8c5444b6bf..09f827d432 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -22,14 +22,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate { handle_move(&data, &mut update); if !data.physics.on_ground || !data.inputs.secondary.is_pressed() { - if let Some(ItemKind::Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { - update.character = CharacterState::Equipping { - tool, - time_left: tool.equip_time(), - }; - } else { - update.character = CharacterState::Idle {}; - }; + attempt_wield(data, &mut update); } update } diff --git a/common/src/states/charge_attack.rs b/common/src/states/charge_attack.rs index 82e229de78..7958885a4e 100644 --- a/common/src/states/charge_attack.rs +++ b/common/src/states/charge_attack.rs @@ -1,13 +1,10 @@ use super::utils::*; use crate::{ - comp::{ - ActionState::Attack, AttackKind::Charge, CharacterEntityData, HealthChange, HealthSource, - ItemKind::Tool, MoveState::Run, StateUpdate, ToolData, - }, + comp::{CharacterState::*, HealthChange, HealthSource, StateUpdate}, event::ServerEvent, sys::character_behavior::JoinData, }; -use std::time::Duration; +use std::{collections::VecDeque, time::Duration}; use vek::Vec3; const CHARGE_SPEED: f32 = 20.0; @@ -18,45 +15,49 @@ pub fn behavior(data: &JoinData) -> StateUpdate { vel: *data.vel, ori: *data.ori, character: *data.character, + energy: *data.energy, + local_events: VecDeque::new(), + server_events: VecDeque::new(), }; - // Move player - update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) - + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) - + 1.5 * data.inputs.move_dir.try_normalized().unwrap_or_default()) - .try_normalized() - .unwrap_or_default() - * CHARGE_SPEED; + if let ChargeAttack { remaining_duration } = data.character { + // Move player + update.vel.0 = Vec3::new(0.0, 0.0, update.vel.0.z) + + (update.vel.0 * Vec3::new(1.0, 1.0, 0.0) + + 1.5 * data.inputs.move_dir.try_normalized().unwrap_or_default()) + .try_normalized() + .unwrap_or_default() + * CHARGE_SPEED; - // Check if hitting another entity - if let Some(uid_b) = data.physics.touch_entity { - // Send Damage event - data.server_bus.emitter().emit(ServerEvent::Damage { - uid: uid_b, - change: HealthChange { - amount: -20, - cause: HealthSource::Attack { by: *data.uid }, - }, - }); + // Check if hitting another entity + if let Some(uid_b) = data.physics.touch_entity { + // Send Damage event + update.server_events.push_front(ServerEvent::Damage { + uid: uid_b, + change: HealthChange { + amount: -20, + cause: HealthSource::Attack { by: *data.uid }, + }, + }); - // Go back to wielding or idling - update.character.action_state = attempt_wield(data.stats); - return update; + // Go back to wielding or idling + attempt_wield(data, &mut update); + return update; + } + + // Check if charge timed out or can't keep moving forward + if *remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { + attempt_wield(data, &mut update); + return update; + } + + // Tick remaining-duration and keep charging + update.character = ChargeAttack { + remaining_duration: remaining_duration + .checked_sub(Duration::from_secs_f32(data.dt.0)) + .unwrap_or_default(), + }; } - // Check if charge timed out or can't keep moving forward - if self.remaining_duration == Duration::default() || update.vel.0.magnitude_squared() < 10.0 { - update.character.action_state = attempt_wield(data.stats); - return update; - } - - // Tick remaining-duration and keep charging - update.character.action_state = Attack(Charge(Some(State { - remaining_duration: self - .remaining_duration - .checked_sub(Duration::from_secs_f32(data.dt.0)) - .unwrap_or_default(), - }))); - update } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 2375e7d586..5f48ad7367 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -1,6 +1,7 @@ // Module declarations pub mod basic_attack; pub mod basic_block; +pub mod charge_attack; pub mod climb; pub mod equipping; pub mod glide; diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 0f936efddc..2de02e1454 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -105,19 +105,26 @@ fn swim_move(data: &JoinData, update: &mut StateUpdate) { } } +/// First checks whether `primary` input is pressed, then +/// attempts to go into Equipping state, otherwise Idle pub fn handle_wield(data: &JoinData, update: &mut StateUpdate) { if data.inputs.primary.is_pressed() { - if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { - update.character = CharacterState::Equipping { - tool, - time_left: tool.equip_time(), - }; - } else { - update.character = CharacterState::Idle {}; - }; + attempt_wield(data, update); } } +/// If a tool is equipped, goes into Equipping state, otherwise goes to Idle +pub fn attempt_wield(data: &JoinData, update: &mut StateUpdate) { + if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { + update.character = CharacterState::Equipping { + tool, + time_left: tool.equip_time(), + }; + } else { + update.character = CharacterState::Idle {}; + }; +} + pub fn handle_sit(data: &JoinData, update: &mut StateUpdate) { if data.inputs.sit.is_pressed() && data.physics.on_ground && data.body.is_humanoid() { update.character = CharacterState::Sit {}; @@ -226,5 +233,8 @@ pub fn character_state_from_ability( AbilityState::Roll { .. } => CharacterState::Roll { remaining_duration: Duration::from_millis(600), }, + AbilityState::ChargeAttack { .. } => CharacterState::ChargeAttack { + remaining_duration: Duration::from_millis(600), + }, } } diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index 1edc0bf78c..43fe8c297d 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -2,26 +2,26 @@ use super::utils::*; use crate::{comp::StateUpdate, sys::character_behavior::JoinData}; use std::collections::VecDeque; -pub fn behavior(ecs_data: &JoinData) -> StateUpdate { +pub fn behavior(data: &JoinData) -> StateUpdate { let mut update = StateUpdate { - character: *ecs_data.character, - pos: *ecs_data.pos, - vel: *ecs_data.vel, - ori: *ecs_data.ori, - energy: *ecs_data.energy, + character: *data.character, + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, local_events: VecDeque::new(), server_events: VecDeque::new(), }; - handle_move(&ecs_data, &mut update); - handle_jump(&ecs_data, &mut update); - handle_sit(&ecs_data, &mut update); - handle_climb(&ecs_data, &mut update); - handle_glide(&ecs_data, &mut update); - handle_unwield(&ecs_data, &mut update); - handle_primary(&ecs_data, &mut update); - handle_secondary(&ecs_data, &mut update); - handle_dodge(&ecs_data, &mut update); + handle_move(&data, &mut update); + handle_jump(&data, &mut update); + handle_sit(&data, &mut update); + handle_climb(&data, &mut update); + handle_glide(&data, &mut update); + handle_unwield(&data, &mut update); + handle_primary(&data, &mut update); + handle_secondary(&data, &mut update); + handle_dodge(&data, &mut update); update } diff --git a/common/src/sys/character_behavior.rs b/common/src/sys/character_behavior.rs index 1179a3c196..89034ace4d 100644 --- a/common/src/sys/character_behavior.rs +++ b/common/src/sys/character_behavior.rs @@ -169,6 +169,7 @@ impl<'a> System<'a> for Sys { CharacterState::Equipping { .. } => states::equipping::behavior(&j), CharacterState::BasicAttack { .. } => states::basic_attack::behavior(&j), CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j), + CharacterState::ChargeAttack { .. } => states::charge_attack::behavior(&j), CharacterState::Sit { .. } => states::sit::behavior(&j), // _ => StateUpdate { From 698fe9f45186baa1514f191a254ced971d0cd22a Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 8 Mar 2020 10:38:18 -0700 Subject: [PATCH 083/387] More util fn's, add comments --- common/src/states/utils.rs | 99 +++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 40 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 2de02e1454..3611b6c3b8 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -26,15 +26,17 @@ const BASE_HUMANOID_WATER_SPEED: f32 = 120.0; pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; +/// Handles updating `Components` to move player based on state of `JoinData` pub fn handle_move(data: &JoinData, update: &mut StateUpdate) { if data.physics.in_fluid { swim_move(data, update); } else { - ground_move(data, update); + basic_move(data, update); } } -fn ground_move(data: &JoinData, update: &mut StateUpdate) { +/// Updates components to move player as if theyre on ground or in air +fn basic_move(data: &JoinData, update: &mut StateUpdate) { let (accel, speed): (f32, f32) = if data.physics.on_ground { (BASE_HUMANOID_ACCEL, BASE_HUMANOID_SPEED) } else { @@ -69,6 +71,7 @@ fn ground_move(data: &JoinData, update: &mut StateUpdate) { } } +/// Updates components to move player as if theyre swimming fn swim_move(data: &JoinData, update: &mut StateUpdate) { // Update velocity update.vel.0 += Vec2::broadcast(data.dt.0) @@ -125,12 +128,14 @@ pub fn attempt_wield(data: &JoinData, update: &mut StateUpdate) { }; } +/// Checks that player can `Sit` and updates `CharacterState` if so pub fn handle_sit(data: &JoinData, update: &mut StateUpdate) { if data.inputs.sit.is_pressed() && data.physics.on_ground && data.body.is_humanoid() { update.character = CharacterState::Sit {}; } } +/// Checks that player can `Climb` and updates `CharacterState` if so pub fn handle_climb(data: &JoinData, update: &mut StateUpdate) { if (data.inputs.climb.is_pressed() || data.inputs.climb_down.is_pressed()) && data.physics.on_wall.is_some() @@ -142,6 +147,7 @@ pub fn handle_climb(data: &JoinData, update: &mut StateUpdate) { } } +/// Checks that player can `Glide` and updates `CharacterState` if so pub fn handle_unwield(data: &JoinData, update: &mut StateUpdate) { if let CharacterState::Wielding { .. } = update.character { if data.inputs.toggle_wield.is_pressed() { @@ -150,6 +156,7 @@ pub fn handle_unwield(data: &JoinData, update: &mut StateUpdate) { } } +/// Checks that player can glide and updates `CharacterState` if so pub fn handle_glide(data: &JoinData, update: &mut StateUpdate) { if let CharacterState::Idle { .. } | CharacterState::Wielding { .. } = update.character { if data.inputs.glide.is_pressed() && !data.physics.on_ground && data.body.is_humanoid() { @@ -158,6 +165,7 @@ pub fn handle_glide(data: &JoinData, update: &mut StateUpdate) { } } +/// Checks that player can jump and sends jump event if so pub fn handle_jump(data: &JoinData, update: &mut StateUpdate) { if data.inputs.jump.is_pressed() && data.physics.on_ground { update @@ -166,58 +174,69 @@ pub fn handle_jump(data: &JoinData, update: &mut StateUpdate) { } } -pub fn handle_primary(data: &JoinData, update: &mut StateUpdate) { +/// If `inputs.primary` is pressed and in `Wielding` state, +/// will attempt to go into `ability_pool.primary` +pub fn handle_primary_input(data: &JoinData, update: &mut StateUpdate) { + if data.inputs.primary.is_pressed() { + if let CharacterState::Wielding { .. } = update.character { + attempt_primary_ability(data, update); + } + } +} + +/// Attempts to go into `ability_pool.primary` if is `Some()` on `AbilityPool` +pub fn attempt_primary_ability(data: &JoinData, update: &mut StateUpdate) { if let Some(ability_state) = data.ability_pool.primary { + update.character = ability_to_character_state(data, ability_state); + } +} + +/// If `inputs.secondary` is pressed and in `Wielding` state, +/// will attempt to go into `ability_pool.secondary` +pub fn handle_secondary_input(data: &JoinData, update: &mut StateUpdate) { + if data.inputs.secondary.is_pressed() { if let CharacterState::Wielding { .. } = update.character { - if data.inputs.primary.is_pressed() { - // data.updater.insert(data.entity, state); - update.character = character_state_from_ability(data, ability_state); - } + attempt_seconday_ability(data, update); } } } -pub fn handle_secondary(data: &JoinData, update: &mut StateUpdate) { +/// Attempts to go into `ability_pool.secondary` if is `Some()` on `AbilityPool` +pub fn attempt_seconday_ability(data: &JoinData, update: &mut StateUpdate) { if let Some(ability_state) = data.ability_pool.secondary { - if let CharacterState::Wielding { .. } = update.character { - if data.inputs.secondary.is_pressed() { - // data.updater.insert(data.entity, state); - update.character = character_state_from_ability(data, ability_state); - } + update.character = ability_to_character_state(data, ability_state); + } +} + +/// Checks that player can perform a dodge, then +/// attempts to go into `ability_pool.dodge` +pub fn handle_dodge_input(data: &JoinData, update: &mut StateUpdate) { + if let CharacterState::Idle { .. } | CharacterState::Wielding { .. } = update.character { + if data.inputs.roll.is_pressed() + && data.physics.on_ground + && data.body.is_humanoid() + && update + .energy + .try_change_by(-200, EnergySource::Roll) + .is_ok() + { + attempt_dodge_ability(data, update); } } } -pub fn handle_dodge(data: &JoinData, update: &mut StateUpdate) { - if let Some(state) = data.ability_pool.dodge { - if let CharacterState::Idle { .. } | CharacterState::Wielding { .. } = update.character { - if data.inputs.roll.is_pressed() - && data.physics.on_ground - && data.body.is_humanoid() - && update - .energy - .try_change_by(-200, EnergySource::Roll) - .is_ok() - { - // let tool_data = - // if let Some(Tool(data)) = data.stats.equipment.main.as_ref().map(|i| - // i.kind) { data - // } else { - // ToolData::default() - // }; - update.character = CharacterState::Roll { - remaining_duration: Duration::from_millis(600), // tool_data.attack_duration(), - }; - data.updater.insert(data.entity, state); - } - } +pub fn attempt_dodge_ability(data: &JoinData, update: &mut StateUpdate) { + if let Some(ability_state) = data.ability_pool.dodge { + update.character = ability_to_character_state(data, ability_state); } } -pub fn character_state_from_ability( - data: &JoinData, - ability_state: AbilityState, -) -> CharacterState { +// TODO: This might need a CharacterState::new(data, update) fn if +// initialization gets too lengthy. + +/// Maps from `AbilityState`s to `CharacterStates`s. Also handles intializing +/// the new `CharacterState` +pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) -> CharacterState { match ability_state { AbilityState::BasicAttack { .. } => { if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { From fe1feebeb215e48c328edd9b2030b7f52b642bc1 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 8 Mar 2020 10:38:40 -0700 Subject: [PATCH 084/387] Renaming fn's --- common/src/states/idle.rs | 2 +- common/src/states/wielding.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index c2df18be36..df13129a2a 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -18,7 +18,7 @@ pub fn behavior(data: &JoinData) -> StateUpdate { handle_sit(data, &mut update); handle_climb(data, &mut update); handle_glide(data, &mut update); - handle_dodge(data, &mut update); + handle_dodge_input(data, &mut update); update } diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index 43fe8c297d..e9b30a77d0 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -19,9 +19,9 @@ pub fn behavior(data: &JoinData) -> StateUpdate { handle_climb(&data, &mut update); handle_glide(&data, &mut update); handle_unwield(&data, &mut update); - handle_primary(&data, &mut update); - handle_secondary(&data, &mut update); - handle_dodge(&data, &mut update); + handle_primary_input(&data, &mut update); + handle_secondary_input(&data, &mut update); + handle_dodge_input(&data, &mut update); update } From 5f8751e2d388e7c1635da673f4ed390459b4bee8 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 8 Mar 2020 12:37:17 -0700 Subject: [PATCH 085/387] Begin implementing triple attack --- common/src/comp/ability.rs | 4 +- common/src/comp/character_state.rs | 14 ++++ common/src/states/basic_block.rs | 5 +- common/src/states/mod.rs | 1 + common/src/states/triple_attack/mod.rs | 92 ++++++++++++++++++++++++++ common/src/states/utils.rs | 35 ++++++++-- common/src/sys/character_behavior.rs | 2 + 7 files changed, 142 insertions(+), 11 deletions(-) create mode 100644 common/src/states/triple_attack/mod.rs diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 05fadd2ab4..a6f9b41eef 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -6,6 +6,7 @@ pub enum AbilityState { BasicBlock, Roll, ChargeAttack, + TripleAttack, } impl Default for AbilityState { fn default() -> Self { Self::BasicAttack } @@ -27,7 +28,8 @@ impl Default for AbilityPool { fn default() -> Self { Self { primary: Some(AbilityState::BasicAttack), - secondary: Some(AbilityState::ChargeAttack), + // primary: Some(AbilityState::TripleAttack), + secondary: Some(AbilityState::BasicBlock), block: None, dodge: Some(AbilityState::Roll), } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 4726226ec1..5486366afb 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -50,6 +50,20 @@ pub enum CharacterState { /// How long the state has until exiting remaining_duration: Duration, }, + /// A three-stage attack where play must click at appropriate times + /// to continue attack chain. + TripleAttack { + /// The tool this state will read to handle damage, etc. + tool: ToolData, + /// `int` denoting what stage (of 3) the attack is in. + stage: i8, + /// How long current stage has been active + stage_time_active: Duration, + /// Whether current stage has exhausted its attack + stage_exhausted: bool, + /// Whether player has clicked at the proper time to go to next stage + can_transition: bool, + }, } impl CharacterState { diff --git a/common/src/states/basic_block.rs b/common/src/states/basic_block.rs index 09f827d432..912707d954 100644 --- a/common/src/states/basic_block.rs +++ b/common/src/states/basic_block.rs @@ -1,8 +1,5 @@ use super::utils::*; -use crate::{ - comp::{CharacterState, ItemKind, StateUpdate}, - sys::character_behavior::JoinData, -}; +use crate::{comp::StateUpdate, sys::character_behavior::JoinData}; use std::collections::VecDeque; // const BLOCK_ACCEL: f32 = 30.0; diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 5f48ad7367..530679e37a 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -8,5 +8,6 @@ pub mod glide; pub mod idle; pub mod roll; pub mod sit; +pub mod triple_attack; pub mod utils; pub mod wielding; diff --git a/common/src/states/triple_attack/mod.rs b/common/src/states/triple_attack/mod.rs new file mode 100644 index 0000000000..dfeaa5c260 --- /dev/null +++ b/common/src/states/triple_attack/mod.rs @@ -0,0 +1,92 @@ +use crate::{ + comp::{Attacking, CharacterState, ItemKind::Tool, StateUpdate}, + states::utils::*, + sys::character_behavior::JoinData, +}; +use std::{collections::VecDeque, time::Duration}; + +pub fn behavior(data: &JoinData) -> StateUpdate { + let mut update = StateUpdate { + pos: *data.pos, + vel: *data.vel, + ori: *data.ori, + energy: *data.energy, + character: *data.character, + local_events: VecDeque::new(), + server_events: VecDeque::new(), + }; + + if let CharacterState::TripleAttack { + tool, + stage, + stage_time_active, + stage_exhausted, + can_transition, + } = data.character + { + let mut new_can_transition = *can_transition; + let mut new_stage_exhausted = *stage_exhausted; + let new_stage_time_active = stage_time_active + .checked_add(Duration::from_secs_f32(data.dt.0)) + .unwrap_or(Duration::default()); + + match stage { + 1 => { + if new_stage_time_active > tool.attack_buildup_duration() { + if !*stage_exhausted { + // Try to deal damage + data.updater.insert(data.entity, Attacking { + weapon: Some(*tool), + }); + new_stage_exhausted = true; + } else { + // Make sure to remove Attacking component + data.updater.remove::(data.entity); + } + + // Check if player has timed click right + if data.inputs.primary.is_just_pressed() { + println!("Can transition"); + new_can_transition = true; + } + } + + if new_stage_time_active > tool.attack_duration() { + if new_can_transition { + update.character = CharacterState::TripleAttack { + tool: *tool, + stage: 2, + stage_time_active: Duration::default(), + stage_exhausted: false, + can_transition: false, + } + } else { + println!("Failed"); + attempt_wield(data, &mut update); + } + } else { + update.character = CharacterState::TripleAttack { + tool: *tool, + stage: 1, + stage_time_active: new_stage_time_active, + stage_exhausted: new_stage_exhausted, + can_transition: new_can_transition, + } + } + }, + 2 => { + println!("2"); + attempt_wield(data, &mut update); + }, + 3 => { + println!("3"); + attempt_wield(data, &mut update); + }, + _ => { + // Should never get here. + }, + } + } + + update +} diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 3611b6c3b8..4beffc9d6d 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,11 +1,12 @@ use crate::{ - comp::{AbilityState, CharacterState, EnergySource, ItemKind::Tool, StateUpdate}, + comp::{AbilityState, CharacterState, EnergySource, ItemKind::Tool, StateUpdate, ToolData}, event::LocalEvent, sys::{character_behavior::JoinData, phys::GRAVITY}, }; use std::time::Duration; use vek::vec::{Vec2, Vec3}; +pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; const BASE_HUMANOID_ACCEL: f32 = 100.0; const BASE_HUMANOID_SPEED: f32 = 150.0; const BASE_HUMANOID_AIR_ACCEL: f32 = 15.0; @@ -24,8 +25,6 @@ const BASE_HUMANOID_WATER_SPEED: f32 = 120.0; // const CLIMB_SPEED: f32 = 5.0; // const CLIMB_COST: i32 = 5; -pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0; - /// Handles updating `Components` to move player based on state of `JoinData` pub fn handle_move(data: &JoinData, update: &mut StateUpdate) { if data.physics.in_fluid { @@ -231,7 +230,7 @@ pub fn attempt_dodge_ability(data: &JoinData, update: &mut StateUpdate) { } } -// TODO: This might need a CharacterState::new(data, update) fn if +// TODO: Wight need a fn `CharacterState::new(data, update)` if // initialization gets too lengthy. /// Maps from `AbilityState`s to `CharacterStates`s. Also handles intializing @@ -239,13 +238,13 @@ pub fn attempt_dodge_ability(data: &JoinData, update: &mut StateUpdate) { pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) -> CharacterState { match ability_state { AbilityState::BasicAttack { .. } => { - if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { + if let Some(tool) = get_tool_data(data) { CharacterState::BasicAttack { exhausted: false, remaining_duration: tool.attack_duration(), } } else { - CharacterState::Idle {} + *data.character } }, AbilityState::BasicBlock { .. } => CharacterState::BasicBlock {}, @@ -255,5 +254,29 @@ pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) AbilityState::ChargeAttack { .. } => CharacterState::ChargeAttack { remaining_duration: Duration::from_millis(600), }, + AbilityState::TripleAttack { .. } => { + if let Some(tool) = get_tool_data(data) { + CharacterState::TripleAttack { + tool, + stage: 1, + stage_time_active: Duration::default(), + stage_exhausted: false, + can_transition: false, + } + } else { + *data.character + } + }, + + // Do not use default match + // _ => *data.character + } +} + +pub fn get_tool_data(data: &JoinData) -> Option { + if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { + Some(tool) + } else { + None } } diff --git a/common/src/sys/character_behavior.rs b/common/src/sys/character_behavior.rs index 89034ace4d..01cf463c62 100644 --- a/common/src/sys/character_behavior.rs +++ b/common/src/sys/character_behavior.rs @@ -171,7 +171,9 @@ impl<'a> System<'a> for Sys { CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j), CharacterState::ChargeAttack { .. } => states::charge_attack::behavior(&j), CharacterState::Sit { .. } => states::sit::behavior(&j), + CharacterState::TripleAttack { .. } => states::triple_attack::behavior(&j), + // Do not use default match. // _ => StateUpdate { // character: *j.character, // pos: *j.pos, From a391f2e0f299aff0d00259a1b8fe637686721d5f Mon Sep 17 00:00:00 2001 From: Capucho Date: Sun, 8 Mar 2020 20:31:27 +0000 Subject: [PATCH 086/387] Switch states instead of popping --- client/src/lib.rs | 8 -------- voxygen/src/menu/char_selection/mod.rs | 7 +------ voxygen/src/session.rs | 8 ++++++++ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index aa2447ce30..e071c566e5 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -77,8 +77,6 @@ pub struct Client { loaded_distance: f32, pending_chunks: HashMap, Instant>, - - disconnected: bool, } impl Client { @@ -165,8 +163,6 @@ impl Client { loaded_distance: 0.0, pending_chunks: HashMap::new(), - - disconnected: false, }) } @@ -703,7 +699,6 @@ impl Client { ); }, ServerMsg::Disconnect => { - self.disconnected = true; frontend_events.push(Event::Disconnect); self.postbox.send_message(ClientMsg::Terminate); }, @@ -718,9 +713,6 @@ impl Client { Ok(frontend_events) } - // Get's whether or not the client just disconnected - pub fn disconnected(&self) -> bool { self.disconnected } - /// Get the player's entity. pub fn entity(&self) -> EcsEntity { self.entity } diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 0931126e37..23b43d7eb9 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -39,11 +39,6 @@ impl PlayState for CharSelectionState { // Set up an fps clock. let mut clock = Clock::start(); - // Check if we just disconnected, if so go to main menu - if self.client.borrow().disconnected() { - return PlayStateResult::Pop; - } - let mut current_client_state = self.client.borrow().get_client_state(); while let ClientState::Pending | ClientState::Registered = current_client_state { // Handle window events @@ -83,7 +78,7 @@ impl PlayState for CharSelectionState { char_data.body, char_data.tool, ); - return PlayStateResult::Push(Box::new(SessionState::new( + return PlayStateResult::Switch(Box::new(SessionState::new( global_state, self.client.clone(), ))); diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 7e36d44543..c6de6e40e0 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -3,6 +3,7 @@ use crate::{ hud::{DebugInfo, Event as HudEvent, Hud}, i18n::{i18n_asset_key, VoxygenLocalization}, key_state::KeyState, + menu::char_selection::CharSelectionState, render::Renderer, scene::{camera, Scene, SceneData}, window::{Event, GameInput}, @@ -680,6 +681,13 @@ impl PlayState for SessionState { current_client_state = self.client.borrow().get_client_state(); } + if let ClientState::Registered = current_client_state { + return PlayStateResult::Switch(Box::new(CharSelectionState::new( + global_state, + self.client.clone(), + ))); + } + PlayStateResult::Pop } From bce9d4c24f32be08e4dc6fa4abf5e79c9f3e9369 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sun, 8 Mar 2020 17:02:25 -0400 Subject: [PATCH 087/387] animation corrections --- common/src/states/utils.rs | 2 +- voxygen/src/anim/character/attack.rs | 5 +++-- voxygen/src/anim/character/block.rs | 7 +++++++ voxygen/src/anim/character/blockidle.rs | 7 +++++++ voxygen/src/anim/character/wield.rs | 25 +++++++++++-------------- voxygen/src/scene/figure/mod.rs | 4 ++-- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 4beffc9d6d..b8d5656db5 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -256,7 +256,7 @@ pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) }, AbilityState::TripleAttack { .. } => { if let Some(tool) = get_tool_data(data) { - CharacterState::TripleAttack { + CharacterState::TripleAttack { tool, stage: 1, stage_time_active: Duration::default(), diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index 8e376c6f7b..bdb84ef253 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -16,9 +16,10 @@ impl Animation for AttackAnimation { skeleton: &Self::Skeleton, (active_tool_kind, _global_time): Self::Dependency, anim_time: f64, - _rate: &mut f32, + rate: &mut f32, skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { + *rate = 1.0; let mut next = (*skeleton).clone(); let lab = 1.0; @@ -270,7 +271,7 @@ impl Animation for AttackAnimation { next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler; + next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; diff --git a/voxygen/src/anim/character/block.rs b/voxygen/src/anim/character/block.rs index 62195f3853..4ed5e7d542 100644 --- a/voxygen/src/anim/character/block.rs +++ b/voxygen/src/anim/character/block.rs @@ -274,6 +274,13 @@ impl Animation for BlockAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/blockidle.rs b/voxygen/src/anim/character/blockidle.rs index 8e7ec674e3..aa035383ac 100644 --- a/voxygen/src/anim/character/blockidle.rs +++ b/voxygen/src/anim/character/blockidle.rs @@ -273,6 +273,13 @@ impl Animation for BlockIdleAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; + next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.l_control.ori = Quaternion::rotation_x(0.0); + next.l_control.scale = Vec3::one(); + + next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); + next.r_control.ori = Quaternion::rotation_x(0.0); + next.r_control.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 2efe46c798..c050e7e03a 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -12,37 +12,33 @@ impl Animation for WieldAnimation { fn update_skeleton( skeleton: &Self::Skeleton, - (active_tool_kind, velocity, _global_time): Self::Dependency, + (active_tool_kind, _velocity, _global_time): Self::Dependency, anim_time: f64, - rate: &mut f32, + _rate: &mut f32, skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); - *rate = speed; - let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); let wave = (anim_time as f32 * 1.0).sin(); - let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); match active_tool_kind { //TODO: Inventory Some(ToolKind::Sword(_)) => { - next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0); - next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.offset = Vec3::new(-0.25, -5.0, -5.0); + next.l_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2); next.l_hand.scale = Vec3::one() * 1.04; - next.r_hand.offset = Vec3::new(0.0, -6.0, -8.0); - next.r_hand.ori = Quaternion::rotation_x(1.27); + next.r_hand.offset = Vec3::new(1.25, -5.5, -8.0); + next.r_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3); next.r_hand.scale = Vec3::one() * 1.05; next.main.offset = Vec3::new(0.0, 0.0, -6.0); - next.main.ori = Quaternion::rotation_x(-0.3) + next.main.ori = Quaternion::rotation_x(-0.1) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); - next.control.offset = Vec3::new(-8.0, 4.0, 6.0); + next.control.offset = Vec3::new(-7.0, 6.0, 6.0); next.control.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); @@ -199,8 +195,9 @@ impl Animation for WieldAnimation { }, _ => {}, } - next.torso.offset = Vec3::new(0.0, 0.3 + wave * -0.08, 0.4) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_x(wave_stop * -0.2); + + next.torso.offset = Vec3::new(0.0, 0.0 + wave * -0.08, 0.1) * skeleton_attr.scaler; + next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 1bcfd294c4..dbefe7492a 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -408,8 +408,8 @@ impl FigureMgr { let target_base = match ( physics.on_ground, - vel.0.magnitude_squared() > 0.001, // Moving - physics.in_fluid, // In water + vel.0.magnitude_squared() > 0.5, // Moving + physics.in_fluid, // In water ) { // Standing (true, false, false) => anim::character::StandAnimation::update_skeleton( From 50b845d1c327de53660247e5bb42cb38593302c1 Mon Sep 17 00:00:00 2001 From: Songtronix Date: Sat, 21 Dec 2019 18:02:39 +0100 Subject: [PATCH 088/387] :/ and reactivated the password field --- Cargo.lock | 652 +++++++++++++++++++++++++++ client/src/error.rs | 1 + client/src/lib.rs | 3 + common/src/msg/server.rs | 2 + server/Cargo.toml | 1 + server/src/auth_provider.rs | 61 ++- server/src/lib.rs | 5 +- server/src/settings.rs | 4 +- server/src/sys/message.rs | 7 +- voxygen/Cargo.toml | 1 + voxygen/src/menu/main/client_init.rs | 31 +- voxygen/src/menu/main/mod.rs | 6 +- voxygen/src/menu/main/ui.rs | 18 +- 13 files changed, 759 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 083ae3808f..365119f7ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,6 +134,30 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "auth-common" +version = "0.1.0" +source = "git+https://gitlab.com/veloren/auth.git#65571ade0d954a0e0bd995fdb314854ff146ab97" +dependencies = [ + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "authc" +version = "1.0.0" +source = "git+https://gitlab.com/veloren/auth.git#65571ade0d954a0e0bd995fdb314854ff146ab97" +dependencies = [ + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "autocfg" version = "0.1.7" @@ -181,6 +205,11 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bincode" version = "1.2.0" @@ -272,6 +301,11 @@ dependencies = [ "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bumpalo" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "0.5.3" @@ -282,6 +316,11 @@ name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytes" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "c2-chacha" version = "0.2.3" @@ -535,11 +574,25 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "core-graphics" version = "0.17.3" @@ -744,6 +797,14 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ct-logs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "daggy" version = "0.5.0" @@ -844,11 +905,24 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "either" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "encoding_rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "env_logger" version = "0.6.2" @@ -993,6 +1067,69 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures-channel" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-io" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-sink" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-task" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-util" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gdk" version = "0.8.0" @@ -1361,6 +1498,24 @@ dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "h2" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hashbrown" version = "0.6.3" @@ -1380,6 +1535,11 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "hibitset" version = "0.6.2" @@ -1394,6 +1554,25 @@ name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "http" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.4" @@ -1407,6 +1586,46 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hyper" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-rustls" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "idna" version = "0.1.5" @@ -1520,6 +1739,14 @@ dependencies = [ "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "js-sys" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1707,6 +1934,11 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "mime_guess" version = "1.8.7" @@ -1718,6 +1950,15 @@ dependencies = [ "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "minifb" version = "0.13.0" @@ -2194,6 +2435,34 @@ dependencies = [ "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pin-project" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-utils" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "piston-float" version = "0.3.0" @@ -2267,6 +2536,11 @@ dependencies = [ "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "proc-macro-nested" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro2" version = "0.3.8" @@ -2618,6 +2892,55 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "reqwest" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ring" +version = "0.16.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rodio" version = "0.10.0" @@ -2678,6 +3001,17 @@ dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rust-argon2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-demangle" version = "0.1.16" @@ -2699,6 +3033,29 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rustls" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustls-native-certs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rusttype" version = "0.7.9" @@ -2749,6 +3106,15 @@ dependencies = [ "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "schannel" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "scoped_threadpool" version = "0.1.9" @@ -2759,6 +3125,15 @@ name = "scopeguard" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sct" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sdl2" version = "0.32.2" @@ -2781,6 +3156,26 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "security-framework" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "semver" version = "0.9.0" @@ -2822,6 +3217,17 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sha1" version = "0.6.0" @@ -3129,6 +3535,46 @@ dependencies = [ "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-rustls" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-util" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "toml" version = "0.5.5" @@ -3137,6 +3583,11 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "treeculler" version = "0.1.0" @@ -3145,6 +3596,11 @@ dependencies = [ "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "tuple_utils" version = "0.3.0" @@ -3166,6 +3622,14 @@ dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -3197,6 +3661,11 @@ name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "untrusted" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "url" version = "1.7.2" @@ -3217,6 +3686,15 @@ dependencies = [ "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "uvth" version = "3.1.1" @@ -3305,6 +3783,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3341,6 +3820,7 @@ dependencies = [ name = "veloren-voxygen" version = "0.5.0" dependencies = [ + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git)", "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3421,6 +3901,11 @@ name = "version_check" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "void" version = "1.0.2" @@ -3436,11 +3921,82 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wasi" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wasm-bindgen" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "wayland-client" version = "0.21.13" @@ -3548,6 +4104,32 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "web-sys" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "webpki" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "webpki-roots" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.2.8" @@ -3619,6 +4201,14 @@ dependencies = [ "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winres" version = "0.1.11" @@ -3693,11 +4283,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ab639324e3ee8774d296864fbc0dbbb256cf1a41c490b94cba90c082915f92" "checksum bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" @@ -3709,8 +4302,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" +"checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" "checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" @@ -3739,7 +4334,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" +"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" "checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" "checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" "checksum coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" @@ -3759,6 +4356,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" "checksum csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d" "checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" +"checksum ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" "checksum daggy 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9293a0da7d1bc1f30090ece4d9f9de79a07be7302ddb00e5eb1fefb6ee6409e2" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" @@ -3771,7 +4369,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11afd3251e588f2770226659b2a1d55ec2f8aaf2ca42bdcdbd01ff53b4a81e70" "checksum downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" "checksum draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" +"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" "checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" @@ -3790,6 +4390,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" +"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" +"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" +"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" +"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" +"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" +"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" @@ -3822,12 +4430,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" +"checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" +"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" +"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +"checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" +"checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826" @@ -3841,6 +4455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" +"checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -3865,7 +4480,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" +"checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" "checksum minifb 0.13.0 (git+https://github.com/emoon/rust_minifb.git)" = "" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" @@ -3915,6 +4532,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" "checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" "checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +"checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" +"checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" +"checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" +"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum piston-float 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b058c3a640efd4bcf63266512e4bb03187192c1b29edd38b16d5a014613e3199" "checksum piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d96dd995f7dabe6d57cda668ec0fda39d6fe6e1e0b23f772582f383f2013611" "checksum pistoncore-input 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c612ce242c7bac8e96426a0ca34275fd980af440f0cca7c6c0e840ef8a4052f" @@ -3924,6 +4545,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" @@ -3963,29 +4585,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" +"checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" "checksum roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e4c67c712ab62be58b24ab8960e2b95dd4ee00aac115c76f2709657821fe376d" "checksum rouille 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "112568052ec17fa26c6c11c40acbb30d3ad244bf3d6da0be181f5e7e42e5004f" "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" +"checksum rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "416f5109bdd413cec4f04c029297838e7604c993f8d1483b1d438f23bdc3eb35" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" +"checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" "checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" "checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "faf737f37ca340201889b5f48ecde47f233e9da3cbf3d04be27883adac39b4da" +"checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" "checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" +"checksum security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" +"checksum security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" +"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" @@ -4022,25 +4654,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" +"checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" +"checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" +"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" +"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" "checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +"checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" "checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" "checksum uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" "checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "1eb3ca8ea588deba055424cc1a79a830428b2f6c270b8d8f91946f660fa4d8ee" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" +"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +"checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" +"checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" +"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" +"checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" +"checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" +"checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" "checksum wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" "checksum wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" "checksum wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" @@ -4051,6 +4699,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" "checksum wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +"checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" +"checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" +"checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" @@ -4059,6 +4710,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" "checksum winit 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8" +"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4fb510bbfe5b8992ff15f77a2e6fe6cf062878f0eda00c0f44963a807ca5dc" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum x11-clipboard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89bd49c06c9eb5d98e6ba6536cf64ac9f7ee3a009b2f53996d405b3944f6bcea" diff --git a/client/src/error.rs b/client/src/error.rs index 154387e16c..1b533e641b 100644 --- a/client/src/error.rs +++ b/client/src/error.rs @@ -8,6 +8,7 @@ pub enum Error { ServerShutdown, TooManyPlayers, InvalidAuth, + AlreadyLoggedIn, //TODO: InvalidAlias, Other(String), } diff --git a/client/src/lib.rs b/client/src/lib.rs index 5bb2068dc6..723c348b11 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -105,6 +105,8 @@ impl Client { ); } + log::error!("Auth Server: {:?}", server_info.auth_provider); + // Initialize `State` let mut state = State::default(); let entity = state.ecs_mut().apply_entity_package(entity_package); @@ -549,6 +551,7 @@ impl Client { ServerMsg::Error(e) => match e { ServerError::TooManyPlayers => return Err(Error::ServerWentMad), ServerError::InvalidAuth => return Err(Error::InvalidAuth), + ServerError::AlreadyLoggedIn => return Err(Error::AlreadyLoggedIn), //TODO: ServerError::InvalidAlias => return Err(Error::InvalidAlias), }, ServerMsg::Shutdown => return Err(Error::ServerShutdown), diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index 0a7b84ae33..c472bd1942 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -21,6 +21,7 @@ pub struct ServerInfo { pub description: String, pub git_hash: String, pub git_date: String, + pub auth_provider: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -86,6 +87,7 @@ pub enum ServerMsg { pub enum ServerError { TooManyPlayers, InvalidAuth, + AlreadyLoggedIn, //TODO: InvalidAlias, } diff --git a/server/Cargo.toml b/server/Cargo.toml index e6e9917ad7..5b07f16c5e 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -31,3 +31,4 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } +authc = { git = "https://gitlab.com/veloren/auth.git" } \ No newline at end of file diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index 68160a48e0..198df45c41 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -1,32 +1,59 @@ +use authc::{AuthClient, AuthToken}; +use common::msg::ServerError; use hashbrown::HashMap; -use log::{info, warn}; +use std::str::FromStr; pub struct AuthProvider { accounts: HashMap, + auth_server: Option, } impl AuthProvider { - pub fn new() -> Self { + pub fn new(auth_addr: Option) -> Self { + let auth_server = match auth_addr { + Some(addr) => Some(AuthClient::new(addr)), + None => None, + }; + AuthProvider { accounts: HashMap::new(), + auth_server, } } - pub fn query(&mut self, username: String, password: String) -> bool { - let pwd = password.clone(); - if self.accounts.entry(username.clone()).or_insert_with(|| { - info!("Registered new user '{}'", &username); - pwd - }) == &password - { - info!("User '{}' successfully authenticated", username); - true - } else { - warn!( - "User '{}' attempted to log in with invalid password '{}'!", - username, password - ); - false + pub fn query(&mut self, username_or_token: String) -> Result { + // Based on whether auth server is provided or not we expect an username or + // token + match &self.auth_server { + // Token from auth server expected + Some(srv) => { + // TODO: Check if already logged in! + log::info!("Validating '{}' token.", &username_or_token); + match srv.validate( + AuthToken::from_str(&username_or_token).expect("Failed parsing token"), // TODO: POSSIBLE DOS, handle result! + ) { + Ok(id) => { + // TODO: Get username! + self.accounts.insert("peter".into(), id.to_string()); + Ok(true) + } + Err(e) => { + log::error!("{}", e); + Ok(false) + } + } + }, + // Username is expected + None => { + if !self.accounts.contains_key(&username_or_token) { + log::info!("New User '{}'", username_or_token); + self.accounts + .insert(username_or_token, "whateverUUID".into()); // TODO: generate UUID + Ok(true) + } else { + Err(ServerError::AlreadyLoggedIn) + } + }, } } } diff --git a/server/src/lib.rs b/server/src/lib.rs index d9f009a890..47fc395176 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -86,7 +86,9 @@ impl Server { let mut state = State::default(); state.ecs_mut().insert(EventBus::::default()); // TODO: anything but this - state.ecs_mut().insert(AuthProvider::new()); + state + .ecs_mut() + .insert(AuthProvider::new(settings.auth_server_address.clone())); state.ecs_mut().insert(Tick(0)); state.ecs_mut().insert(ChunkGenerator::new()); // System timers for performance monitoring @@ -196,6 +198,7 @@ impl Server { description: settings.server_description.clone(), git_hash: common::util::GIT_HASH.to_string(), git_date: common::util::GIT_DATE.to_string(), + auth_provider: settings.auth_server_address.clone(), }, metrics: ServerMetrics::new(settings.metrics_address) .expect("Failed to initialize server metrics submodule."), diff --git a/server/src/settings.rs b/server/src/settings.rs index 4ab9e0bbd1..12c6fc157f 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -10,12 +10,12 @@ const DEFAULT_WORLD_SEED: u32 = 5284; pub struct ServerSettings { pub gameserver_address: SocketAddr, pub metrics_address: SocketAddr, + pub auth_server_address: Option, pub max_players: usize, pub world_seed: u32, //pub pvp_enabled: bool, pub server_name: String, pub server_description: String, - //pub login_server: whatever pub start_time: f64, pub admins: Vec, /// When set to None, loads the default map file (if available); otherwise, @@ -28,6 +28,7 @@ impl Default for ServerSettings { Self { gameserver_address: SocketAddr::from(([0; 4], 14004)), metrics_address: SocketAddr::from(([0; 4], 14005)), + auth_server_address: Some("https://auth.veloren.net".into()), world_seed: DEFAULT_WORLD_SEED, server_name: "Veloren Alpha".to_owned(), server_description: "This is the best Veloren server.".to_owned(), @@ -107,6 +108,7 @@ impl ServerSettings { [127, 0, 0, 1], pick_unused_port().expect("Failed to find unused port!"), )), + auth_server_address: None, // If loading the default map file, make sure the seed is also default. world_seed: if load.map_file.is_some() { load.world_seed diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index f68d32f9e6..fe55a49c1b 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -124,7 +124,12 @@ impl<'a> System<'a> for Sys { }, // Valid player ClientMsg::Register { player, password } if player.is_valid() => { - if !accounts.query(player.alias.clone(), password) { + if !accounts + .query(password.clone()) + .expect("Handle this error!") + { + // TODO: Graceful error handling! + // TODO: Graceful error handling! (e.g. AlreadyLoggedIn) client.error_state(RequestStateError::Denied); break; } diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 9ae1608213..e9df01d6e5 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -64,6 +64,7 @@ rust-argon2 = "0.5" bincode = "1.2" deunicode = "1.0" uvth = "3.1.1" +authc = { git = "https://gitlab.com/veloren/auth.git" } [target.'cfg(target_os = "macos")'.dependencies] dispatch = "0.1.4" diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 95be603556..e7ed201382 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -68,13 +68,40 @@ impl ClientInit { { match Client::new(socket_addr, player.view_distance) { Ok(mut client) => { + // Authentication + let username_or_token = match &client.server_info.auth_provider + { + Some(addr) => { + let auth_client = authc::AuthClient::new(addr); + // TODO: PROMPT USER INCASE OF THE AUTH SERVER BEING + // UNKNOWN! + log::error!( + "Logging in with '{}', '{}'.", + &player.alias, + &password + ); + match auth_client.sign_in( + &player.alias, + &password, + socket_addr.ip(), + ) { + Ok(token) => token.serialize(), + // TODO: Properly deal with it + Err(e) => panic!( + "Failed to sign in to auth server '{}'! {}", + addr, e + ), + } + }, + None => player.alias.clone(), + }; + if let Err(ClientError::InvalidAuth) = - client.register(player.clone(), password.clone()) + client.register(player.clone(), username_or_token.clone()) { last_err = Some(Error::InvalidAuth); break; } - //client.register(player, password); let _ = tx.send(Ok(client)); return; }, diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 504e3d6dc9..c1c93df6df 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -8,7 +8,6 @@ use crate::{ window::Event, Direction, GlobalState, PlayState, PlayStateResult, }; -use argon2::{self, Config}; use client_init::{ClientInit, Error as InitError}; use common::{assets::load_expect, clock::Clock, comp}; use log::warn; @@ -202,9 +201,10 @@ fn attempt_login( (server_address, server_port, false), player, { - let salt = b"staticsalt_zTuGkGvybZIjZbNUDtw15"; + password + /*let salt = b"staticsalt_zTuGkGvybZIjZbNUDtw15"; let config = Config::default(); - argon2::hash_encoded(password.as_bytes(), salt, &config).unwrap() + argon2::hash_encoded(password.as_bytes(), salt, &config).unwrap()*/ }, )); } diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 43d1e774ff..b13fbee394 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -90,7 +90,7 @@ image_ids! { button_hover: "voxygen.element.buttons.button_hover", button_press: "voxygen.element.buttons.button_press", input_bg_top: "voxygen.element.misc_bg.textbox_top", - //input_bg_mid: "voxygen.element.misc_bg.textbox_mid", <-- For password input + input_bg_mid: "voxygen.element.misc_bg.textbox_mid", input_bg_bot: "voxygen.element.misc_bg.textbox_bot", @@ -461,14 +461,14 @@ impl MainMenuUi { } } // Password - // TODO: REACTIVATE THIS WHEN A PROPER ACCOUNT SYSTEM IS IN PLACE - /*Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97)) + // TODO: Why isn't it showing up? + // Password + Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97)) .down_from(self.ids.usrnm_bg, 30.0) .set(self.ids.passwd_bg, ui_widgets); Image::new(self.imgs.input_bg_mid) .w_h(337.0, 67.0) .middle_of(self.ids.passwd_bg) - .color(Some(INACTIVE)) .set(self.ids.password_bg, ui_widgets); for event in TextBox::new(&self.password) .w_h(290.0, 30.0) @@ -485,12 +485,13 @@ impl MainMenuUi { TextBoxEvent::Update(password) => { // Note: TextBox limits the input string length to what fits in it self.password = password; - } + }, TextBoxEvent::Enter => { login!(); - } + }, } - }*/ + } + if self.show_servers { Image::new(self.imgs.info_frame) .mid_top_with_margin_on(self.ids.username_bg, -320.0) @@ -556,7 +557,7 @@ impl MainMenuUi { } // Server address Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97)) - .down_from(self.ids.usrnm_bg, 30.0) + .down_from(self.ids.passwd_bg, 30.0) .set(self.ids.srvr_bg, ui_widgets); Image::new(self.imgs.input_bg_bot) .w_h(337.0, 67.0) @@ -582,6 +583,7 @@ impl MainMenuUi { }, } } + // Login button if Button::image(self.imgs.button) .hover_image(self.imgs.button_hover) From 584dcddba9ed3ffe5db05e006d363b32a2215b9c Mon Sep 17 00:00:00 2001 From: Acrimon Date: Wed, 1 Jan 2020 19:41:42 +0100 Subject: [PATCH 089/387] Updated to latest and greatest auth version. --- Cargo.lock | 810 ++++++++++++++++----------- server/Cargo.toml | 2 +- voxygen/Cargo.toml | 2 +- voxygen/src/menu/main/client_init.rs | 6 +- 4 files changed, 496 insertions(+), 324 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 365119f7ad..f098c2c441 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git#65571ade0d954a0e0bd995fdb314854ff146ab97" +source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -147,14 +147,13 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git#65571ade0d954a0e0bd995fdb314854ff146ab97" +source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git)", - "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -205,11 +204,6 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "bincode" version = "1.2.0" @@ -263,6 +257,25 @@ name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "brotli-sys" version = "0.3.2" @@ -306,6 +319,11 @@ name = "bumpalo" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "0.5.3" @@ -318,8 +336,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bytes" -version = "0.5.4" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "c2-chacha" @@ -501,7 +524,7 @@ dependencies = [ [[package]] name = "conrod_core" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git#d28fd18c3092d4c26cf6df11673da195b3bc01db" +source = "git+https://gitlab.com/veloren/conrod.git#bbc8a5efd2760669754f866fd7ee556d381e2c0e" dependencies = [ "conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", "copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -516,7 +539,7 @@ dependencies = [ [[package]] name = "conrod_derive" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git#d28fd18c3092d4c26cf6df11673da195b3bc01db" +source = "git+https://gitlab.com/veloren/conrod.git#bbc8a5efd2760669754f866fd7ee556d381e2c0e" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -526,7 +549,7 @@ dependencies = [ [[package]] name = "conrod_winit" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git#d28fd18c3092d4c26cf6df11673da195b3bc01db" +source = "git+https://gitlab.com/veloren/conrod.git#bbc8a5efd2760669754f866fd7ee556d381e2c0e" [[package]] name = "const-random" @@ -551,6 +574,32 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "cookie" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "copypasta" version = "0.6.0" @@ -574,25 +623,11 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "core-graphics" version = "0.17.3" @@ -838,6 +873,14 @@ name = "deunicode" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "directories" version = "2.0.2" @@ -935,6 +978,14 @@ dependencies = [ "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "error-chain" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "euc" version = "0.3.0" @@ -1013,6 +1064,17 @@ name = "fixedbitset" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "flate2" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fnv" version = "1.0.6" @@ -1068,66 +1130,17 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "futures-channel" -version = "0.3.4" +name = "futures" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "futures-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "futures-io" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "futures-macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "futures-sink" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "futures-task" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "futures-util" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1191,6 +1204,14 @@ dependencies = [ "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "getrandom" version = "0.1.13" @@ -1500,20 +1521,19 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.2" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1556,21 +1576,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "http" -version = "0.2.0" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "http-body" -version = "0.3.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1588,42 +1610,47 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.3" +version = "0.12.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hyper-rustls" -version = "0.20.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1747,6 +1774,11 @@ dependencies = [ "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1961,17 +1993,29 @@ dependencies = [ [[package]] name = "minifb" -version = "0.13.0" -source = "git+https://github.com/emoon/rust_minifb.git#bac71b297920c1f7ab5d6e384673d3ae5cc7d46d" +version = "0.15.3" +source = "git+https://github.com/emoon/rust_minifb.git#9d5529422c883d541a0eedcc329dc32afdcf28fa" dependencies = [ "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", "orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-protocols 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "miniz_oxide" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio" version = "0.6.21" @@ -2067,6 +2111,18 @@ dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "nix" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -2250,6 +2306,11 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "openssl-probe" version = "0.1.2" @@ -2435,34 +2496,6 @@ dependencies = [ "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "pin-project" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pin-project-lite" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "pin-utils" -version = "0.1.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "piston-float" version = "0.3.0" @@ -2536,11 +2569,6 @@ dependencies = [ "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "proc-macro-nested" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "proc-macro2" version = "0.3.8" @@ -2594,6 +2622,18 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "publicsuffix" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quick-error" version = "1.2.2" @@ -2808,7 +2848,7 @@ dependencies = [ [[package]] name = "raw-window-handle" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2894,36 +2934,36 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.10.4" +version = "0.9.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3001,17 +3041,6 @@ dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rust-argon2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustc-demangle" version = "0.1.16" @@ -3035,27 +3064,16 @@ dependencies = [ [[package]] name = "rustls" -version = "0.17.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rustls-native-certs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rusttype" version = "0.7.9" @@ -3106,15 +3124,6 @@ dependencies = [ "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "schannel" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "scoped_threadpool" version = "0.1.9" @@ -3156,26 +3165,6 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "security-framework" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "security-framework-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "semver" version = "0.9.0" @@ -3219,13 +3208,13 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.6.1" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3233,6 +3222,18 @@ name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "shared_library" version = "0.1.9" @@ -3391,6 +3392,14 @@ name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sum_type" version = "0.2.0" @@ -3451,6 +3460,19 @@ dependencies = [ "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term" version = "0.5.2" @@ -3537,42 +3559,138 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.13" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-rustls" -version = "0.13.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-util" -version = "0.2.0" +name = "tokio-sync" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3583,11 +3701,6 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tower-service" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "treeculler" version = "0.1.0" @@ -3601,6 +3714,14 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "try_from" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tuple_utils" version = "0.3.0" @@ -3614,6 +3735,11 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "typenum" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicase" version = "1.4.2" @@ -3783,7 +3909,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3820,7 +3946,7 @@ dependencies = [ name = "veloren-voxygen" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3879,7 +4005,7 @@ dependencies = [ "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "minifb 0.13.0 (git+https://github.com/emoon/rust_minifb.git)", + "minifb 0.15.3 (git+https://github.com/emoon/rust_minifb.git)", "noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3923,9 +4049,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3941,8 +4068,6 @@ version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3960,17 +4085,6 @@ dependencies = [ "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.59" @@ -4025,6 +4139,20 @@ dependencies = [ "wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wayland-client" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-commons 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wayland-commons" version = "0.21.13" @@ -4043,6 +4171,17 @@ dependencies = [ "wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wayland-commons" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wayland-protocols" version = "0.21.13" @@ -4066,6 +4205,17 @@ dependencies = [ "wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wayland-protocols" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-commons 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wayland-scanner" version = "0.21.13" @@ -4086,6 +4236,16 @@ dependencies = [ "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wayland-scanner" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wayland-sys" version = "0.21.13" @@ -4104,6 +4264,11 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wayland-sys" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "web-sys" version = "0.3.36" @@ -4124,7 +4289,7 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.18.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4193,7 +4358,7 @@ dependencies = [ "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4283,14 +4448,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ab639324e3ee8774d296864fbc0dbbb256cf1a41c490b94cba90c082915f92" "checksum bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" @@ -4298,14 +4462,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" "checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" "checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" "checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" @@ -4332,11 +4499,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" "checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" "checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" "checksum coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" @@ -4361,6 +4528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" "checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" @@ -4373,6 +4541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" "checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" "checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" "checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" @@ -4382,6 +4551,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" +"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -4390,18 +4560,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" -"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" -"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" -"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" -"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" -"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" -"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" "checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" "checksum gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" "checksum gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" @@ -4430,18 +4595,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" -"checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" +"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" -"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" -"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" -"checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" +"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +"checksum hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826" @@ -4456,6 +4621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" "checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" +"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -4483,7 +4649,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -"checksum minifb 0.13.0 (git+https://github.com/emoon/rust_minifb.git)" = "" +"checksum minifb 0.15.3 (git+https://github.com/emoon/rust_minifb.git)" = "" +"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" @@ -4492,6 +4659,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum multipart 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)" = "adba94490a79baf2d6a23eac897157047008272fa3eecb3373ae6377b91eca28" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +"checksum nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "337525774dd8a197b613a01ea88058ef0ed023e5ed1e4b7e93de478e1f2bf770" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" @@ -4511,6 +4679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" "checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" "checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" @@ -4532,10 +4701,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" "checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" "checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -"checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" -"checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" -"checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" -"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum piston-float 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b058c3a640efd4bcf63266512e4bb03187192c1b29edd38b16d5a014613e3199" "checksum piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d96dd995f7dabe6d57cda668ec0fda39d6fe6e1e0b23f772582f383f2013611" "checksum pistoncore-input 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c612ce242c7bac8e96426a0ca34275fd980af440f0cca7c6c0e840ef8a4052f" @@ -4545,13 +4710,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" -"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" "checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" +"checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" @@ -4575,7 +4740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" -"checksum raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9db80d08d3ed847ce4fb3def46de0af4bfb6155bd09bd6eaf28b5ac72541c1f1" +"checksum raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" "checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" "checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" @@ -4585,40 +4750,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" +"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" "checksum roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e4c67c712ab62be58b24ab8960e2b95dd4ee00aac115c76f2709657821fe376d" "checksum rouille 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "112568052ec17fa26c6c11c40acbb30d3ad244bf3d6da0be181f5e7e42e5004f" "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" -"checksum rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "416f5109bdd413cec4f04c029297838e7604c993f8d1483b1d438f23bdc3eb35" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" -"checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" +"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" "checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" "checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "faf737f37ca340201889b5f48ecde47f233e9da3cbf3d04be27883adac39b4da" -"checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" "checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" -"checksum security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" -"checksum security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" -"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" @@ -4638,6 +4799,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" "checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" @@ -4645,6 +4807,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "661641ea2aa15845cddeb97dad000d22070bb5c1fb456b96c1cba883ec691e92" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" @@ -4654,15 +4817,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" -"checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" -"checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" -"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" +"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +"checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +"checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +"checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +"checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +"checksum tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" +"checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +"checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +"checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +"checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" "checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" "checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" +"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" @@ -4681,27 +4853,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" "checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" -"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" "checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" "checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" "checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" "checksum wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" "checksum wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" +"checksum wayland-client 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9bcc929c26d59a655b0d2cd337299326acc1f6e3d4434c3ae2d6c78d32290ca4" "checksum wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" "checksum wayland-commons 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" +"checksum wayland-commons 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "539cdd0c296802332d763ff663739a7f83bdf67b3df58e99fe0215e96a495142" "checksum wayland-protocols 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "4afde2ea2a428eee6d7d2c8584fdbe8b82eee8b6c353e129a434cd6e07f42145" "checksum wayland-protocols 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" +"checksum wayland-protocols 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "79df44471a2e01b61c089472443858062fa64ea60dfd24267848efd7a8f161b6" "checksum wayland-scanner 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3828c568714507315ee425a9529edc4a4aa9901409e373e9e0027e7622b79e" "checksum wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" +"checksum wayland-scanner 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43ea5ea1a117137d72c0c197431d198d69783b5e8ca996b0583c98e10b44d426" "checksum wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +"checksum wayland-sys 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "537500923d50be11d95a63c4cb538145e4c82edf61296b7debc1f94a1a6514ed" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" -"checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" +"checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/server/Cargo.toml b/server/Cargo.toml index 5b07f16c5e..e7ee9febba 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -31,4 +31,4 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } -authc = { git = "https://gitlab.com/veloren/auth.git" } \ No newline at end of file +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" } diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index e9df01d6e5..f639501007 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -64,7 +64,7 @@ rust-argon2 = "0.5" bincode = "1.2" deunicode = "1.0" uvth = "3.1.1" -authc = { git = "https://gitlab.com/veloren/auth.git" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" } [target.'cfg(target_os = "macos")'.dependencies] dispatch = "0.1.4" diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index e7ed201382..72c1abe152 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -80,11 +80,7 @@ impl ClientInit { &player.alias, &password ); - match auth_client.sign_in( - &player.alias, - &password, - socket_addr.ip(), - ) { + match auth_client.sign_in(&player.alias, &password) { Ok(token) => token.serialize(), // TODO: Properly deal with it Err(e) => panic!( From 403deecc6d6acde9f37da98c962f1dd5afc306a2 Mon Sep 17 00:00:00 2001 From: Acrimon Date: Wed, 1 Jan 2020 21:17:43 +0100 Subject: [PATCH 090/387] Server auth handling improvements. --- Cargo.lock | 1 + client/src/lib.rs | 1 + common/Cargo.toml | 1 + common/src/msg/server.rs | 6 ++++ server/src/auth_provider.rs | 62 ++++++++++++++++++++++++++++--------- 5 files changed, 56 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f098c2c441..901b3da8d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3878,6 +3878,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/client/src/lib.rs b/client/src/lib.rs index 723c348b11..6a169f8e4a 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -552,6 +552,7 @@ impl Client { ServerError::TooManyPlayers => return Err(Error::ServerWentMad), ServerError::InvalidAuth => return Err(Error::InvalidAuth), ServerError::AlreadyLoggedIn => return Err(Error::AlreadyLoggedIn), + ServerError::AuthError(_) => unreachable!(), //TODO: ServerError::InvalidAlias => return Err(Error::InvalidAlias), }, ServerMsg::Shutdown => return Err(Error::ServerShutdown), diff --git a/common/Cargo.toml b/common/Cargo.toml index f28f688c43..fe3123a720 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -33,6 +33,7 @@ crossbeam = "=0.7.2" notify = "5.0.0-pre.1" indexmap = "1.3.0" sum_type = "0.2.0" +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" } [dev-dependencies] criterion = "0.3" diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index c472bd1942..8159dfb874 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -4,6 +4,7 @@ use crate::{ terrain::{Block, TerrainChunk}, ChatType, }; +use authc::AuthClientError; use hashbrown::HashMap; use vek::*; @@ -88,9 +89,14 @@ pub enum ServerError { TooManyPlayers, InvalidAuth, AlreadyLoggedIn, + AuthError(String), //TODO: InvalidAlias, } +impl From for ServerError { + fn from(err: AuthClientError) -> Self { Self::AuthError(err.to_string()) } +} + impl ServerMsg { pub fn chat(message: String) -> ServerMsg { ServerMsg::ChatMsg { diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index 198df45c41..4e7861f0bf 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -1,8 +1,39 @@ -use authc::{AuthClient, AuthToken}; +use authc::{AuthClient, AuthToken, Uuid}; use common::msg::ServerError; use hashbrown::HashMap; use std::str::FromStr; +fn contains_value(map: &HashMap, value: &str) -> bool { + let mut contains = false; + for ev in map.values() { + if value == ev { + contains = true; + } + } + contains +} + +fn derive_uuid(username: &str) -> Uuid { + let mut state: [u8; 16] = [ + 52, 17, 19, 239, 52, 17, 19, 239, 52, 17, 19, 239, 52, 17, 19, 239, + ]; + for mix_byte_1 in username.as_bytes() { + for i in 0..16 { + let mix_byte_step: u8 = mix_byte_1 + .wrapping_pow(239) + .wrapping_mul((i as u8).wrapping_pow(43)); + let mix_byte_2 = state[i + mix_byte_step as usize % 16]; + let rot_step: u8 = mix_byte_1 + .wrapping_pow(29) + .wrapping_mul((i as u8).wrapping_pow(163)); + state[i] = (state[i] ^ mix_byte_1) + .wrapping_mul(mix_byte_2) + .rotate_left(rot_step as u32); + } + } + Uuid::from_slice(&state).unwrap() +} + pub struct AuthProvider { accounts: HashMap, auth_server: Option, @@ -27,28 +58,29 @@ impl AuthProvider { match &self.auth_server { // Token from auth server expected Some(srv) => { - // TODO: Check if already logged in! log::info!("Validating '{}' token.", &username_or_token); - match srv.validate( - AuthToken::from_str(&username_or_token).expect("Failed parsing token"), // TODO: POSSIBLE DOS, handle result! - ) { - Ok(id) => { - // TODO: Get username! - self.accounts.insert("peter".into(), id.to_string()); - Ok(true) - } - Err(e) => { - log::error!("{}", e); - Ok(false) + if let Ok(token) = AuthToken::from_str(&username_or_token) { + match srv.validate(token) { + Ok(id) => { + if contains_value(&self.accounts, &id.to_string()) { + return Err(ServerError::AlreadyLoggedIn); + } + let username = srv.uuid_to_username(id.clone())?; + self.accounts.insert(username, id.to_string()); + Ok(true) + }, + Err(e) => Err(ServerError::from(e)), } + } else { + Ok(false) } }, // Username is expected None => { if !self.accounts.contains_key(&username_or_token) { log::info!("New User '{}'", username_or_token); - self.accounts - .insert(username_or_token, "whateverUUID".into()); // TODO: generate UUID + let uuid = derive_uuid(&username_or_token); + self.accounts.insert(username_or_token, uuid.to_string()); Ok(true) } else { Err(ServerError::AlreadyLoggedIn) From 8ef1251dc2f4bb66f10c937c6a206d184ea3fb33 Mon Sep 17 00:00:00 2001 From: Imbris Date: Thu, 2 Jan 2020 03:43:45 -0500 Subject: [PATCH 091/387] Add warning prompt for untrusted auth servers, move some auth code into --- Cargo.lock | 31 +++++++- client/Cargo.toml | 1 + client/src/error.rs | 9 ++- client/src/lib.rs | 31 +++++++- common/Cargo.toml | 2 +- common/src/msg/client.rs | 2 +- server/Cargo.toml | 2 +- server/src/auth_provider.rs | 30 +++---- server/src/sys/message.rs | 7 +- voxygen/Cargo.toml | 1 - voxygen/src/menu/main/client_init.rs | 97 +++++++++++------------ voxygen/src/menu/main/mod.rs | 52 +++++++++--- voxygen/src/menu/main/ui.rs | 113 ++++++++++++++++++++++----- voxygen/src/settings.rs | 6 ++ 14 files changed, 265 insertions(+), 119 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 901b3da8d3..0b4c37a8d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,6 +144,16 @@ dependencies = [ "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "auth-common" +version = "0.1.0" +source = "git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b#f3445fc1dca55f09205bdbe8ad038db60fea442b" +dependencies = [ + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "authc" version = "1.0.0" @@ -157,6 +167,19 @@ dependencies = [ "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "authc" +version = "1.0.0" +source = "git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b#f3445fc1dca55f09205bdbe8ad038db60fea442b" +dependencies = [ + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "autocfg" version = "0.1.7" @@ -3863,6 +3886,7 @@ dependencies = [ name = "veloren-client" version = "0.5.0" dependencies = [ + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3878,7 +3902,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3910,7 +3934,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3978,7 +4002,6 @@ dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4450,7 +4473,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" "checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)" = "" "checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" diff --git a/client/Cargo.toml b/client/Cargo.toml index a67b2db65d..983d2f59a5 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,3 +15,4 @@ log = "0.4.8" specs = "0.15.1" vek = { version = "0.9.9", features = ["serde"] } hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "f3445fc1dca55f09205bdbe8ad038db60fea442b" } diff --git a/client/src/error.rs b/client/src/error.rs index 1b533e641b..6003bcb046 100644 --- a/client/src/error.rs +++ b/client/src/error.rs @@ -1,3 +1,4 @@ +use authc::AuthClientError; use common::net::PostError; #[derive(Debug)] @@ -9,10 +10,16 @@ pub enum Error { TooManyPlayers, InvalidAuth, AlreadyLoggedIn, + AuthClientError(AuthClientError), + AuthServerNotTrusted, //TODO: InvalidAlias, Other(String), } impl From for Error { - fn from(err: PostError) -> Self { Error::Network(err) } + fn from(err: PostError) -> Self { Self::Network(err) } +} + +impl From for Error { + fn from(err: AuthClientError) -> Self { Self::AuthClientError(err) } } diff --git a/client/src/lib.rs b/client/src/lib.rs index 6a169f8e4a..7e3520a606 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -105,7 +105,7 @@ impl Client { ); } - log::error!("Auth Server: {:?}", server_info.auth_provider); + log::info!("Auth Server: {:?}", server_info.auth_provider); // Initialize `State` let mut state = State::default(); @@ -174,10 +174,33 @@ impl Client { } /// Request a state transition to `ClientState::Registered`. - pub fn register(&mut self, player: comp::Player, password: String) -> Result<(), Error> { - self.postbox - .send_message(ClientMsg::Register { player, password }); + pub fn register( + &mut self, + player: comp::Player, + password: String, + mut auth_trusted: impl FnMut(&str) -> bool, + ) -> Result<(), Error> { + // Authentication + let token_or_username = match &self.server_info.auth_provider { + Some(addr) => { + // Query whether this is a trusted auth server + if auth_trusted(&addr) { + authc::AuthClient::new(addr) + .sign_in(&player.alias, &password)? + .serialize() + } else { + return Err(Error::AuthServerNotTrusted); + } + }, + None => player.alias.clone(), + }; + + self.postbox.send_message(ClientMsg::Register { + player, + token_or_username, + }); self.client_state = ClientState::Pending; + loop { match self.postbox.next_message() { Some(ServerMsg::StateAnswer(Err((RequestStateError::Denied, _)))) => { diff --git a/common/Cargo.toml b/common/Cargo.toml index fe3123a720..255ff314a8 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -33,7 +33,7 @@ crossbeam = "=0.7.2" notify = "5.0.0-pre.1" indexmap = "1.3.0" sum_type = "0.2.0" -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "f3445fc1dca55f09205bdbe8ad038db60fea442b" } [dev-dependencies] criterion = "0.3" diff --git a/common/src/msg/client.rs b/common/src/msg/client.rs index b4022483ad..87ded3f830 100644 --- a/common/src/msg/client.rs +++ b/common/src/msg/client.rs @@ -5,7 +5,7 @@ use vek::*; pub enum ClientMsg { Register { player: comp::Player, - password: String, + token_or_username: String, }, Character { name: String, diff --git a/server/Cargo.toml b/server/Cargo.toml index e7ee9febba..cf364fd0b9 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -31,4 +31,4 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "f3445fc1dca55f09205bdbe8ad038db60fea442b" } diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index 4e7861f0bf..6634e5bf51 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -3,16 +3,6 @@ use common::msg::ServerError; use hashbrown::HashMap; use std::str::FromStr; -fn contains_value(map: &HashMap, value: &str) -> bool { - let mut contains = false; - for ev in map.values() { - if value == ev { - contains = true; - } - } - contains -} - fn derive_uuid(username: &str) -> Uuid { let mut state: [u8; 16] = [ 52, 17, 19, 239, 52, 17, 19, 239, 52, 17, 19, 239, 52, 17, 19, 239, @@ -35,7 +25,7 @@ fn derive_uuid(username: &str) -> Uuid { } pub struct AuthProvider { - accounts: HashMap, + accounts: HashMap, auth_server: Option, } @@ -61,12 +51,12 @@ impl AuthProvider { log::info!("Validating '{}' token.", &username_or_token); if let Ok(token) = AuthToken::from_str(&username_or_token) { match srv.validate(token) { - Ok(id) => { - if contains_value(&self.accounts, &id.to_string()) { + Ok(uuid) => { + if self.accounts.contains_key(&uuid) { return Err(ServerError::AlreadyLoggedIn); } - let username = srv.uuid_to_username(id.clone())?; - self.accounts.insert(username, id.to_string()); + let username = srv.uuid_to_username(uuid.clone())?; + self.accounts.insert(uuid, username); Ok(true) }, Err(e) => Err(ServerError::from(e)), @@ -77,10 +67,12 @@ impl AuthProvider { }, // Username is expected None => { - if !self.accounts.contains_key(&username_or_token) { - log::info!("New User '{}'", username_or_token); - let uuid = derive_uuid(&username_or_token); - self.accounts.insert(username_or_token, uuid.to_string()); + // Assume username was provided + let username = username_or_token; + let uuid = derive_uuid(&username); + if !self.accounts.contains_key(&uuid) { + log::info!("New User '{}'", username); + self.accounts.insert(uuid, username); Ok(true) } else { Err(ServerError::AlreadyLoggedIn) diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index fe55a49c1b..bc7a4b9b25 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -123,9 +123,12 @@ impl<'a> System<'a> for Sys { ClientState::Pending => {}, }, // Valid player - ClientMsg::Register { player, password } if player.is_valid() => { + ClientMsg::Register { + player, + token_or_username, + } if player.is_valid() => { if !accounts - .query(password.clone()) + .query(token_or_username.clone()) .expect("Handle this error!") { // TODO: Graceful error handling! diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index f639501007..49939b5767 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -60,7 +60,6 @@ cpal = "0.10" crossbeam = "=0.7.2" hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } chrono = "0.4.9" -rust-argon2 = "0.5" bincode = "1.2" deunicode = "1.0" uvth = "3.1.1" diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 72c1abe152..04e37f6f7f 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -1,6 +1,6 @@ use client::{error::Error as ClientError, Client}; use common::{comp, net::PostError}; -use crossbeam::channel::{unbounded, Receiver, TryRecvError}; +use crossbeam::channel::{unbounded, Receiver, Sender, TryRecvError}; use std::{ net::ToSocketAddrs, sync::{ @@ -15,21 +15,26 @@ use std::{ pub enum Error { // Error parsing input string or error resolving host name. BadAddress(std::io::Error), - // Parsing/host name resolution successful but could not connect. - #[allow(dead_code)] - ConnectionFailed(ClientError), + // Parsing/host name resolution successful but there was an error within the client. + ClientError(ClientError), // Parsing yielded an empty iterator (specifically to_socket_addrs()). NoAddress, - InvalidAuth, ClientCrashed, - ServerIsFull, } +pub enum Msg { + IsAuthTrusted(String), + Done(Result), +} + +pub struct AuthTrust(String, bool); + // Used to asynchronously parse the server address, resolve host names, // and create the client (which involves establishing a connection to the // server). pub struct ClientInit { - rx: Receiver>, + rx: Receiver, + trust_tx: Sender, cancel: Arc, } impl ClientInit { @@ -41,6 +46,7 @@ impl ClientInit { let (server_address, default_port, prefer_ipv6) = connection_args; let (tx, rx) = unbounded(); + let (trust_tx, trust_rx) = unbounded(); let cancel = Arc::new(AtomicBool::new(false)); let cancel2 = Arc::clone(&cancel); @@ -68,35 +74,20 @@ impl ClientInit { { match Client::new(socket_addr, player.view_distance) { Ok(mut client) => { - // Authentication - let username_or_token = match &client.server_info.auth_provider + if let Err(err) = + client.register(player.clone(), password, |auth_server| { + let _ = tx + .send(Msg::IsAuthTrusted(auth_server.to_string())); + trust_rx + .recv() + .map(|AuthTrust(server, trust)| { + trust && &server == auth_server + }) + .unwrap_or(false) + }) { - Some(addr) => { - let auth_client = authc::AuthClient::new(addr); - // TODO: PROMPT USER INCASE OF THE AUTH SERVER BEING - // UNKNOWN! - log::error!( - "Logging in with '{}', '{}'.", - &player.alias, - &password - ); - match auth_client.sign_in(&player.alias, &password) { - Ok(token) => token.serialize(), - // TODO: Properly deal with it - Err(e) => panic!( - "Failed to sign in to auth server '{}'! {}", - addr, e - ), - } - }, - None => player.alias.clone(), - }; - - if let Err(ClientError::InvalidAuth) = - client.register(player.clone(), username_or_token.clone()) - { - last_err = Some(Error::InvalidAuth); - break; + last_err = Some(Error::ClientError(err)); + break 'tries; } let _ = tx.send(Ok(client)); return; @@ -109,20 +100,11 @@ impl ClientInit { }, // Assume the connection failed and try again soon ClientError::Network(_) => {}, - ClientError::TooManyPlayers => { - last_err = Some(Error::ServerIsFull); + // Non-connection error, stop attempts + err => { + last_err = Some(Error::ClientError(err)); break 'tries; }, - ClientError::InvalidAuth => { - last_err = Some(Error::InvalidAuth); - break 'tries; - }, - // TODO: Handle errors? - _ => panic!( - "Unexpected non-network error when creating client: \ - {:?}", - err - ), } }, } @@ -130,29 +112,38 @@ impl ClientInit { thread::sleep(Duration::from_secs(5)); } // Parsing/host name resolution successful but no connection succeeded. - let _ = tx.send(Err(last_err.unwrap_or(Error::NoAddress))); + let _ = tx.send(Msg::Done(Err(last_err.unwrap_or(Error::NoAddress)))); }, Err(err) => { // Error parsing input string or error resolving host name. - let _ = tx.send(Err(Error::BadAddress(err))); + let _ = tx.send(Msg::Done(Err(Error::BadAddress(err)))); }, } }); - ClientInit { rx, cancel } + ClientInit { + rx, + trust_tx, + cancel, + } } /// Poll if the thread is complete. /// Returns None if the thread is still running, otherwise returns the /// Result of client creation. - pub fn poll(&self) -> Option> { + pub fn poll(&self) -> Option { match self.rx.try_recv() { - Ok(result) => Some(result), + Ok(msg) => Some(msg), Err(TryRecvError::Empty) => None, - Err(TryRecvError::Disconnected) => Some(Err(Error::ClientCrashed)), + Err(TryRecvError::Disconnected) => Some(Msg::Done(Err(Error::ClientCrashed))), } } + /// Report trust status of auth server + pub fn auth_trust(&self, auth_server: String, trusted: bool) { + let _ = self.trust_tx.send(AuthTrust(auth_server, trusted)); + } + pub fn cancel(&mut self) { self.cancel.store(true, Ordering::Relaxed); } } diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index c1c93df6df..ddcd6cd9db 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -8,9 +8,9 @@ use crate::{ window::Event, Direction, GlobalState, PlayState, PlayStateResult, }; -use client_init::{ClientInit, Error as InitError}; +use client_init::{ClientInit, Error as InitError, Msg as InitMsg}; use common::{assets::load_expect, clock::Clock, comp}; -use log::warn; +use log::{error, warn}; #[cfg(feature = "singleplayer")] use std::time::Duration; use ui::{Event as MainMenuEvent, MainMenuUi}; @@ -73,19 +73,39 @@ impl PlayState for MainMenuState { std::rc::Rc::new(std::cell::RefCell::new(client)), ))); }, - Some(Err(err)) => { + Some(InitMsg::Done(Err(err))) => { client_init = None; global_state.info_message = Some( match err { InitError::BadAddress(_) | InitError::NoAddress => "Server not found", - InitError::InvalidAuth => "Invalid credentials", - InitError::ServerIsFull => "Server is full", - InitError::ConnectionFailed(_) => "Connection failed", + InitError::ClientError(err) => match err { + client::Error::InvalidAuth => "Invalid credentials", + client::Error::TooManyPlayers => "Server is full", + client::Error::AuthServerNotTrusted => "Auth server not trusted", + _ => { + error!("Error when trying to connect: {:?}", err); + "Connection Failed" + }, + }, InitError::ClientCrashed => "Client crashed", } .to_string(), ); }, + Some(InitMsg::IsAuthTrusted(auth_server)) => { + if global_state + .settings + .networking + .trusted_auth_servers + .contains(&auth_server) + { + // Can't fail since we just polled it, it must be Some + client_init.as_ref().unwrap().auth_trust(auth_server, true); + } else { + // Show warning that auth server is not trusted and prompt for approval + self.main_menu_ui.auth_trust_prompt(auth_server); + } + }, None => {}, } @@ -140,6 +160,19 @@ impl PlayState for MainMenuState { MainMenuEvent::DisclaimerClosed => { global_state.settings.show_disclaimer = false }, + MainMenuEvent::AuthServerTrust(auth_server, trust) => { + if trust { + global_state + .settings + .networking + .trusted_auth_servers + .insert(auth_server.clone()); + global_state.settings.save_to_file_warn(); + } + client_init + .as_ref() + .map(|init| init.auth_trust(auth_server, trust)); + }, } } let localized_strings = load_expect::(&i18n_asset_key( @@ -200,12 +233,7 @@ fn attempt_login( *client_init = Some(ClientInit::new( (server_address, server_port, false), player, - { - password - /*let salt = b"staticsalt_zTuGkGvybZIjZbNUDtw15"; - let config = Config::default(); - argon2::hash_encoded(password.as_bytes(), salt, &config).unwrap()*/ - }, + { password }, )); } } else { diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index b13fbee394..6e83e2e85f 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -68,7 +68,9 @@ widget_ids! { // Info Window info_frame, info_text, - info_bottom + info_bottom, + // Auth Trust Prompt + button_add_auth_trust, } } @@ -122,16 +124,17 @@ pub enum Event { Quit, Settings, DisclaimerClosed, + AuthServerTrust(String, bool), } pub enum PopupType { Error, ConnectionInfo, + AuthTrustPrompt(String), } pub struct PopupData { msg: String, - button_text: String, popup_type: PopupType, } @@ -261,27 +264,51 @@ impl MainMenuUi { .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) .set(self.ids.version, ui_widgets); - // Popup (Error/Info) - if let Some(popup_data) = &self.popup { - let text = Text::new(&popup_data.msg) - .rgba(1.0, 1.0, 1.0, if self.connect { fade_msg } else { 1.0 }) + + // Popup (Error/Info/AuthTrustPrompt) + let mut change_popup = None; + if let Some(PopupData { msg, popup_type }) = &self.popup { + let text = Text::new(msg) + .rgba( + 1.0, + 1.0, + 1.0, + if let PopupType::ConnectionInfo = popup_type { + fade_msg + } else { + 1.0 + }, + ) .font_id(self.fonts.cyri.conrod_id); - Rectangle::fill_with([65.0 * 6.0, 140.0], color::TRANSPARENT) + let (frame_w, frame_h) = if let PopupType::AuthTrustPrompt(_) = popup_type { + (65.0 * 8.0, 300.0) + } else { + (65.0 * 6.0, 140.0) + }; + let error_bg = Rectangle::fill_with([frame_w, frame_h], color::TRANSPARENT) .rgba(0.1, 0.1, 0.1, if self.connect { 0.0 } else { 1.0 }) - .parent(ui_widgets.window) - .up_from(self.ids.banner_top, 15.0) - .set(self.ids.login_error_bg, ui_widgets); + .parent(ui_widgets.window); + if let PopupType::AuthTrustPrompt(_) = popup_type { + error_bg.middle_of(ui_widgets.window) + } else { + error_bg.up_from(self.ids.banner_top, 15.0) + } + .set(self.ids.login_error_bg, ui_widgets); Image::new(self.imgs.info_frame) - .w_h(65.0 * 6.0, 140.0) + .w_h(frame_w, frame_h) .color(Some(Color::Rgba( 1.0, 1.0, 1.0, - if self.connect { 0.0 } else { 1.0 }, + if let PopupType::ConnectionInfo = popup_type { + 0.0 + } else { + 1.0 + }, ))) .middle_of(self.ids.login_error_bg) .set(self.ids.error_frame, ui_widgets); - if self.connect { + if let PopupType::ConnectionInfo = popup_type { text.mid_top_with_margin_on(self.ids.error_frame, 10.0) .font_id(self.fonts.alkhemi.conrod_id) .bottom_left_with_margins_on(ui_widgets.window, 60.0, 60.0) @@ -289,6 +316,7 @@ impl MainMenuUi { .set(self.ids.login_error, ui_widgets); } else { text.mid_top_with_margin_on(self.ids.error_frame, 10.0) + .w(frame_w - 10.0 * 2.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(25)) .set(self.ids.login_error, ui_widgets); @@ -296,7 +324,7 @@ impl MainMenuUi { if Button::image(self.imgs.button) .w_h(100.0, 30.0) .mid_bottom_with_margin_on( - if self.connect { + if let PopupType::ConnectionInfo = popup_type { ui_widgets.window } else { self.ids.login_error_bg @@ -306,22 +334,55 @@ impl MainMenuUi { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .label_y(Relative::Scalar(2.0)) - .label(&popup_data.button_text) + .label(match popup_type { + PopupType::Error => "Okay", + PopupType::ConnectionInfo => "Cancel", + PopupType::AuthTrustPrompt(_) => "Cancel", + }) .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(self.fonts.cyri.scale(15)) .label_color(TEXT_COLOR) .set(self.ids.button_ok, ui_widgets) .was_clicked() { - match popup_data.popup_type { + match &popup_type { + PopupType::Error => (), PopupType::ConnectionInfo => { events.push(Event::CancelLoginAttempt); }, - _ => (), + PopupType::AuthTrustPrompt(auth_server) => { + events.push(Event::AuthServerTrust(auth_server.clone(), false)); + }, }; - self.popup = None; - }; + change_popup = Some(None); + } + + if let PopupType::AuthTrustPrompt(auth_server) = popup_type { + if Button::image(self.imgs.button) + .w_h(100.0, 30.0) + .right_from(self.ids.button_ok, 10.0) + .hover_image(self.imgs.button_hover) + .press_image(self.imgs.button_press) + .label_y(Relative::Scalar(2.0)) + .label("Add") + .label_font_id(self.fonts.cyri) + .label_font_size(15) + .label_color(TEXT_COLOR) + .set(self.ids.button_add_auth_trust, ui_widgets) + .was_clicked() + { + events.push(Event::AuthServerTrust(auth_server.clone(), true)); + change_popup = Some(Some(PopupData { + msg: "Connecting...".to_string(), + popup_type: PopupType::ConnectionInfo, + })); + } + } } + if let Some(p) = change_popup { + self.popup = p; + } + if !self.connect { Image::new(self.imgs.banner) .w_h(65.0 * 6.0, 100.0 * 6.0) @@ -461,8 +522,6 @@ impl MainMenuUi { } } // Password - // TODO: Why isn't it showing up? - // Password Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97)) .down_from(self.ids.usrnm_bg, 30.0) .set(self.ids.passwd_bg, ui_widgets); @@ -686,6 +745,18 @@ impl MainMenuUi { events } + pub fn auth_trust_prompt(&mut self, auth_server: String) { + self.popup = Some(PopupData { + msg: format!( + "Warning: The server you are trying to connect to has provided this \ + authentication server addresss:\n\n{}\n\nbut it is not in your list of trusted \ + authentication servers.", + &auth_server + ), + popup_type: PopupType::AuthTrustPrompt(auth_server), + }) + } + pub fn show_info(&mut self, msg: String, button_text: String) { self.popup = Some(PopupData { msg, diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 5bae056d85..854464422f 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -7,6 +7,7 @@ use crate::{ }; use directories::{ProjectDirs, UserDirs}; use glutin::{MouseButton, VirtualKeyCode}; +use hashbrown::HashSet; use log::warn; use serde_derive::{Deserialize, Serialize}; use std::{fs, io::prelude::*, path::PathBuf}; @@ -157,6 +158,7 @@ pub struct NetworkingSettings { pub password: String, pub servers: Vec, pub default_server: usize, + pub trusted_auth_servers: HashSet, } impl Default for NetworkingSettings { @@ -166,6 +168,10 @@ impl Default for NetworkingSettings { password: String::default(), servers: vec!["server.veloren.net".to_string()], default_server: 0, + trusted_auth_servers: ["https://auth.veloren.net"] + .iter() + .map(|s| s.to_string()) + .collect(), } } } From 7db0ff0b8c7345fe78134eedf83e3d64c5da7feb Mon Sep 17 00:00:00 2001 From: Acrimon Date: Thu, 2 Jan 2020 10:49:48 +0100 Subject: [PATCH 092/387] Update chat-cli to work properly. Update reqwest to 0.10.0 --- Cargo.lock | 421 ++++++++++++++++++++++++++++++++++- chat-cli/src/main.rs | 4 +- client/Cargo.toml | 2 +- common/Cargo.toml | 2 +- server/Cargo.toml | 2 +- voxygen/src/menu/main/mod.rs | 3 +- voxygen/src/menu/main/ui.rs | 15 +- 7 files changed, 422 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b4c37a8d4..90350a0271 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" +source = "git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033#68504561dd868bc2065e9300a27616f3560f7033" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -147,7 +147,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b#f3445fc1dca55f09205bdbe8ad038db60fea442b" +source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -157,11 +157,11 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" +source = "git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033#68504561dd868bc2065e9300a27616f3560f7033" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -170,9 +170,9 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b#f3445fc1dca55f09205bdbe8ad038db60fea442b" +source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -227,6 +227,11 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bincode" version = "1.2.0" @@ -367,6 +372,11 @@ dependencies = [ "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bytes" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "c2-chacha" version = "0.2.3" @@ -646,11 +656,25 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "core-graphics" version = "0.17.3" @@ -1157,6 +1181,19 @@ name = "futures" version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures-channel" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "futures-cpupool" version = "0.1.8" @@ -1166,6 +1203,48 @@ dependencies = [ "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "futures-io" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-sink" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-task" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-util" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gdk" version = "0.8.0" @@ -1559,6 +1638,24 @@ dependencies = [ "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "h2" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hashbrown" version = "0.6.3" @@ -1607,6 +1704,16 @@ dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "http" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "http-body" version = "0.1.0" @@ -1618,6 +1725,15 @@ dependencies = [ "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.4" @@ -1660,6 +1776,29 @@ dependencies = [ "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hyper" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hyper-rustls" version = "0.17.1" @@ -1676,6 +1815,23 @@ dependencies = [ "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hyper-rustls" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "idna" version = "0.1.5" @@ -2519,6 +2675,34 @@ dependencies = [ "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pin-project" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-utils" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "piston-float" version = "0.3.0" @@ -2592,6 +2776,11 @@ dependencies = [ "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "proc-macro-nested" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro2" version = "0.3.8" @@ -2990,6 +3179,41 @@ dependencies = [ "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "reqwest" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ring" version = "0.16.11" @@ -3097,6 +3321,29 @@ dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rustls" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustls-native-certs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rusttype" version = "0.7.9" @@ -3147,6 +3394,15 @@ dependencies = [ "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "schannel" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "scoped_threadpool" version = "0.1.9" @@ -3188,6 +3444,26 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "security-framework" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "semver" version = "0.9.0" @@ -3240,6 +3516,17 @@ dependencies = [ "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sha1" version = "0.6.0" @@ -3598,6 +3885,22 @@ dependencies = [ "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tokio-buf" version = "0.1.1" @@ -3667,6 +3970,17 @@ dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio-rustls" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tokio-sync" version = "0.1.8" @@ -3716,6 +4030,19 @@ dependencies = [ "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio-util" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "toml" version = "0.5.5" @@ -3724,6 +4051,11 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "treeculler" version = "0.1.0" @@ -3886,7 +4218,7 @@ dependencies = [ name = "veloren-client" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3902,7 +4234,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3934,7 +4266,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4081,6 +4413,15 @@ dependencies = [ "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wasi" version = "0.7.0" @@ -4092,6 +4433,8 @@ version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4109,6 +4452,17 @@ dependencies = [ "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.59" @@ -4319,6 +4673,14 @@ dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "webpki-roots" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.2.8" @@ -4472,15 +4834,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)" = "" "checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)" = "" "checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=f3445fc1dca55f09205bdbe8ad038db60fea442b)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ab639324e3ee8774d296864fbc0dbbb256cf1a41c490b94cba90c082915f92" "checksum bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" @@ -4499,6 +4862,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" "checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" @@ -4529,7 +4893,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" +"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" "checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" "checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" "checksum coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" @@ -4587,7 +4953,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" +"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" +"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" +"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" +"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" +"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" @@ -4622,17 +4995,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" "checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +"checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" "checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" "checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +"checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" "checksum hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" +"checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826" @@ -4727,6 +5105,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" "checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" "checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +"checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" +"checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" +"checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" +"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum piston-float 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b058c3a640efd4bcf63266512e4bb03187192c1b29edd38b16d5a014613e3199" "checksum piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d96dd995f7dabe6d57cda668ec0fda39d6fe6e1e0b23f772582f383f2013611" "checksum pistoncore-input 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c612ce242c7bac8e96426a0ca34275fd980af440f0cca7c6c0e840ef8a4052f" @@ -4736,6 +5118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" @@ -4776,6 +5159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" "checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" @@ -4787,23 +5171,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +"checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" +"checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" "checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" "checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "faf737f37ca340201889b5f48ecde47f233e9da3cbf3d04be27883adac39b4da" +"checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" "checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" +"checksum security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" +"checksum security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" "checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" +"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" @@ -4844,17 +5234,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +"checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" "checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" "checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" "checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" "checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" "checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" "checksum tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" +"checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" "checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" "checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" "checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" "checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" +"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" "checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" @@ -4880,9 +5274,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" "checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" "checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" +"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" "checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" "checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" "checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" @@ -4904,6 +5300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" "checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" +"checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/chat-cli/src/main.rs b/chat-cli/src/main.rs index b74c1ea87f..4b4776dc9c 100644 --- a/chat-cli/src/main.rs +++ b/chat-cli/src/main.rs @@ -51,7 +51,9 @@ fn main() { println!("Players online: {:?}", client.get_players()); client - .register(comp::Player::new(username, None), password) + .register(comp::Player::new(username, None), password, |provider| { + provider == "https://auth.veloren.net" + }) .unwrap(); let (tx, rx) = mpsc::channel(); diff --git a/client/Cargo.toml b/client/Cargo.toml index 983d2f59a5..f6a04ab2b9 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,4 +15,4 @@ log = "0.4.8" specs = "0.15.1" vek = { version = "0.9.9", features = ["serde"] } hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "f3445fc1dca55f09205bdbe8ad038db60fea442b" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "68504561dd868bc2065e9300a27616f3560f7033" } diff --git a/common/Cargo.toml b/common/Cargo.toml index 255ff314a8..0e95113d79 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -33,7 +33,7 @@ crossbeam = "=0.7.2" notify = "5.0.0-pre.1" indexmap = "1.3.0" sum_type = "0.2.0" -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "f3445fc1dca55f09205bdbe8ad038db60fea442b" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "68504561dd868bc2065e9300a27616f3560f7033" } [dev-dependencies] criterion = "0.3" diff --git a/server/Cargo.toml b/server/Cargo.toml index cf364fd0b9..5e2c228bb7 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -31,4 +31,4 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "f3445fc1dca55f09205bdbe8ad038db60fea442b" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "68504561dd868bc2065e9300a27616f3560f7033" } diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index ddcd6cd9db..aa50f7d19b 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -180,8 +180,7 @@ impl PlayState for MainMenuState { )); if let Some(info) = global_state.info_message.take() { - self.main_menu_ui - .show_info(info, localized_strings.get("common.okay").to_owned()); + self.main_menu_ui.show_info(info); } // Draw the UI to the screen. diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 6e83e2e85f..cb7399ecc1 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -335,9 +335,9 @@ impl MainMenuUi { .press_image(self.imgs.button_press) .label_y(Relative::Scalar(2.0)) .label(match popup_type { - PopupType::Error => "Okay", - PopupType::ConnectionInfo => "Cancel", - PopupType::AuthTrustPrompt(_) => "Cancel", + PopupType::Error => self.voxygen_i18n.get("common.okay"), + PopupType::ConnectionInfo => self.voxygen_i18n.get("common.cancel"), + PopupType::AuthTrustPrompt(_) => self.voxygen_i18n.get("common.cancel"), }) .label_font_id(self.fonts.cyri.conrod_id) .label_font_size(self.fonts.cyri.scale(15)) @@ -365,8 +365,8 @@ impl MainMenuUi { .press_image(self.imgs.button_press) .label_y(Relative::Scalar(2.0)) .label("Add") - .label_font_id(self.fonts.cyri) - .label_font_size(15) + .label_font_id(self.fonts.cyri.conrod_id) + .label_font_size(self.fonts.cyri.scale(15)) .label_color(TEXT_COLOR) .set(self.ids.button_add_auth_trust, ui_widgets) .was_clicked() @@ -448,7 +448,6 @@ impl MainMenuUi { self.connecting = Some(std::time::Instant::now()); self.popup = Some(PopupData { msg: [self.voxygen_i18n.get("main.connecting"), "..."].concat(), - button_text: self.voxygen_i18n.get("common.cancel").to_owned(), popup_type: PopupType::ConnectionInfo, }); @@ -486,7 +485,6 @@ impl MainMenuUi { self.connecting = Some(std::time::Instant::now()); self.popup = Some(PopupData { msg: [self.voxygen_i18n.get("main.creating_world"), "..."].concat(), - button_text: self.voxygen_i18n.get("common.cancel").to_owned(), popup_type: PopupType::ConnectionInfo, }); }; @@ -757,10 +755,9 @@ impl MainMenuUi { }) } - pub fn show_info(&mut self, msg: String, button_text: String) { + pub fn show_info(&mut self, msg: String) { self.popup = Some(PopupData { msg, - button_text, popup_type: PopupType::Error, }); self.connecting = None; From ac5ff453cc4e0c1921db4c68d801991c085d1ee0 Mon Sep 17 00:00:00 2001 From: Songtronix Date: Sat, 4 Jan 2020 11:21:59 +0100 Subject: [PATCH 093/387] improve(voxygen): error handling while connecting --- client/src/lib.rs | 3 +- voxygen/src/menu/main/client_init.rs | 2 +- voxygen/src/menu/main/mod.rs | 52 +++++++++++++++++++++------- voxygen/src/menu/main/ui.rs | 7 ++-- 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 7e3520a606..fc85c38ff6 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -5,6 +5,7 @@ pub mod error; // Reexports pub use crate::error::Error; +pub use authc::AuthClientError; pub use specs::{ join::Join, saveload::{Marker, MarkerAllocator}, @@ -105,7 +106,7 @@ impl Client { ); } - log::info!("Auth Server: {:?}", server_info.auth_provider); + log::debug!("Auth Server: {:?}", server_info.auth_provider); // Initialize `State` let mut state = State::default(); diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 04e37f6f7f..26dc674983 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -95,7 +95,7 @@ impl ClientInit { Err(err) => { match err { ClientError::Network(PostError::Bincode(_)) => { - last_err = Some(Error::ConnectionFailed(err)); + last_err = Some(Error::ClientError(err)); break 'tries; }, // Assume the connection failed and try again soon diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index aa50f7d19b..f4fb75a122 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -75,22 +75,48 @@ impl PlayState for MainMenuState { }, Some(InitMsg::Done(Err(err))) => { client_init = None; - global_state.info_message = Some( - match err { - InitError::BadAddress(_) | InitError::NoAddress => "Server not found", + global_state.info_message = Some({ + let err = match err { + InitError::BadAddress(_) | InitError::NoAddress => { + "Server not found".into() + }, InitError::ClientError(err) => match err { - client::Error::InvalidAuth => "Invalid credentials", - client::Error::TooManyPlayers => "Server is full", - client::Error::AuthServerNotTrusted => "Auth server not trusted", - _ => { - error!("Error when trying to connect: {:?}", err); - "Connection Failed" + client::Error::InvalidAuth => "Invalid credentials".into(), + client::Error::TooManyPlayers => "Server is full".into(), + client::Error::AuthServerNotTrusted => { + "Auth server not trusted".into() + }, + client::Error::ServerWentMad => "ServerWentMad: Probably versions \ + are incompatible, check for \ + updates." + .into(), + client::Error::ServerTimeout => "Timeout: Server did not respond \ + in time. (Overloaded or network \ + issues)." + .into(), + client::Error::ServerShutdown => "Server shut down".into(), + client::Error::AlreadyLoggedIn => { + "You are already logged into the server.".into() + }, + client::Error::Network(e) => format!("Network error: {:?}", e), + client::Error::Other(e) => format!("Error: {}", e), + client::Error::AuthClientError(e) => match e { + client::AuthClientError::JsonError(e) => { + format!("Fatal error: {}", e) + }, + client::AuthClientError::RequestError(e) => { + format!("Failed to send request to Auth server: {}", e) + }, + client::AuthClientError::ServerError(_, e) => format!("{}", e), }, }, - InitError::ClientCrashed => "Client crashed", - } - .to_string(), - ); + InitError::ClientCrashed => "Client crashed".into(), + }; + // Log error for possible additional use later or incase that the error + // displayed is cut of. + error!("{}", err); + err + }); }, Some(InitMsg::IsAuthTrusted(auth_server)) => { if global_state diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index cb7399ecc1..f56c8c309e 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -281,7 +281,7 @@ impl MainMenuUi { ) .font_id(self.fonts.cyri.conrod_id); let (frame_w, frame_h) = if let PopupType::AuthTrustPrompt(_) = popup_type { - (65.0 * 8.0, 300.0) + (65.0 * 8.0, 370.0) } else { (65.0 * 6.0, 140.0) }; @@ -747,8 +747,9 @@ impl MainMenuUi { self.popup = Some(PopupData { msg: format!( "Warning: The server you are trying to connect to has provided this \ - authentication server addresss:\n\n{}\n\nbut it is not in your list of trusted \ - authentication servers.", + authentication server address:\n\n{}\n\nbut it is not in your list of trusted \ + authentication servers.\n\nMake sure that you trust this site and owner to not \ + try and bruteforce your password!", &auth_server ), popup_type: PopupType::AuthTrustPrompt(auth_server), From 08b4cc5fc3fe7b10ce12ba25fc1ad1ce5868e74b Mon Sep 17 00:00:00 2001 From: Acrimon Date: Sun, 5 Jan 2020 23:37:40 +0100 Subject: [PATCH 094/387] Update auth to use new hashing scheme. --- Cargo.lock | 40 +++++++++++++++++++++++++++++++--------- client/Cargo.toml | 2 +- common/Cargo.toml | 2 +- server/Cargo.toml | 2 +- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90350a0271..f1f4dca142 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033#68504561dd868bc2065e9300a27616f3560f7033" +source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -157,13 +157,14 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033#68504561dd868bc2065e9300a27616f3560f7033" +source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1245,6 +1246,14 @@ dependencies = [ "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gdk" version = "0.8.0" @@ -3288,6 +3297,17 @@ dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rust-argon2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-demangle" version = "0.1.16" @@ -4218,7 +4238,7 @@ dependencies = [ name = "veloren-client" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4234,7 +4254,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4266,7 +4286,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4834,9 +4854,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" "checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=68504561dd868bc2065e9300a27616f3560f7033)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" "checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" @@ -4961,6 +4981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" "checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" "checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" @@ -5167,6 +5188,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e4c67c712ab62be58b24ab8960e2b95dd4ee00aac115c76f2709657821fe376d" "checksum rouille 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "112568052ec17fa26c6c11c40acbb30d3ad244bf3d6da0be181f5e7e42e5004f" "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" +"checksum rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "416f5109bdd413cec4f04c029297838e7604c993f8d1483b1d438f23bdc3eb35" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" diff --git a/client/Cargo.toml b/client/Cargo.toml index f6a04ab2b9..671d5c2a11 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,4 +15,4 @@ log = "0.4.8" specs = "0.15.1" vek = { version = "0.9.9", features = ["serde"] } hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "68504561dd868bc2065e9300a27616f3560f7033" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } diff --git a/common/Cargo.toml b/common/Cargo.toml index 0e95113d79..219b9aeb61 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -33,7 +33,7 @@ crossbeam = "=0.7.2" notify = "5.0.0-pre.1" indexmap = "1.3.0" sum_type = "0.2.0" -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "68504561dd868bc2065e9300a27616f3560f7033" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } [dev-dependencies] criterion = "0.3" diff --git a/server/Cargo.toml b/server/Cargo.toml index 5e2c228bb7..aaccf0a24a 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -31,4 +31,4 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "68504561dd868bc2065e9300a27616f3560f7033" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } From d3412d549390d87d52c81870cc3f15cc17f334e9 Mon Sep 17 00:00:00 2001 From: Acrimon Date: Mon, 6 Jan 2020 23:32:46 +0100 Subject: [PATCH 095/387] Fixed gameserver crash on authprovider error. --- server/src/sys/message.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index bc7a4b9b25..425e10cc42 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -127,12 +127,8 @@ impl<'a> System<'a> for Sys { player, token_or_username, } if player.is_valid() => { - if !accounts - .query(token_or_username.clone()) - .expect("Handle this error!") - { - // TODO: Graceful error handling! - // TODO: Graceful error handling! (e.g. AlreadyLoggedIn) + if !accounts.query(token_or_username.clone()).unwrap_or(false) { + // TO-DO: Set a less generic error here. client.error_state(RequestStateError::Denied); break; } From 6cc07270ac1d80d392832efae927d4e794f16d65 Mon Sep 17 00:00:00 2001 From: Imbris Date: Tue, 7 Jan 2020 01:27:18 -0500 Subject: [PATCH 096/387] improve(login): more precise error handling during login --- client/src/error.rs | 2 +- client/src/lib.rs | 36 +++++++++++++++--------------------- common/src/msg/mod.rs | 2 +- common/src/msg/server.rs | 27 +++++++++++++-------------- common/src/net/post2.rs | 14 +++++++------- server/src/auth_provider.rs | 34 ++++++++++++++++------------------ server/src/lib.rs | 4 ++-- server/src/sys/message.rs | 10 ++++++---- voxygen/src/menu/main/mod.rs | 2 +- 9 files changed, 62 insertions(+), 69 deletions(-) diff --git a/client/src/error.rs b/client/src/error.rs index 6003bcb046..b81e806286 100644 --- a/client/src/error.rs +++ b/client/src/error.rs @@ -8,8 +8,8 @@ pub enum Error { ServerTimeout, ServerShutdown, TooManyPlayers, - InvalidAuth, AlreadyLoggedIn, + AuthErr(String), AuthClientError(AuthClientError), AuthServerNotTrusted, //TODO: InvalidAlias, diff --git a/client/src/lib.rs b/client/src/lib.rs index fc85c38ff6..71f69f5444 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -18,7 +18,7 @@ use common::{ event::{EventBus, SfxEvent, SfxEventItem}, msg::{ validate_chat_msg, ChatMsgValidationError, ClientMsg, ClientState, PlayerListUpdate, - RequestStateError, ServerError, ServerInfo, ServerMsg, MAX_BYTES_CHAT_MSG, + RegisterError, RequestStateError, ServerInfo, ServerMsg, MAX_BYTES_CHAT_MSG, }, net::PostBox, state::State, @@ -87,13 +87,13 @@ impl Client { let mut postbox = PostBox::to(addr)?; // Wait for initial sync - let (state, entity, server_info, world_map) = match postbox.next_message() { - Some(ServerMsg::InitialSync { + let (state, entity, server_info, world_map) = match postbox.next_message()? { + ServerMsg::InitialSync { entity_package, server_info, time_of_day, world_map: (map_size, world_map), - }) => { + } => { // TODO: Display that versions don't match in Voxygen if server_info.git_hash != common::util::GIT_HASH.to_string() { log::warn!( @@ -132,9 +132,7 @@ impl Client { (state, entity, server_info, (world_map, map_size)) }, - Some(ServerMsg::Error(ServerError::TooManyPlayers)) => { - return Err(Error::TooManyPlayers); - }, + ServerMsg::TooManyPlayers => return Err(Error::TooManyPlayers), _ => return Err(Error::ServerWentMad), }; @@ -203,11 +201,15 @@ impl Client { self.client_state = ClientState::Pending; loop { - match self.postbox.next_message() { - Some(ServerMsg::StateAnswer(Err((RequestStateError::Denied, _)))) => { - break Err(Error::InvalidAuth); + match self.postbox.next_message()? { + ServerMsg::StateAnswer(Err((RequestStateError::RegisterDenied(err), state))) => { + self.client_state = state; + break Err(match err { + RegisterError::AlreadyLoggedIn => Error::AlreadyLoggedIn, + RegisterError::AuthError(err) => Error::AuthErr(err), + }); }, - Some(ServerMsg::StateAnswer(Ok(ClientState::Registered))) => break Ok(()), + ServerMsg::StateAnswer(Ok(ClientState::Registered)) => break Ok(()), _ => {}, } } @@ -572,12 +574,8 @@ impl Client { if new_msgs.len() > 0 { for msg in new_msgs { match msg { - ServerMsg::Error(e) => match e { - ServerError::TooManyPlayers => return Err(Error::ServerWentMad), - ServerError::InvalidAuth => return Err(Error::InvalidAuth), - ServerError::AlreadyLoggedIn => return Err(Error::AlreadyLoggedIn), - ServerError::AuthError(_) => unreachable!(), - //TODO: ServerError::InvalidAlias => return Err(Error::InvalidAlias), + ServerMsg::TooManyPlayers => { + return Err(Error::ServerWentMad); }, ServerMsg::Shutdown => return Err(Error::ServerShutdown), ServerMsg::InitialSync { .. } => return Err(Error::ServerWentMad), @@ -720,10 +718,6 @@ impl Client { self.client_state = state; }, ServerMsg::StateAnswer(Err((error, state))) => { - if error == RequestStateError::Denied { - warn!("Connection denied!"); - return Err(Error::InvalidAuth); - } warn!( "StateAnswer: {:?}. Server thinks client is in state {:?}.", error, state diff --git a/common/src/msg/mod.rs b/common/src/msg/mod.rs index 1baee67e15..1c04fece94 100644 --- a/common/src/msg/mod.rs +++ b/common/src/msg/mod.rs @@ -6,7 +6,7 @@ pub mod server; pub use self::{ client::ClientMsg, ecs_packet::EcsCompPacket, - server::{PlayerListUpdate, RequestStateError, ServerError, ServerInfo, ServerMsg}, + server::{PlayerListUpdate, RegisterError, RequestStateError, ServerInfo, ServerMsg}, }; #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index 8159dfb874..c517eec665 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -8,14 +8,6 @@ use authc::AuthClientError; use hashbrown::HashMap; use vek::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -pub enum RequestStateError { - Denied, - Already, - Impossible, - WrongMessage, -} - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ServerInfo { pub name: String, @@ -79,21 +71,28 @@ pub enum ServerMsg { chunk: Result, ()>, }, TerrainBlockUpdates(HashMap, Block>), - Error(ServerError), Disconnect, Shutdown, + TooManyPlayers, } -#[derive(Debug, Clone, Serialize, Deserialize)] -pub enum ServerError { - TooManyPlayers, - InvalidAuth, +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub enum RequestStateError { + RegisterDenied(RegisterError), + Denied, + Already, + Impossible, + WrongMessage, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub enum RegisterError { AlreadyLoggedIn, AuthError(String), //TODO: InvalidAlias, } -impl From for ServerError { +impl From for RegisterError { fn from(err: AuthClientError) -> Self { Self::AuthError(err.to_string()) } } diff --git a/common/src/net/post2.rs b/common/src/net/post2.rs index bae88d25f2..ee9e7303e5 100644 --- a/common/src/net/post2.rs +++ b/common/src/net/post2.rs @@ -119,16 +119,16 @@ impl PostBox { pub fn send_message(&mut self, msg: S) { let _ = self.send_tx.send(msg); } - pub fn next_message(&mut self) -> Option { - if self.error.is_some() { - return None; + pub fn next_message(&mut self) -> Result { + if let Some(e) = self.error.clone() { + return Err(e); } - match self.recv_rx.recv().ok()? { - Ok(msg) => Some(msg), + match self.recv_rx.recv().map_err(|_| Error::ChannelFailure)? { + Ok(msg) => Ok(msg), Err(e) => { - self.error = Some(e); - None + self.error = Some(e.clone()); + Err(e) }, } } diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index 6634e5bf51..4ec2abb306 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -1,5 +1,5 @@ use authc::{AuthClient, AuthToken, Uuid}; -use common::msg::ServerError; +use common::msg::RegisterError; use hashbrown::HashMap; use std::str::FromStr; @@ -42,28 +42,26 @@ impl AuthProvider { } } - pub fn query(&mut self, username_or_token: String) -> Result { + pub fn query(&mut self, username_or_token: String) -> Result<(), RegisterError> { // Based on whether auth server is provided or not we expect an username or // token match &self.auth_server { // Token from auth server expected Some(srv) => { log::info!("Validating '{}' token.", &username_or_token); - if let Ok(token) = AuthToken::from_str(&username_or_token) { - match srv.validate(token) { - Ok(uuid) => { - if self.accounts.contains_key(&uuid) { - return Err(ServerError::AlreadyLoggedIn); - } - let username = srv.uuid_to_username(uuid.clone())?; - self.accounts.insert(uuid, username); - Ok(true) - }, - Err(e) => Err(ServerError::from(e)), - } - } else { - Ok(false) + // Parse token + let token = AuthToken::from_str(&username_or_token) + .map_err(|e| RegisterError::AuthError(e.to_string()))?; + // Validate token + let uuid = srv.validate(token)?; + // Check if already logged in + if self.accounts.contains_key(&uuid) { + return Err(RegisterError::AlreadyLoggedIn); } + // Log in + let username = srv.uuid_to_username(uuid.clone())?; + self.accounts.insert(uuid, username); + Ok(()) }, // Username is expected None => { @@ -73,9 +71,9 @@ impl AuthProvider { if !self.accounts.contains_key(&uuid) { log::info!("New User '{}'", username); self.accounts.insert(uuid, username); - Ok(true) + Ok(()) } else { - Err(ServerError::AlreadyLoggedIn) + Err(RegisterError::AlreadyLoggedIn) } }, } diff --git a/server/src/lib.rs b/server/src/lib.rs index 47fc395176..c3cc142a63 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -27,7 +27,7 @@ use common::{ assets, comp, effect::Effect, event::{EventBus, ServerEvent}, - msg::{ClientMsg, ClientState, ServerError, ServerInfo, ServerMsg}, + msg::{ClientMsg, ClientState, ServerInfo, ServerMsg}, net::PostOffice, state::{State, TimeOfDay}, sync::{Uid, WorldSyncExt}, @@ -505,7 +505,7 @@ impl Server { <= self.state.ecs().read_storage::().join().count() { // Note: in this case the client is dropped - client.notify(ServerMsg::Error(ServerError::TooManyPlayers)); + client.notify(ServerMsg::TooManyPlayers); } else { let entity = self .state diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index 425e10cc42..b7d0fa182d 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -127,10 +127,12 @@ impl<'a> System<'a> for Sys { player, token_or_username, } if player.is_valid() => { - if !accounts.query(token_or_username.clone()).unwrap_or(false) { - // TO-DO: Set a less generic error here. - client.error_state(RequestStateError::Denied); - break; + match accounts.query(token_or_username.clone()) { + Err(err) => { + client.error_state(RequestStateError::RegisterDenied(err)); + break; + }, + Ok(()) => {}, } match client.client_state { ClientState::Connected => { diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index f4fb75a122..0d44cb8c16 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -81,7 +81,7 @@ impl PlayState for MainMenuState { "Server not found".into() }, InitError::ClientError(err) => match err { - client::Error::InvalidAuth => "Invalid credentials".into(), + client::Error::AuthErr(e) => format!("Auth error on server: {}", e), client::Error::TooManyPlayers => "Server is full".into(), client::Error::AuthServerNotTrusted => { "Auth server not trusted".into() From e18e2e19016250cdd381272e169ebb74ce856c0c Mon Sep 17 00:00:00 2001 From: Acrimon Date: Wed, 8 Jan 2020 00:16:43 +0100 Subject: [PATCH 097/387] Update readme with signup link. add changes to changelog --- CHANGELOG.md | 1 + README.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd4f119c21..ef5177faaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Overhauled NPC AI - Pets now attack enemies and defend their owners - Added collars to tame wild animals +- Added authentication system (to play on the official server register on https://account.veloren.net) ### Changed diff --git a/README.md b/README.md index 4ffbf053c8..60d017207d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ Currently the communication of contributors happens mainly on our [official Disc ## Useful Links +[Sign Up](https://account.veloren.net) - Here you can create an online account for Veloren. +This will be needed to play on auth-enabled servers, including the official server. + [The Book](https://book.veloren.net) - A collection of all important information relating to Veloren. It includes information on how to compile Veloren and how to contribute. [Future Plans](https://gitlab.com/veloren/veloren/milestones) - Go here for information about Veloren's development roadmap and what we're currently working on. From d4225cfb456dd7d13f50df50d741dba905e086aa Mon Sep 17 00:00:00 2001 From: Acrimon Date: Wed, 8 Jan 2020 23:45:10 +0100 Subject: [PATCH 098/387] Auth error help message. main menu message about auth --- assets/voxygen/i18n/en.ron | 13 ++++++++----- voxygen/src/menu/main/mod.rs | 6 ++++-- voxygen/src/menu/main/ui.rs | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 96d7344654..459dca3398 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -113,11 +113,14 @@ Thanks for taking the time to read this notice, we hope you enjoy the game! // Login process description "main.login_process": r#"Information on the Login Process: -Put in any username. No Account needed yet. - -Character names and appearances will be saved locally. +If you are having issues signing in: -Levels/Items are not saved yet."#, +Please note that you now need an account +to play on auth-enabled servers. + +You can create an account over at + +https://account.veloren.net."#, /// End Main screen section @@ -358,4 +361,4 @@ Willpower "esc_menu.quit_game": "Quit Game", /// End Escape Menu Section } -) \ No newline at end of file +) diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 0d44cb8c16..7a9c445b90 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -30,6 +30,8 @@ impl MainMenuState { const DEFAULT_PORT: u16 = 14004; +static LOGIN_FAILED_MSG: &str = "If you are having issues signing in. Please note that you now need an account to play on auth-enabled servers.\nYou can create an account over at https://account.veloren.net."; + impl PlayState for MainMenuState { fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult { // Set up an fps clock. @@ -104,8 +106,8 @@ impl PlayState for MainMenuState { client::AuthClientError::JsonError(e) => { format!("Fatal error: {}", e) }, - client::AuthClientError::RequestError(e) => { - format!("Failed to send request to Auth server: {}", e) + client::AuthClientError::RequestError(_) => { + LOGIN_FAILED_MSG.into() }, client::AuthClientError::ServerError(_, e) => format!("{}", e), }, diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index f56c8c309e..b323be9169 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -459,7 +459,7 @@ impl MainMenuUi { }; } // Info Window - Rectangle::fill_with([550.0, 200.0], color::BLACK) + Rectangle::fill_with([550.0, 400.0], color::BLACK) .top_left_with_margins_on(ui_widgets.window, 40.0, 40.0) .color(Color::Rgba(0.0, 0.0, 0.0, 0.95)) .set(self.ids.info_frame, ui_widgets); From 3995f099b0281eaedb10330b1f98dd8735dc171c Mon Sep 17 00:00:00 2001 From: Acrimon Date: Wed, 8 Jan 2020 23:53:04 +0100 Subject: [PATCH 099/387] Fix singleplayer crash. --- server/src/auth_provider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index 4ec2abb306..bfc2855ce9 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -12,7 +12,7 @@ fn derive_uuid(username: &str) -> Uuid { let mix_byte_step: u8 = mix_byte_1 .wrapping_pow(239) .wrapping_mul((i as u8).wrapping_pow(43)); - let mix_byte_2 = state[i + mix_byte_step as usize % 16]; + let mix_byte_2 = state[(i + mix_byte_step as usize) % 16]; let rot_step: u8 = mix_byte_1 .wrapping_pow(29) .wrapping_mul((i as u8).wrapping_pow(163)); From b29e543089a70fae4b1faaa1d4186e3a9ed7e292 Mon Sep 17 00:00:00 2001 From: Acrimon Date: Sat, 11 Jan 2020 20:50:35 +0100 Subject: [PATCH 100/387] Remove account on logout. --- server/src/auth_provider.rs | 2 ++ server/src/sys/message.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index bfc2855ce9..1f6f411198 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -42,6 +42,8 @@ impl AuthProvider { } } + pub fn logout(&mut self, username: &str) { self.accounts.retain(|_, v| v != username); } + pub fn query(&mut self, username_or_token: String) -> Result<(), RegisterError> { // Based on whether auth server is provided or not we expect an username or // token diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index b7d0fa182d..8d42652867 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -293,6 +293,7 @@ impl<'a> System<'a> for Sys { None, ServerMsg::broadcast(format!("{} went offline.", &player.alias)), )); + accounts.logout(&player.alias); } server_emitter.emit(ServerEvent::ClientDisconnect(entity)); client.postbox.send_message(ServerMsg::Disconnect); From a04c1b1d1d8af7c8c66353af22732fc6705bf89b Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 11 Jan 2020 16:04:49 -0500 Subject: [PATCH 101/387] Add uid to Player component fix: world examples --- Cargo.lock | 94 ++-------------------------- chat-cli/src/main.rs | 2 +- client/src/lib.rs | 19 +++--- common/Cargo.toml | 2 +- common/src/comp/player.rs | 15 +++-- common/src/msg/client.rs | 2 +- server/src/auth_provider.rs | 19 +++--- server/src/sys/message.rs | 23 ++++--- voxygen/src/menu/main/client_init.rs | 11 ++-- voxygen/src/menu/main/mod.rs | 24 +++---- world/Cargo.toml | 2 +- 11 files changed, 67 insertions(+), 146 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f1f4dca142..80411e8e72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2181,17 +2181,14 @@ dependencies = [ [[package]] name = "minifb" -version = "0.15.3" -source = "git+https://github.com/emoon/rust_minifb.git#9d5529422c883d541a0eedcc329dc32afdcf28fa" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", "orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-protocols 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2299,18 +2296,6 @@ dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "nix" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -3790,19 +3775,6 @@ dependencies = [ "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "term" version = "0.5.2" @@ -4381,7 +4353,7 @@ dependencies = [ "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "minifb 0.15.3 (git+https://github.com/emoon/rust_minifb.git)", + "minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4537,20 +4509,6 @@ dependencies = [ "wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wayland-client" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "wayland-commons" version = "0.21.13" @@ -4569,17 +4527,6 @@ dependencies = [ "wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wayland-commons" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "wayland-protocols" version = "0.21.13" @@ -4603,17 +4550,6 @@ dependencies = [ "wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wayland-protocols" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "wayland-scanner" version = "0.21.13" @@ -4634,16 +4570,6 @@ dependencies = [ "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wayland-scanner" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "wayland-sys" version = "0.21.13" @@ -4662,11 +4588,6 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wayland-sys" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "web-sys" version = "0.3.36" @@ -5074,7 +4995,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -"checksum minifb 0.15.3 (git+https://github.com/emoon/rust_minifb.git)" = "" +"checksum minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799c20458eb0dd69f48cea5014afe736b363818c86d7ca61dbb56e1c0585014c" "checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" @@ -5084,7 +5005,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum multipart 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)" = "adba94490a79baf2d6a23eac897157047008272fa3eecb3373ae6377b91eca28" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -"checksum nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "337525774dd8a197b613a01ea88058ef0ed023e5ed1e4b7e93de478e1f2bf770" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" @@ -5245,7 +5165,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "661641ea2aa15845cddeb97dad000d22070bb5c1fb456b96c1cba883ec691e92" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" @@ -5306,19 +5225,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" "checksum wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" "checksum wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" -"checksum wayland-client 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9bcc929c26d59a655b0d2cd337299326acc1f6e3d4434c3ae2d6c78d32290ca4" "checksum wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" "checksum wayland-commons 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" -"checksum wayland-commons 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "539cdd0c296802332d763ff663739a7f83bdf67b3df58e99fe0215e96a495142" "checksum wayland-protocols 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "4afde2ea2a428eee6d7d2c8584fdbe8b82eee8b6c353e129a434cd6e07f42145" "checksum wayland-protocols 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" -"checksum wayland-protocols 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "79df44471a2e01b61c089472443858062fa64ea60dfd24267848efd7a8f161b6" "checksum wayland-scanner 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3828c568714507315ee425a9529edc4a4aa9901409e373e9e0027e7622b79e" "checksum wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" -"checksum wayland-scanner 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43ea5ea1a117137d72c0c197431d198d69783b5e8ca996b0583c98e10b44d426" "checksum wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" -"checksum wayland-sys 0.24.1 (registry+https://github.com/rust-lang/crates.io-index)" = "537500923d50be11d95a63c4cb538145e4c82edf61296b7debc1f94a1a6514ed" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" "checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" diff --git a/chat-cli/src/main.rs b/chat-cli/src/main.rs index 4b4776dc9c..312094231c 100644 --- a/chat-cli/src/main.rs +++ b/chat-cli/src/main.rs @@ -51,7 +51,7 @@ fn main() { println!("Players online: {:?}", client.get_players()); client - .register(comp::Player::new(username, None), password, |provider| { + .register(username, password, |provider| { provider == "https://auth.veloren.net" }) .unwrap(); diff --git a/client/src/lib.rs b/client/src/lib.rs index 71f69f5444..09841e3fa7 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -175,27 +175,24 @@ impl Client { /// Request a state transition to `ClientState::Registered`. pub fn register( &mut self, - player: comp::Player, + username: String, password: String, mut auth_trusted: impl FnMut(&str) -> bool, ) -> Result<(), Error> { // Authentication - let token_or_username = match &self.server_info.auth_provider { - Some(addr) => { + let token_or_username = self.server_info.auth_provider.as_ref().map(|addr| // Query whether this is a trusted auth server if auth_trusted(&addr) { - authc::AuthClient::new(addr) - .sign_in(&player.alias, &password)? - .serialize() + Ok(authc::AuthClient::new(addr) + .sign_in(&username, &password)? + .serialize()) } else { - return Err(Error::AuthServerNotTrusted); + Err(Error::AuthServerNotTrusted) } - }, - None => player.alias.clone(), - }; + ).unwrap_or(Ok(username))?; self.postbox.send_message(ClientMsg::Register { - player, + view_distance: self.view_distance, token_or_username, }); self.client_state = ClientState::Pending; diff --git a/common/Cargo.toml b/common/Cargo.toml index 219b9aeb61..83f065ac92 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -30,7 +30,7 @@ hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } find_folder = "0.3.0" parking_lot = "0.9.0" crossbeam = "=0.7.2" -notify = "5.0.0-pre.1" +notify = "5.0.0-pre.2" indexmap = "1.3.0" sum_type = "0.2.0" authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } diff --git a/common/src/comp/player.rs b/common/src/comp/player.rs index 2078b0efb8..b7a6aa1a3d 100644 --- a/common/src/comp/player.rs +++ b/common/src/comp/player.rs @@ -1,3 +1,4 @@ +use authc::Uuid; use specs::{Component, FlaggedStorage, NullStorage}; use specs_idvs::IDVStorage; @@ -7,20 +8,26 @@ const MAX_ALIAS_LEN: usize = 32; pub struct Player { pub alias: String, pub view_distance: Option, + uuid: Uuid, } impl Player { - pub fn new(alias: String, view_distance: Option) -> Self { + pub fn new(alias: String, view_distance: Option, uuid: Uuid) -> Self { Self { alias, view_distance, + uuid, } } - pub fn is_valid(&self) -> bool { - self.alias.chars().all(|c| c.is_alphanumeric() || c == '_') - && self.alias.len() <= MAX_ALIAS_LEN + pub fn is_valid(&self) -> bool { Self::alias_is_valid(&self.alias) } + + pub fn alias_is_valid(alias: &str) -> bool { + alias.chars().all(|c| c.is_alphanumeric() || c == '_') && alias.len() <= MAX_ALIAS_LEN } + + /// Not to be confused with uid + pub fn uuid(&self) -> Uuid { self.uuid } } impl Component for Player { diff --git a/common/src/msg/client.rs b/common/src/msg/client.rs index 87ded3f830..962cf40174 100644 --- a/common/src/msg/client.rs +++ b/common/src/msg/client.rs @@ -4,7 +4,7 @@ use vek::*; #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ClientMsg { Register { - player: comp::Player, + view_distance: Option, token_or_username: String, }, Character { diff --git a/server/src/auth_provider.rs b/server/src/auth_provider.rs index 1f6f411198..03c3db9960 100644 --- a/server/src/auth_provider.rs +++ b/server/src/auth_provider.rs @@ -1,6 +1,7 @@ use authc::{AuthClient, AuthToken, Uuid}; use common::msg::RegisterError; use hashbrown::HashMap; +use log::error; use std::str::FromStr; fn derive_uuid(username: &str) -> Uuid { @@ -42,9 +43,13 @@ impl AuthProvider { } } - pub fn logout(&mut self, username: &str) { self.accounts.retain(|_, v| v != username); } + pub fn logout(&mut self, uuid: Uuid) { + if self.accounts.remove(&uuid).is_none() { + error!("Attempted to logout user that is not logged in."); + }; + } - pub fn query(&mut self, username_or_token: String) -> Result<(), RegisterError> { + pub fn query(&mut self, username_or_token: String) -> Result<(String, Uuid), RegisterError> { // Based on whether auth server is provided or not we expect an username or // token match &self.auth_server { @@ -61,9 +66,9 @@ impl AuthProvider { return Err(RegisterError::AlreadyLoggedIn); } // Log in - let username = srv.uuid_to_username(uuid.clone())?; - self.accounts.insert(uuid, username); - Ok(()) + let username = srv.uuid_to_username(uuid)?; + self.accounts.insert(uuid, username.clone()); + Ok((username, uuid)) }, // Username is expected None => { @@ -72,8 +77,8 @@ impl AuthProvider { let uuid = derive_uuid(&username); if !self.accounts.contains_key(&uuid) { log::info!("New User '{}'", username); - self.accounts.insert(uuid, username); - Ok(()) + self.accounts.insert(uuid, username.clone()); + Ok((username, uuid)) } else { Err(RegisterError::AlreadyLoggedIn) } diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index 8d42652867..47d02d23c3 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -122,18 +122,27 @@ impl<'a> System<'a> for Sys { }, ClientState::Pending => {}, }, - // Valid player + // Request registered state (login) ClientMsg::Register { - player, + view_distance, token_or_username, - } if player.is_valid() => { - match accounts.query(token_or_username.clone()) { + } => { + let (username, uuid) = match accounts.query(token_or_username.clone()) { Err(err) => { client.error_state(RequestStateError::RegisterDenied(err)); break; }, - Ok(()) => {}, + Ok((username, uuid)) => (username, uuid), + }; + + let player = Player::new(username, view_distance, uuid); + + if !player.is_valid() { + // Invalid player + client.error_state(RequestStateError::Impossible); + break; } + match client.client_state { ClientState::Connected => { // Add Player component to this client @@ -154,8 +163,6 @@ impl<'a> System<'a> for Sys { } //client.allow_state(ClientState::Registered); }, - // Invalid player - ClientMsg::Register { .. } => client.error_state(RequestStateError::Impossible), ClientMsg::SetViewDistance(view_distance) => match client.client_state { ClientState::Character { .. } => { players @@ -293,7 +300,7 @@ impl<'a> System<'a> for Sys { None, ServerMsg::broadcast(format!("{} went offline.", &player.alias)), )); - accounts.logout(&player.alias); + accounts.logout(player.uuid()); } server_emitter.emit(ServerEvent::ClientDisconnect(entity)); client.postbox.send_message(ServerMsg::Disconnect); diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 26dc674983..87e33fee55 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -1,5 +1,5 @@ use client::{error::Error as ClientError, Client}; -use common::{comp, net::PostError}; +use common::net::PostError; use crossbeam::channel::{unbounded, Receiver, Sender, TryRecvError}; use std::{ net::ToSocketAddrs, @@ -40,7 +40,8 @@ pub struct ClientInit { impl ClientInit { pub fn new( connection_args: (String, u16, bool), - player: comp::Player, + username: String, + view_distance: Option, password: String, ) -> Self { let (server_address, default_port, prefer_ipv6) = connection_args; @@ -72,10 +73,10 @@ impl ClientInit { for socket_addr in first_addrs.clone().into_iter().chain(second_addrs.clone()) { - match Client::new(socket_addr, player.view_distance) { + match Client::new(socket_addr, view_distance) { Ok(mut client) => { if let Err(err) = - client.register(player.clone(), password, |auth_server| { + client.register(username, password, |auth_server| { let _ = tx .send(Msg::IsAuthTrusted(auth_server.to_string())); trust_rx @@ -89,7 +90,7 @@ impl ClientInit { last_err = Some(Error::ClientError(err)); break 'tries; } - let _ = tx.send(Ok(client)); + let _ = tx.send(Msg::Done(Ok(client))); return; }, Err(err) => { diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 7a9c445b90..04b212886b 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -3,13 +3,10 @@ mod client_init; use super::char_selection::CharSelectionState; use crate::{ - i18n::{i18n_asset_key, VoxygenLocalization}, - singleplayer::Singleplayer, - window::Event, - Direction, GlobalState, PlayState, PlayStateResult, + singleplayer::Singleplayer, window::Event, Direction, GlobalState, PlayState, PlayStateResult, }; use client_init::{ClientInit, Error as InitError, Msg as InitMsg}; -use common::{assets::load_expect, clock::Clock, comp}; +use common::{clock::Clock, comp}; use log::{error, warn}; #[cfg(feature = "singleplayer")] use std::time::Duration; @@ -66,7 +63,7 @@ impl PlayState for MainMenuState { // Poll client creation. match client_init.as_ref().and_then(|init| init.poll()) { - Some(Ok(mut client)) => { + Some(InitMsg::Done(Ok(mut client))) => { self.main_menu_ui.connected(); // Register voxygen components / resources crate::ecs::init(client.state_mut().ecs_mut()); @@ -203,9 +200,6 @@ impl PlayState for MainMenuState { }, } } - let localized_strings = load_expect::(&i18n_asset_key( - &global_state.settings.language.selected_language, - )); if let Some(info) = global_state.info_message.take() { self.main_menu_ui.show_info(info); @@ -249,21 +243,17 @@ fn attempt_login( warn!("Failed to save settings: {:?}", err); } - let player = comp::Player::new( - username.clone(), - Some(global_state.settings.graphics.view_distance), - ); - - if player.is_valid() { + if comp::Player::alias_is_valid(&username) { // Don't try to connect if there is already a connection in progress. if client_init.is_none() { *client_init = Some(ClientInit::new( (server_address, server_port, false), - player, + username, + Some(global_state.settings.graphics.view_distance), { password }, )); } } else { - global_state.info_message = Some("Invalid username or password".to_string()); + global_state.info_message = Some("Invalid username".to_string()); } } diff --git a/world/Cargo.toml b/world/Cargo.toml index 9430acc0d9..4dd4c22b71 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -28,5 +28,5 @@ serde_derive = "1.0.102" ron = "0.5.1" [dev-dependencies] -minifb = { git = "https://github.com/emoon/rust_minifb.git" } pretty_env_logger = "0.3.0" +minifb = "0.14.0" From d2e12fd166aecffe5834720270ab836bbb2b39e5 Mon Sep 17 00:00:00 2001 From: Songtronix Date: Sun, 2 Feb 2020 09:05:58 +0100 Subject: [PATCH 102/387] feat(auth): localisation of authentication errors --- assets/voxygen/i18n/en.ron | 14 +++++++- voxygen/src/menu/main/mod.rs | 70 +++++++++++++++++++++++------------- voxygen/src/menu/main/ui.rs | 8 ++--- 3 files changed, 62 insertions(+), 30 deletions(-) diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 459dca3398..a9ab34bd68 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -65,6 +65,8 @@ VoxygenLocalization( "common.disclaimer": "Disclaimer", "common.cancel": "Cancel", "common.none": "None", + "common.error": "Error", + "common.fatal_error": "Fatal Error", // Message when connection to the server is lost "common.connection_lost": r#"Connection lost! @@ -121,7 +123,17 @@ to play on auth-enabled servers. You can create an account over at https://account.veloren.net."#, - + "main.login.server_not_found": "Server not found", + "main.login.authentication_error": "Auth error on server", + "main.login.server_full": "Server is full", + "main.login.untrusted_auth_server": "Auth server not trusted", + "main.login.outdated_client_or_server": "ServerWentMad: Probably versions are incompatible, check for updates.", + "main.login.timeout": "Timeout: Server did not respond in time. (Overloaded or network issues).", + "main.login.server_shut_down": "Server shut down", + "main.login.already_logged_in": "You are already logged into the server.", + "main.login.network_error": "Network error", + "main.login.failed_sending_request": "Request to Auth server failed", + "main.login.client_crashed": "Client crashed", /// End Main screen section diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 04b212886b..145d8e9b16 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -6,7 +6,7 @@ use crate::{ singleplayer::Singleplayer, window::Event, Direction, GlobalState, PlayState, PlayStateResult, }; use client_init::{ClientInit, Error as InitError, Msg as InitMsg}; -use common::{clock::Clock, comp}; +use common::{assets::load_expect, clock::Clock, comp}; use log::{error, warn}; #[cfg(feature = "singleplayer")] use std::time::Duration; @@ -27,8 +27,6 @@ impl MainMenuState { const DEFAULT_PORT: u16 = 14004; -static LOGIN_FAILED_MSG: &str = "If you are having issues signing in. Please note that you now need an account to play on auth-enabled servers.\nYou can create an account over at https://account.veloren.net."; - impl PlayState for MainMenuState { fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult { // Set up an fps clock. @@ -45,6 +43,10 @@ impl PlayState for MainMenuState { // Reset singleplayer server if it was running already global_state.singleplayer = None; + let localized_strings = load_expect::( + &crate::i18n::i18n_asset_key(&global_state.settings.language.selected_language), + ); + loop { // Handle window events. for event in global_state.window.fetch_events(&mut global_state.settings) { @@ -77,39 +79,57 @@ impl PlayState for MainMenuState { global_state.info_message = Some({ let err = match err { InitError::BadAddress(_) | InitError::NoAddress => { - "Server not found".into() + localized_strings.get("main.login.server_not_found").into() }, InitError::ClientError(err) => match err { - client::Error::AuthErr(e) => format!("Auth error on server: {}", e), - client::Error::TooManyPlayers => "Server is full".into(), - client::Error::AuthServerNotTrusted => { - "Auth server not trusted".into() + client::Error::AuthErr(e) => format!( + "{}: {}", + localized_strings.get("main.login.authentication_error"), + e + ), + client::Error::TooManyPlayers => { + localized_strings.get("main.login.server_full").into() }, - client::Error::ServerWentMad => "ServerWentMad: Probably versions \ - are incompatible, check for \ - updates." + client::Error::AuthServerNotTrusted => localized_strings + .get("main.login.untrusted_auth_server") .into(), - client::Error::ServerTimeout => "Timeout: Server did not respond \ - in time. (Overloaded or network \ - issues)." + client::Error::ServerWentMad => localized_strings + .get("main.login.outdated_client_or_server") .into(), - client::Error::ServerShutdown => "Server shut down".into(), + client::Error::ServerTimeout => { + localized_strings.get("main.login.timeout").into() + }, + client::Error::ServerShutdown => { + localized_strings.get("main.login.server_shut_down").into() + }, client::Error::AlreadyLoggedIn => { - "You are already logged into the server.".into() + localized_strings.get("main.login.already_logged_in").into() + }, + client::Error::Network(e) => format!( + "{}: {:?}", + localized_strings.get("main.login.network_error"), + e + ), + client::Error::Other(e) => { + format!("{}: {}", localized_strings.get("common.error"), e) }, - client::Error::Network(e) => format!("Network error: {:?}", e), - client::Error::Other(e) => format!("Error: {}", e), client::Error::AuthClientError(e) => match e { - client::AuthClientError::JsonError(e) => { - format!("Fatal error: {}", e) - }, - client::AuthClientError::RequestError(_) => { - LOGIN_FAILED_MSG.into() - }, + client::AuthClientError::JsonError(e) => format!( + "{}: {}", + localized_strings.get("common.fatal_error"), + e + ), + client::AuthClientError::RequestError(_) => format!( + "{}: {}", + localized_strings.get("main.login.failed_sending_request"), + e + ), client::AuthClientError::ServerError(_, e) => format!("{}", e), }, }, - InitError::ClientCrashed => "Client crashed".into(), + InitError::ClientCrashed => { + localized_strings.get("main.login.client_crashed").into() + }, }; // Log error for possible additional use later or incase that the error // displayed is cut of. diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index b323be9169..e0fd515c89 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -364,16 +364,16 @@ impl MainMenuUi { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .label_y(Relative::Scalar(2.0)) - .label("Add") - .label_font_id(self.fonts.cyri.conrod_id) - .label_font_size(self.fonts.cyri.scale(15)) + .label("Add") // TODO: localize + .label_font_id(self.fonts.cyri) + .label_font_size(15) .label_color(TEXT_COLOR) .set(self.ids.button_add_auth_trust, ui_widgets) .was_clicked() { events.push(Event::AuthServerTrust(auth_server.clone(), true)); change_popup = Some(Some(PopupData { - msg: "Connecting...".to_string(), + msg: localized_strings.get("main.connecting").into(), popup_type: PopupType::ConnectionInfo, })); } From 0022f8464d2b504a6db1db7a5a9f54ca7154d4c9 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 22 Feb 2020 13:35:25 -0500 Subject: [PATCH 103/387] Update auth --- Cargo.lock | 569 ++---------------------------------- voxygen/src/menu/main/ui.rs | 6 +- 2 files changed, 21 insertions(+), 554 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80411e8e72..81d5bdc3d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,17 +137,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" -dependencies = [ - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "auth-common" -version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" +source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -157,9 +147,9 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" +source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -168,19 +158,6 @@ dependencies = [ "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "authc" -version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" -dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", - "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "autocfg" version = "0.1.7" @@ -286,25 +263,6 @@ name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "brotli-sys" version = "0.3.2" @@ -348,11 +306,6 @@ name = "bumpalo" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "byteorder" version = "0.5.3" @@ -363,16 +316,6 @@ name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bytes" version = "0.5.4" @@ -558,9 +501,9 @@ dependencies = [ [[package]] name = "conrod_core" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git#bbc8a5efd2760669754f866fd7ee556d381e2c0e" +source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" dependencies = [ - "conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", + "conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)", "copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "daggy 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -573,7 +516,7 @@ dependencies = [ [[package]] name = "conrod_derive" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git#bbc8a5efd2760669754f866fd7ee556d381e2c0e" +source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -583,7 +526,7 @@ dependencies = [ [[package]] name = "conrod_winit" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git#bbc8a5efd2760669754f866fd7ee556d381e2c0e" +source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" [[package]] name = "const-random" @@ -608,32 +551,6 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "copypasta" version = "0.6.0" @@ -921,14 +838,6 @@ name = "deunicode" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "directories" version = "2.0.2" @@ -1026,14 +935,6 @@ dependencies = [ "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "error-chain" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "euc" version = "0.3.0" @@ -1112,17 +1013,6 @@ name = "fixedbitset" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "flate2" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fnv" version = "1.0.6" @@ -1177,11 +1067,6 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "futures-channel" version = "0.3.4" @@ -1195,15 +1080,6 @@ name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "futures-io" version = "0.3.4" @@ -1315,14 +1191,6 @@ dependencies = [ "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "getrandom" version = "0.1.13" @@ -1630,23 +1498,6 @@ dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "h2" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "h2" version = "0.2.2" @@ -1703,16 +1554,6 @@ name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "http" version = "0.2.0" @@ -1723,17 +1564,6 @@ dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "http-body" version = "0.3.1" @@ -1756,35 +1586,6 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hyper" -version = "0.12.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hyper" version = "0.13.3" @@ -1808,22 +1609,6 @@ dependencies = [ "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hyper-rustls" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hyper-rustls" version = "0.20.0" @@ -1962,11 +1747,6 @@ dependencies = [ "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "kernel32-sys" version = "0.2.2" @@ -2193,14 +1973,6 @@ dependencies = [ "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "miniz_oxide" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "mio" version = "0.6.21" @@ -2479,11 +2251,6 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "openssl-probe" version = "0.1.2" @@ -2828,18 +2595,6 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "quick-error" version = "1.2.2" @@ -3138,41 +2893,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "reqwest" -version = "0.9.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "reqwest" version = "0.10.4" @@ -3314,18 +3034,6 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rustls" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", - "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustls" version = "0.17.0" @@ -3510,17 +3218,6 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_urlencoded" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_urlencoded" version = "0.6.1" @@ -3537,18 +3234,6 @@ name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "sha3" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "shared_library" version = "0.1.9" @@ -3707,14 +3392,6 @@ name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sum_type" version = "0.2.0" @@ -3859,24 +3536,6 @@ dependencies = [ "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio" version = "0.2.13" @@ -3893,75 +3552,6 @@ dependencies = [ "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-rustls" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-rustls" version = "0.13.0" @@ -3973,55 +3563,6 @@ dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-sync" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-util" version = "0.2.0" @@ -4061,14 +3602,6 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "try_from" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tuple_utils" version = "0.3.0" @@ -4082,11 +3615,6 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "typenum" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicase" version = "1.4.2" @@ -4210,7 +3738,7 @@ dependencies = [ name = "veloren-client" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4226,7 +3754,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4258,7 +3786,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4295,12 +3823,12 @@ dependencies = [ name = "veloren-voxygen" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", - "conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", + "conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)", + "conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)", "cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4395,16 +3923,6 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "want" version = "0.3.0" @@ -4606,14 +4124,6 @@ dependencies = [ "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "webpki-roots" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "webpki-roots" version = "0.18.0" @@ -4775,10 +4285,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" @@ -4792,17 +4300,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" "checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" "checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" -"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" @@ -4824,14 +4328,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" "checksum color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" "checksum colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "433e7ac7d511768127ed85b0c4947f47a254131e37864b2dc13f52aa32cd37e5" -"checksum conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" -"checksum conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" -"checksum conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" +"checksum conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)" = "" +"checksum conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)" = "" +"checksum conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)" = "" "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" -"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" @@ -4861,7 +4363,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" "checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" -"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" @@ -4874,7 +4375,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" "checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" "checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" "checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" @@ -4884,7 +4384,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -4893,10 +4392,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" "checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" @@ -4907,7 +4404,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" "checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" -"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" "checksum gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" "checksum gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" @@ -4936,22 +4432,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" -"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" -"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" -"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" "checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" -"checksum hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" "checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" @@ -4967,7 +4458,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" "checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" -"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -4996,7 +4486,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" "checksum minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799c20458eb0dd69f48cea5014afe736b363818c86d7ca61dbb56e1c0585014c" -"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" @@ -5024,7 +4513,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" "checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" "checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" -"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" @@ -5066,7 +4554,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" @@ -5101,7 +4588,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" -"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" @@ -5112,7 +4598,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" "checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" @@ -5134,10 +4619,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" -"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" @@ -5157,7 +4640,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" -"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" "checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" @@ -5174,28 +4656,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" -"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" "checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" -"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -"checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -"checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -"checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -"checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -"checksum tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" "checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" -"checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -"checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -"checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -"checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" "checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" "checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" @@ -5214,7 +4683,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" @@ -5235,7 +4703,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" -"checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" "checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index e0fd515c89..4859783c59 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -365,15 +365,15 @@ impl MainMenuUi { .press_image(self.imgs.button_press) .label_y(Relative::Scalar(2.0)) .label("Add") // TODO: localize - .label_font_id(self.fonts.cyri) - .label_font_size(15) + .label_font_id(self.fonts.cyri.conrod_id) + .label_font_size(self.fonts.cyri.scale(15)) .label_color(TEXT_COLOR) .set(self.ids.button_add_auth_trust, ui_widgets) .was_clicked() { events.push(Event::AuthServerTrust(auth_server.clone(), true)); change_popup = Some(Some(PopupData { - msg: localized_strings.get("main.connecting").into(), + msg: self.voxygen_i18n.get("main.connecting").into(), popup_type: PopupType::ConnectionInfo, })); } From 8d7c45402959acb5e3f476723b7c323d21bab25d Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 22 Feb 2020 21:37:12 -0500 Subject: [PATCH 104/387] Hide password text --- Cargo.lock | 551 +++++++++++++++++++++++++++++++++++- voxygen/Cargo.toml | 4 +- voxygen/src/menu/main/ui.rs | 1 + 3 files changed, 545 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81d5bdc3d3..34f02d0066 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,7 +137,17 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" +source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" +dependencies = [ + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "auth-common" +version = "0.1.0" +source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -147,9 +157,9 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" +source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -158,6 +168,19 @@ dependencies = [ "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "authc" +version = "1.0.0" +source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" +dependencies = [ + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "autocfg" version = "0.1.7" @@ -263,6 +286,25 @@ name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "brotli-sys" version = "0.3.2" @@ -306,6 +348,11 @@ name = "bumpalo" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "0.5.3" @@ -316,6 +363,16 @@ name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "bytes" version = "0.5.4" @@ -551,6 +608,32 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "cookie" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "copypasta" version = "0.6.0" @@ -838,6 +921,14 @@ name = "deunicode" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "directories" version = "2.0.2" @@ -935,6 +1026,14 @@ dependencies = [ "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "error-chain" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "euc" version = "0.3.0" @@ -1013,6 +1112,17 @@ name = "fixedbitset" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "flate2" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fnv" version = "1.0.6" @@ -1067,6 +1177,11 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "futures-channel" version = "0.3.4" @@ -1080,6 +1195,15 @@ name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "futures-io" version = "0.3.4" @@ -1191,6 +1315,14 @@ dependencies = [ "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "getrandom" version = "0.1.13" @@ -1498,6 +1630,23 @@ dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "h2" version = "0.2.2" @@ -1554,6 +1703,16 @@ name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "http" version = "0.2.0" @@ -1564,6 +1723,17 @@ dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "http-body" version = "0.3.1" @@ -1586,6 +1756,35 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hyper" +version = "0.12.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hyper" version = "0.13.3" @@ -1609,6 +1808,22 @@ dependencies = [ "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hyper-rustls" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hyper-rustls" version = "0.20.0" @@ -1747,6 +1962,11 @@ dependencies = [ "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1973,6 +2193,14 @@ dependencies = [ "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "miniz_oxide" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio" version = "0.6.21" @@ -2251,6 +2479,11 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "openssl-probe" version = "0.1.2" @@ -2595,6 +2828,18 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "publicsuffix" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quick-error" version = "1.2.2" @@ -2893,6 +3138,41 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "reqwest" +version = "0.9.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "reqwest" version = "0.10.4" @@ -3034,6 +3314,18 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rustls" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustls" version = "0.17.0" @@ -3218,6 +3510,17 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_urlencoded" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "serde_urlencoded" version = "0.6.1" @@ -3234,6 +3537,18 @@ name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "shared_library" version = "0.1.9" @@ -3392,6 +3707,14 @@ name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sum_type" version = "0.2.0" @@ -3536,6 +3859,24 @@ dependencies = [ "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tokio" version = "0.2.13" @@ -3552,6 +3893,75 @@ dependencies = [ "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-rustls" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tokio-rustls" version = "0.13.0" @@ -3563,6 +3973,55 @@ dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio-sync" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tokio-util" version = "0.2.0" @@ -3602,6 +4061,14 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "try_from" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tuple_utils" version = "0.3.0" @@ -3615,6 +4082,11 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "typenum" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicase" version = "1.4.2" @@ -3738,7 +4210,7 @@ dependencies = [ name = "veloren-client" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3754,7 +4226,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3786,7 +4258,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3823,7 +4295,7 @@ dependencies = [ name = "veloren-voxygen" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3923,6 +4395,16 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "want" version = "0.3.0" @@ -4124,6 +4606,14 @@ dependencies = [ "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "webpki-roots" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "webpki-roots" version = "0.18.0" @@ -4285,8 +4775,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" @@ -4300,13 +4792,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" "checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" "checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" @@ -4334,6 +4830,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" @@ -4363,6 +4861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" "checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" @@ -4375,6 +4874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" "checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" "checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" "checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" @@ -4384,6 +4884,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" +"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -4392,8 +4893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" "checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" @@ -4404,6 +4907,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" "checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" "checksum gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" "checksum gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" @@ -4432,17 +4936,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" +"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" +"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" +"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" "checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" +"checksum hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" "checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" @@ -4458,6 +4967,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" "checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" +"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -4486,6 +4996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" "checksum minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799c20458eb0dd69f48cea5014afe736b363818c86d7ca61dbb56e1c0585014c" +"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" @@ -4513,6 +5024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" "checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" "checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" @@ -4554,6 +5066,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" +"checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" @@ -4588,6 +5101,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" +"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" @@ -4598,6 +5112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" "checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" @@ -4619,8 +5134,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" +"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" @@ -4640,6 +5157,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" "checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" @@ -4656,15 +5174,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" +"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" "checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" +"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +"checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +"checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +"checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +"checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +"checksum tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" "checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" +"checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +"checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +"checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +"checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" "checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" "checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" +"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" @@ -4683,6 +5214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" +"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" @@ -4703,6 +5235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" +"checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" "checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 49939b5767..c7ad82331f 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -24,8 +24,8 @@ gfx_device_gl = { version = "0.16.2", optional = true } gfx_window_glutin = "0.31.0" glutin = "0.21.1" winit = { version = "0.19.4", features = ["serde"] } -conrod_core = { git = "https://gitlab.com/veloren/conrod.git" } -conrod_winit = { git = "https://gitlab.com/veloren/conrod.git" } +conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "hide_text" } +conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "hide_text" } euc = "0.3.0" # ECS diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 4859783c59..8832cc7e59 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -536,6 +536,7 @@ impl MainMenuUi { // transparent background .color(TRANSPARENT) .border_color(TRANSPARENT) + .hide_text("*") .set(self.ids.password_field, ui_widgets) { match event { From 0e86197ebe4ea08ed85a689547a16d8e46fa6d73 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 22 Feb 2020 21:39:18 -0500 Subject: [PATCH 105/387] Move changelog entry back up to the unreleased section --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5177faaf..37648ad8bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New attack animation - weapon control system - Game pauses when in singleplayer and pause menu +- Added authentication system (to play on the official server register on https://account.veloren.net) ### Changed @@ -80,7 +81,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Overhauled NPC AI - Pets now attack enemies and defend their owners - Added collars to tame wild animals -- Added authentication system (to play on the official server register on https://account.veloren.net) ### Changed From bc39b781732562681659bac252f2d2bb6325722e Mon Sep 17 00:00:00 2001 From: Acrimon Date: Sun, 8 Mar 2020 21:59:49 +0100 Subject: [PATCH 106/387] Rebased. --- Cargo.lock | 551 +-------------------------------------------- client/Cargo.toml | 2 +- common/Cargo.toml | 2 +- server/Cargo.toml | 2 +- voxygen/Cargo.toml | 2 +- 5 files changed, 13 insertions(+), 546 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34f02d0066..81d5bdc3d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,17 +137,7 @@ dependencies = [ [[package]] name = "auth-common" version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" -dependencies = [ - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "auth-common" -version = "0.1.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" +source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -157,9 +147,9 @@ dependencies = [ [[package]] name = "authc" version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e#0f7efccdcce2089a6997653d36178705ade5749e" +source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -168,19 +158,6 @@ dependencies = [ "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "authc" -version = "1.0.0" -source = "git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad#7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" -dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", - "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "autocfg" version = "0.1.7" @@ -286,25 +263,6 @@ name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "brotli-sys" version = "0.3.2" @@ -348,11 +306,6 @@ name = "bumpalo" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "byteorder" version = "0.5.3" @@ -363,16 +316,6 @@ name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bytes" version = "0.5.4" @@ -608,32 +551,6 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "copypasta" version = "0.6.0" @@ -921,14 +838,6 @@ name = "deunicode" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "directories" version = "2.0.2" @@ -1026,14 +935,6 @@ dependencies = [ "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "error-chain" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "euc" version = "0.3.0" @@ -1112,17 +1013,6 @@ name = "fixedbitset" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "flate2" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fnv" version = "1.0.6" @@ -1177,11 +1067,6 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "futures-channel" version = "0.3.4" @@ -1195,15 +1080,6 @@ name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "futures-io" version = "0.3.4" @@ -1315,14 +1191,6 @@ dependencies = [ "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "getrandom" version = "0.1.13" @@ -1630,23 +1498,6 @@ dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "h2" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "h2" version = "0.2.2" @@ -1703,16 +1554,6 @@ name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "http" version = "0.2.0" @@ -1723,17 +1564,6 @@ dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "http-body" version = "0.3.1" @@ -1756,35 +1586,6 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hyper" -version = "0.12.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hyper" version = "0.13.3" @@ -1808,22 +1609,6 @@ dependencies = [ "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hyper-rustls" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hyper-rustls" version = "0.20.0" @@ -1962,11 +1747,6 @@ dependencies = [ "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "kernel32-sys" version = "0.2.2" @@ -2193,14 +1973,6 @@ dependencies = [ "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "miniz_oxide" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "mio" version = "0.6.21" @@ -2479,11 +2251,6 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "openssl-probe" version = "0.1.2" @@ -2828,18 +2595,6 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "quick-error" version = "1.2.2" @@ -3138,41 +2893,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "reqwest" -version = "0.9.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "reqwest" version = "0.10.4" @@ -3314,18 +3034,6 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rustls" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", - "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustls" version = "0.17.0" @@ -3510,17 +3218,6 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_urlencoded" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_urlencoded" version = "0.6.1" @@ -3537,18 +3234,6 @@ name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "sha3" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "shared_library" version = "0.1.9" @@ -3707,14 +3392,6 @@ name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sum_type" version = "0.2.0" @@ -3859,24 +3536,6 @@ dependencies = [ "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio" version = "0.2.13" @@ -3893,75 +3552,6 @@ dependencies = [ "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-rustls" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-rustls" version = "0.13.0" @@ -3973,55 +3563,6 @@ dependencies = [ "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-sync" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-util" version = "0.2.0" @@ -4061,14 +3602,6 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "try_from" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tuple_utils" version = "0.3.0" @@ -4082,11 +3615,6 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "typenum" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicase" version = "1.4.2" @@ -4210,7 +3738,7 @@ dependencies = [ name = "veloren-client" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4226,7 +3754,7 @@ dependencies = [ name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4258,7 +3786,7 @@ dependencies = [ name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4295,7 +3823,7 @@ dependencies = [ name = "veloren-voxygen" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)", + "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4395,16 +3923,6 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "want" version = "0.3.0" @@ -4606,14 +4124,6 @@ dependencies = [ "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "webpki-roots" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "webpki-roots" version = "0.18.0" @@ -4775,10 +4285,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=0f7efccdcce2089a6997653d36178705ade5749e)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad)" = "" +"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" +"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" @@ -4792,17 +4300,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" "checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" "checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" -"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" @@ -4830,8 +4334,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" -"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" @@ -4861,7 +4363,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" "checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" -"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" @@ -4874,7 +4375,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" "checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" "checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" "checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" @@ -4884,7 +4384,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -4893,10 +4392,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" "checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" @@ -4907,7 +4404,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" "checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" -"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" "checksum gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" "checksum gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" @@ -4936,22 +4432,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" "checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" "checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" -"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" "checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" -"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" -"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" "checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" -"checksum hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" "checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" @@ -4967,7 +4458,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" "checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" -"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -4996,7 +4486,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" "checksum minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799c20458eb0dd69f48cea5014afe736b363818c86d7ca61dbb56e1c0585014c" -"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" @@ -5024,7 +4513,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" "checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" "checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" -"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" @@ -5066,7 +4554,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" @@ -5101,7 +4588,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" -"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" @@ -5112,7 +4598,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" "checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" @@ -5134,10 +4619,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" -"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" @@ -5157,7 +4640,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" -"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" "checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" @@ -5174,28 +4656,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" -"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" "checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" -"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -"checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -"checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -"checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -"checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -"checksum tokio-rustls 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" "checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" -"checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -"checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -"checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -"checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" "checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" "checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" @@ -5214,7 +4683,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" @@ -5235,7 +4703,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" -"checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" "checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" diff --git a/client/Cargo.toml b/client/Cargo.toml index 671d5c2a11..9d649f0b01 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,4 +15,4 @@ log = "0.4.8" specs = "0.15.1" vek = { version = "0.9.9", features = ["serde"] } hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } diff --git a/common/Cargo.toml b/common/Cargo.toml index 83f065ac92..f70c8c1b6c 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -33,7 +33,7 @@ crossbeam = "=0.7.2" notify = "5.0.0-pre.2" indexmap = "1.3.0" sum_type = "0.2.0" -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } [dev-dependencies] criterion = "0.3" diff --git a/server/Cargo.toml b/server/Cargo.toml index aaccf0a24a..c86adf42d8 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -31,4 +31,4 @@ prometheus = "0.7" prometheus-static-metric = "0.2" rouille = "3.0.0" portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "0f7efccdcce2089a6997653d36178705ade5749e" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index c7ad82331f..a4e5c7cff5 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -63,7 +63,7 @@ chrono = "0.4.9" bincode = "1.2" deunicode = "1.0" uvth = "3.1.1" -authc = { git = "https://gitlab.com/veloren/auth.git", rev = "7c1abde83f0ea7d83b0e7c655fac82eb9bb3d7ad" } +authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } [target.'cfg(target_os = "macos")'.dependencies] dispatch = "0.1.4" From 344bb955a2e996b79c7f0cbac4b8d902d0794d75 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 8 Mar 2020 21:28:45 -0700 Subject: [PATCH 107/387] rename get_tool_data to unwrap_tool_data --- common/src/states/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index b8d5656db5..0ac68c525e 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -238,7 +238,7 @@ pub fn attempt_dodge_ability(data: &JoinData, update: &mut StateUpdate) { pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) -> CharacterState { match ability_state { AbilityState::BasicAttack { .. } => { - if let Some(tool) = get_tool_data(data) { + if let Some(tool) = unwrap_tool_data(data) { CharacterState::BasicAttack { exhausted: false, remaining_duration: tool.attack_duration(), @@ -255,7 +255,7 @@ pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) remaining_duration: Duration::from_millis(600), }, AbilityState::TripleAttack { .. } => { - if let Some(tool) = get_tool_data(data) { + if let Some(tool) = unwrap_tool_data(data) { CharacterState::TripleAttack { tool, stage: 1, @@ -273,7 +273,7 @@ pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState) } } -pub fn get_tool_data(data: &JoinData) -> Option { +pub fn unwrap_tool_data(data: &JoinData) -> Option { if let Some(Tool(tool)) = data.stats.equipment.main.as_ref().map(|i| i.kind) { Some(tool) } else { From 1cbd07d5e598216a3c8e89fcb8d1f3af459c116d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Mon, 9 Mar 2020 11:49:57 +0100 Subject: [PATCH 108/387] regenerated Cargo.lock, requiering 7 less dependent crates and greatly reducing size of cargo.lock file --- Cargo.lock | 3697 ++++++++++++++++++++++++++-------------------------- 1 file changed, 1835 insertions(+), 1862 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81d5bdc3d3..a7da69e687 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,134 +4,153 @@ name = "adler32" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" [[package]] name = "ahash" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" dependencies = [ - "const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "const-random", ] [[package]] name = "aho-corasick" -version = "0.7.6" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] name = "alsa-sys" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "pkg-config", ] [[package]] name = "andrew" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "line_drawing", + "rusttype 0.7.9", + "walkdir", + "xdg", + "xml-rs", ] [[package]] name = "android_glue" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" [[package]] name = "anymap" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" [[package]] name = "approx" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" [[package]] name = "approx" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11", ] [[package]] name = "arr_macro" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a105bfda48707cf19220129e78fca01e9639433ffaef4163546ed8fb04120a5" dependencies = [ - "arr_macro_impl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "arr_macro_impl", + "proc-macro-hack", ] [[package]] name = "arr_macro_impl" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" dependencies = [ - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack", + "quote 1.0.3", + "syn 1.0.16", ] [[package]] name = "arrayref" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" dependencies = [ - "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "nodrop", ] [[package]] name = "arrayvec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "ascii" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" [[package]] name = "atk-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", ] [[package]] name = "atom" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" [[package]] name = "atty" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi", + "libc", + "winapi 0.3.8", ] [[package]] @@ -139,9 +158,9 @@ name = "auth-common" version = "0.1.0" source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" dependencies = [ - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3", + "serde", + "uuid", ] [[package]] @@ -149,353 +168,392 @@ name = "authc" version = "1.0.0" source = "git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97#65571ade0d954a0e0bd995fdb314854ff146ab97" dependencies = [ - "auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", - "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "auth-common", + "fxhash", + "hex", + "reqwest", + "rust-argon2 0.6.1", + "serde_json", + "uuid", ] [[package]] name = "autocfg" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "backtrace" -version = "0.3.40" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8" dependencies = [ - "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys", + "cfg-if", + "libc", + "rustc-demangle", ] [[package]] name = "backtrace-sys" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17b52e737c40a7d75abca20b29a19a0eb7ba9fc72c5a72dd282a0a3c2c0dc35" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", ] [[package]] name = "base64" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "safemem", ] [[package]] name = "base64" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", ] [[package]] name = "base64" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] name = "bincode" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "serde", ] [[package]] name = "bindgen" version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "cexpr", + "cfg-if", + "clang-sys", + "lazy_static", + "peeking_take_while", + "proc-macro2 1.0.9", + "quote 1.0.3", + "regex", + "rustc-hash", + "shlex", ] [[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" [[package]] name = "blake2b_simd" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" dependencies = [ - "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayref", + "arrayvec 0.5.1", + "constant_time_eq", ] [[package]] name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "brotli-sys" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", ] [[package]] name = "brotli2" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" dependencies = [ - "brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "brotli-sys", + "libc", ] [[package]] name = "bstr" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502ae1441a0a5adb8fbd38a5955a6416b9493e92b465de5e4a9bde6a539c2c48" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "memchr", + "regex-automata", + "serde", ] [[package]] name = "buf_redux" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", + "safemem", ] [[package]] name = "bumpalo" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" [[package]] name = "byteorder" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" [[package]] name = "byteorder" -version = "1.3.2" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" [[package]] name = "c2-chacha" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" dependencies = [ - "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86", ] [[package]] name = "c_vec" version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" [[package]] name = "cairo-rs" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" dependencies = [ - "c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "c_vec", + "cairo-sys-rs", + "glib", + "glib-sys", + "libc", ] [[package]] name = "cairo-sys-rs" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0395175ecba60accac076a02c31d143b9dcd9d5eb5316d7163a3273803b765c7" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "pkg-config", + "winapi 0.3.8", ] [[package]] name = "cast" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version", ] [[package]] name = "cc" -version = "1.0.47" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" dependencies = [ - "jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "jobserver", ] [[package]] name = "cexpr" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" dependencies = [ - "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "nom", ] [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cgl" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" dependencies = [ - "gleam 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam", + "libc", ] [[package]] name = "chashmap" version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff41a3c2c1e39921b9003de14bf0439c7b63a9039637c291e1a64925d8ddfa45" dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "owning_ref", + "parking_lot 0.4.8", ] [[package]] name = "chrono" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" dependencies = [ - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer", + "num-traits 0.2.11", + "time", ] [[package]] name = "chunked_transfer" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" [[package]] name = "clang-sys" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" dependencies = [ - "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "glob", + "libc", + "libloading", ] [[package]] name = "clap" version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "textwrap", + "unicode-width", ] [[package]] name = "clipboard-win" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a093d6fed558e5fe24c3dfc85a68bb68f1c824f440d3ba5aca189e2998786b" dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8", ] [[package]] name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] [[package]] name = "cocoa" version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1706996401131526e36b3b49f0c4d912639ce110996f3ca144d78946727bce54" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "block", + "core-foundation 0.6.4", + "core-graphics", + "foreign-types", + "libc", + "objc", ] [[package]] name = "cocoa" version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "block", + "core-foundation 0.6.4", + "core-graphics", + "foreign-types", + "libc", + "objc", ] [[package]] name = "color_quant" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" [[package]] name = "colored" -version = "1.9.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "atty", + "lazy_static", + "winapi 0.3.8", ] [[package]] @@ -503,14 +561,14 @@ name = "conrod_core" version = "0.63.0" source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" dependencies = [ - "conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)", - "copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "daggy 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "instant 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pistoncore-input 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", + "conrod_derive", + "copypasta", + "daggy", + "fnv", + "instant", + "num 0.2.1", + "pistoncore-input", + "rusttype 0.7.9", ] [[package]] @@ -518,9 +576,9 @@ name = "conrod_derive" version = "0.63.0" source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -530,955 +588,1057 @@ source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122df [[package]] name = "const-random" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" dependencies = [ - "const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "const-random-macro", + "proc-macro-hack", ] [[package]] name = "const-random-macro" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" dependencies = [ - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "proc-macro-hack", ] [[package]] name = "constant_time_eq" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "copypasta" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1fcbfb17a41091ba8bad1233d0178fda058968a71998dde3f11189f0b4aa9da" dependencies = [ - "clipboard-win 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smithay-clipboard 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-clipboard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clipboard-win", + "objc", + "objc-foundation", + "objc_id", + "smithay-clipboard", + "wayland-client 0.23.6", + "x11-clipboard", ] [[package]] name = "core-foundation" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" dependencies = [ - "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.6.2", + "libc", ] [[package]] name = "core-foundation" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0", + "libc", ] [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" [[package]] name = "core-foundation-sys" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-graphics" version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "core-foundation 0.6.4", + "foreign-types", + "libc", ] [[package]] name = "coreaudio-rs" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "coreaudio-sys", ] [[package]] name = "coreaudio-sys" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" dependencies = [ - "bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen", ] [[package]] name = "cpal" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded070249be850b5b59e1e3a44a70b8ae395e0e5c65b487131d8909a8208120" dependencies = [ - "alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "alsa-sys", + "core-foundation-sys 0.6.2", + "coreaudio-rs", + "failure", + "lazy_static", + "libc", + "num-traits 0.2.11", + "stdweb", + "winapi 0.3.8", ] [[package]] name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "criterion" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "atty", + "cast", + "clap", + "criterion-plot", + "csv", + "itertools", + "lazy_static", + "num-traits 0.2.11", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", ] [[package]] name = "criterion-plot" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545" dependencies = [ - "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cast", + "itertools", ] [[package]] name = "crossbeam" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d818a4990769aac0c7ff1360e233ef3a41adcb009ebb2036bf6915eb0f6b23c" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "crossbeam-channel 0.3.9", + "crossbeam-deque", + "crossbeam-epoch 0.7.2", + "crossbeam-queue 0.1.2", + "crossbeam-utils 0.6.6", ] [[package]] name = "crossbeam-channel" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6", ] [[package]] name = "crossbeam-channel" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] name = "crossbeam-deque" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" dependencies = [ - "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] name = "crossbeam-epoch" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" dependencies = [ - "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.12", + "cfg-if", + "crossbeam-utils 0.6.6", + "lazy_static", + "memoffset", + "scopeguard", ] [[package]] name = "crossbeam-epoch" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "cfg-if", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", ] [[package]] name = "crossbeam-queue" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6", ] [[package]] name = "crossbeam-queue" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "crossbeam-utils 0.7.2", ] [[package]] name = "crossbeam-utils" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "lazy_static", ] [[package]] name = "crossbeam-utils" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "cfg-if", + "lazy_static", ] [[package]] name = "csv" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" dependencies = [ - "bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "bstr", + "csv-core", + "itoa", + "ryu", + "serde", ] [[package]] name = "csv-core" -version = "0.1.6" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] name = "ct-logs" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" dependencies = [ - "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sct", ] [[package]] name = "daggy" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9293a0da7d1bc1f30090ece4d9f9de79a07be7302ddb00e5eb1fefb6ee6409e2" dependencies = [ - "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", + "petgraph", ] [[package]] name = "deflate" version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "adler32", + "byteorder 1.3.4", + "gzip-header", ] [[package]] name = "derivative" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] name = "deunicode" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "307dde1a517939465bc4042b47377284a56cee6160f8066f1f5035eb7b25a3fc" [[package]] name = "directories" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "dirs-sys", ] [[package]] name = "dirs" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "redox_users", + "winapi 0.3.8", ] [[package]] name = "dirs-sys" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "redox_users", + "winapi 0.3.8", ] [[package]] name = "dispatch" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" [[package]] name = "dlib" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" dependencies = [ - "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading", ] [[package]] name = "dot_vox" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c18405ef54de0398b77a3ec8394d3a1639e7bf060e1385201e8db40c44ab41" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "lazy_static", + "log 0.4.8", + "nom", ] [[package]] name = "downcast-rs" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" [[package]] name = "draw_state" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] [[package]] name = "dtoa" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" [[package]] name = "either" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" [[package]] name = "encoding_rs" version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "env_logger" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "atty", + "humantime", + "log 0.4.8", + "regex", + "termcolor", ] [[package]] name = "euc" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" dependencies = [ - "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "vek", ] [[package]] name = "euclid" version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" dependencies = [ - "euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid_macros", + "num-traits 0.2.11", ] [[package]] name = "euclid_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] name = "failure" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" dependencies = [ - "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace", + "failure_derive", ] [[package]] name = "failure_derive" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", + "synstructure", ] [[package]] name = "fern" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e69ab0d5aca163e388c3a49d284fed6c3d0810700e77c5ae2756a50ec1a4daaa" dependencies = [ - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono", + "colored", + "log 0.4.8", ] [[package]] name = "filetime" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.8", ] [[package]] name = "find_folder" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" [[package]] name = "fixedbitset" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" [[package]] name = "fnv" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types-shared", ] [[package]] name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fsevent" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1616e68919f49d311720c3cf316e0a3522d8f2bd08f8da35f6b8a0fa12f9234b" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fsevent-sys 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "fsevent-sys", ] [[package]] name = "fsevent-sys" version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41f1722e9bf862f62429d192f37d0c82c589aa18783aa06f0c4e5c3c90649fb" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "fuchsia-zircon-sys", ] [[package]] name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures-channel" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", ] [[package]] name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" [[package]] name = "futures-io" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" [[package]] name = "futures-macro" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" dependencies = [ - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", ] [[package]] name = "futures-sink" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" [[package]] name = "futures-task" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" [[package]] name = "futures-util" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", + "futures-io", + "futures-macro", + "futures-task", + "memchr", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", ] [[package]] name = "fxhash" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", ] [[package]] name = "gdk" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "cairo-rs", + "cairo-sys-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "glib-sys", + "gobject-sys", + "libc", + "pango", ] [[package]] name = "gdk-pixbuf" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" dependencies = [ - "gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "gdk-pixbuf-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "libc", ] [[package]] name = "gdk-pixbuf-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", ] [[package]] name = "gdk-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", ] [[package]] name = "getrandom" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "wasi", ] [[package]] name = "gfx" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" dependencies = [ - "draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "draw_state", + "gfx_core", + "log 0.4.8", ] [[package]] name = "gfx_core" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "draw_state", + "log 0.4.8", ] [[package]] name = "gfx_device_gl" version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c385fa380c18888633aa27d1e16cbae518469702a2f69dcb5f52d5378bebc" dependencies = [ - "gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx_gl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx_core", + "gfx_gl", + "log 0.4.8", ] [[package]] name = "gfx_gl" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d38164670920cfb7491bc0cf6f49f0554bd1c44cdbedc6c78d2bf91691ff5e" dependencies = [ - "gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.14.0", ] [[package]] name = "gfx_window_glutin" version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310ff66f08b5a55854b18fea2f48bdbb75c94458207ba574c9723be78e97a646" dependencies = [ - "gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx_device_gl 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx_core", + "gfx_device_gl", + "glutin", ] [[package]] name = "gif" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" dependencies = [ - "color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "color_quant", + "lzw", ] [[package]] name = "gio" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db9fad8f1b0d4c7338a210a6cbdf081dcc1a3c223718c698c4f313f6c288acb" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "lazy_static", + "libc", ] [[package]] name = "gio-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a57872499171d279f8577ce83837da4cae62b08dd32892236ed67ab7ea61030" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", ] [[package]] name = "git2" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c1af51ea8a906616af45a4ce78eacf25860f7a13ae7bf8a814693f0f4037a26" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gl_generator" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "libc", + "libgit2-sys", + "log 0.4.8", + "openssl-probe", + "openssl-sys", + "url 2.1.1", ] [[package]] name = "gl_generator" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" dependencies = [ - "khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "khronos_api", + "log 0.4.8", + "xml-rs", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log 0.4.8", + "xml-rs", ] [[package]] name = "gleam" version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5" dependencies = [ - "gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.13.1", ] [[package]] name = "glib" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "glib-sys", + "gobject-sys", + "lazy_static", + "libc", ] [[package]] name = "glib-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "libc", + "pkg-config", ] [[package]] name = "glob" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "glsl-include" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa2afb1631e7ab4543e0dde0e3fc68bb49c58fee89c07f30a26553b1f684ab6" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "regex", ] [[package]] name = "glutin" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5371b35b309dace06be1b81b5f6adb1c9de578b7dbe1e74bf7e4ef762cf6febd" dependencies = [ - "android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cgl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.18.5 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", - "derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin_egl_sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin_emscripten_sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin_gles2_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin_glx_sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin_wgl_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winit 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)", + "android_glue", + "cgl", + "cocoa 0.18.5", + "core-foundation 0.6.4", + "core-graphics", + "glutin_egl_sys", + "glutin_emscripten_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "lazy_static", + "libloading", + "objc", + "osmesa-sys", + "parking_lot 0.9.0", + "wayland-client 0.21.13", + "winapi 0.3.8", + "winit", ] [[package]] name = "glutin_egl_sys" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772edef3b28b8ad41e4ea202748e65eefe8e5ffd1f4535f1219793dbb20b3d4c" dependencies = [ - "gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.13.1", + "winapi 0.3.8", ] [[package]] name = "glutin_emscripten_sys" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" [[package]] name = "glutin_gles2_sys" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e853d96bebcb8e53e445225c3009758c6f5960d44f2543245f6f07b567dae0" dependencies = [ - "gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.13.1", + "objc", ] [[package]] name = "glutin_glx_sys" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c243de74d6cf5ea100c788826d2fb9319de315485dd4b310811a663b3809c3" dependencies = [ - "gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.13.1", + "x11-dl", ] [[package]] name = "glutin_wgl_sys" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93dba7ee3a0feeac0f437141ff25e71ce2066bcf1a706acab1559ffff94eb6a" dependencies = [ - "gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.13.1", ] [[package]] name = "gobject-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70409d6405db8b1591602fcd0cbe8af52cd9976dd39194442b4c149ba343f86d" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "glib-sys", + "libc", + "pkg-config", ] [[package]] name = "gtk" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d695d6be4110618a97c19cd068e8a00e53e33b87e3c65cdc5397667498b1bc24" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "cairo-rs", + "cairo-sys-rs", + "cc", + "gdk", + "gdk-pixbuf", + "gdk-pixbuf-sys", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk-sys", + "lazy_static", + "libc", + "pango", ] [[package]] name = "gtk-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" dependencies = [ - "atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "atk-sys", + "bitflags", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", ] [[package]] @@ -1486,1022 +1646,1148 @@ name = "guillotiere" version = "0.4.2" source = "git+https://github.com/Imberflur/guillotiere#42c298f5bcf0f95f1a004360d05e25ca3711e9ed" dependencies = [ - "euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)", - "svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid", + "svg_fmt", ] [[package]] name = "gzip-header" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" dependencies = [ - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast", ] [[package]] name = "h2" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "log 0.4.8", + "slab", + "tokio", + "tokio-util", ] [[package]] name = "hashbrown" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" dependencies = [ - "ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "ahash", + "autocfg 0.1.7", + "rayon", + "serde", ] [[package]] name = "hermit-abi" -version = "0.1.3" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "hex" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] name = "hibitset" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93a1bb8316a44459a7d14253c4d28dd7395cbd23cc04a68c46e851b8e46d64b1" dependencies = [ - "atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atom", + "rayon", ] [[package]] name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" [[package]] name = "http" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "fnv", + "itoa", ] [[package]] name = "http-body" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "http", ] [[package]] name = "httparse" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" [[package]] name = "humantime" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error", ] [[package]] name = "hyper" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "log 0.4.8", + "net2", + "pin-project", + "time", + "tokio", + "tower-service", + "want", ] [[package]] name = "hyper-rustls" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "ct-logs", + "futures-util", + "hyper", + "log 0.4.8", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki", ] [[package]] name = "idna" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "idna" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "image" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ed2ada878397b045454ac7cfb011d73132c59f31a955d230bd1f1c2e68eb4a" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "png 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "gif", + "jpeg-decoder", + "num-iter", + "num-rational", + "num-traits 0.2.11", + "png", + "scoped_threadpool", + "tiff", ] [[package]] name = "indexmap" -version = "1.3.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", ] [[package]] name = "inflate" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "adler32", ] [[package]] name = "inotify" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc39ee997811267bf8aa0b10e1674c5bea6caacc1957eede5ea45251fe33c6d5" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "inotify-sys", + "libc", ] [[package]] name = "inotify-sys" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "instant" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c346c299e3fe8ef94dc10c2c0253d858a69aac1245157a3bf4125915d528caf" [[package]] name = "iovec" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "itertools" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" dependencies = [ - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either", ] [[package]] name = "itoa" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" [[package]] name = "jobserver" version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "jpeg-decoder" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0256f0aec7352539102a9efbcb75543227b7ab1117e0f95450023af730128451" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "rayon", ] [[package]] name = "js-sys" version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" dependencies = [ - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen", ] [[package]] name = "kernel32-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] [[package]] name = "khronos_api" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" [[package]] name = "lewton" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "ogg", + "smallvec 0.6.13", ] [[package]] name = "libc" -version = "0.2.65" +version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" [[package]] name = "libgit2-sys" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4870c781f6063efb83150cd22c1ddf6ecf58531419e7570cdcced46970f64a16" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "libssh2-sys 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", ] [[package]] name = "libloading" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "winapi 0.3.8", ] [[package]] name = "libssh2-sys" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb70f29dc7c31d32c97577f13f41221af981b31248083e347b7f2c39225a6bc" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", ] [[package]] name = "libz-sys" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] name = "line_drawing" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11", ] [[package]] name = "linked-hash-map" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" [[package]] name = "lock_api" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" dependencies = [ - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard", ] [[package]] name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8", ] [[package]] name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "lz4-compress" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f966533a922a9bba9e95e594c1fdb3b9bf5fdcdb11e37e51ad84cd76e468b91" dependencies = [ - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 0.5.3", + "quick-error", ] [[package]] name = "lzw" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" [[package]] name = "malloc_buf" version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "matches" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "maybe-uninit" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.2.1" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] name = "memmap" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "winapi 0.3.8", ] [[package]] name = "memoffset" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version", ] [[package]] name = "mime" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9", ] [[package]] name = "mime" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "1.8.7" +version = "1.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" dependencies = [ - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.2.6", + "phf", + "phf_codegen", + "unicase 1.4.2", ] [[package]] name = "mime_guess" version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" dependencies = [ - "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16", + "unicase 2.6.0", ] [[package]] name = "minifb" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799c20458eb0dd69f48cea5014afe736b363818c86d7ca61dbb56e1c0585014c" dependencies = [ - "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cast", + "cc", + "orbclient", + "raw-window-handle", + "time", + "winapi 0.3.8", + "x11-dl", ] [[package]] name = "mio" version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log 0.4.8", + "miow", + "net2", + "slab", + "winapi 0.2.8", ] [[package]] name = "mio-extras" -version = "2.0.5" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ - "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell", + "log 0.4.8", + "mio", + "slab", ] [[package]] name = "miow" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", ] [[package]] name = "mopa" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" [[package]] name = "msgbox" version = "0.4.0" source = "git+https://github.com/bekker/msgbox-rs.git?rev=68fe39a#68fe39a60019b38a1569ae4e9ed796a0f0542673" dependencies = [ - "cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gtk 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.19.1", + "gtk", + "objc", + "winapi 0.3.8", ] [[package]] name = "multipart" version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adba94490a79baf2d6a23eac897157047008272fa3eecb3373ae6377b91eca28" dependencies = [ - "buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "buf_redux", + "httparse", + "log 0.4.8", + "mime 0.2.6", + "mime_guess 1.8.8", + "quick-error", + "rand 0.4.6", + "safemem", + "tempdir", + "twoway", ] [[package]] name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "winapi 0.3.8", ] [[package]] name = "nix" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "cc", + "cfg-if", + "libc", + "void", ] [[package]] name = "nodrop" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "noise" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "337525774dd8a197b613a01ea88058ef0ed023e5ed1e4b7e93de478e1f2bf770" dependencies = [ - "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.6", ] [[package]] name = "nom" version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", + "version_check 0.1.5", ] [[package]] name = "notify" version = "5.0.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b00c0b65188bffb5598c302e19b062feb94adef02c31f15622a163c95d673c3" dependencies = [ - "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "chashmap 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "fsevent 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fsevent-sys 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "inotify 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "anymap", + "bitflags", + "chashmap", + "crossbeam-channel 0.4.2", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio", + "mio-extras", + "walkdir", + "winapi 0.3.8", ] [[package]] name = "num" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" dependencies = [ - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer", + "num-iter", + "num-traits 0.2.11", ] [[package]] name = "num" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" dependencies = [ - "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits 0.2.11", ] [[package]] name = "num-bigint" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "num-integer", + "num-traits 0.2.11", ] [[package]] name = "num-complex" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "num-traits 0.2.11", ] [[package]] name = "num-derive" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] name = "num-integer" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "num-traits 0.2.11", ] [[package]] name = "num-iter" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "num-integer", + "num-traits 0.2.11", ] [[package]] name = "num-rational" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da4dc79f9e6c81bef96148c8f6b8e72ad4541caa4a24373e900a36da07de03a3" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "num-bigint", + "num-integer", + "num-traits 0.2.11", ] [[package]] name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11", ] [[package]] name = "num-traits" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", ] [[package]] name = "num_cpus" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" dependencies = [ - "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi", + "libc", ] [[package]] name = "objc" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ - "malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "malloc_buf", ] [[package]] name = "objc-foundation" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" dependencies = [ - "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "block", + "objc", + "objc_id", ] [[package]] name = "objc_id" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" dependencies = [ - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "objc", ] [[package]] name = "ogg" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", ] +[[package]] +name = "oorandom" +version = "11.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcec7c9c2a95cacc7cd0ecb89d8a8454eca13906f6deb55258ffff0adeb9405" + [[package]] name = "openssl-probe" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" version = "0.9.54" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" dependencies = [ - "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] name = "orbclient" version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" dependencies = [ - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall", + "sdl2", ] [[package]] name = "ordered-float" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11", ] [[package]] name = "osmesa-sys" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" dependencies = [ - "shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "shared_library", ] [[package]] name = "owning_ref" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" dependencies = [ - "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait", ] [[package]] name = "packed_simd" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a85ea9fc0d4ac0deb6fe7911d38786b32fc11119afd9e9d38b84ff691ce64220" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "pango" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45374801e224373c3c0393cd48073c81093494c8735721e81d1dbaa4096b2767" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "glib", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", ] [[package]] name = "pango-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", ] [[package]] name = "parking_lot" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "owning_ref", + "parking_lot_core 0.2.14", ] [[package]] name = "parking_lot" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" dependencies = [ - "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api", + "parking_lot_core 0.6.2", + "rustc_version", ] [[package]] name = "parking_lot_core" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "rand 0.4.6", + "smallvec 0.6.13", + "winapi 0.3.8", ] [[package]] name = "parking_lot_core" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "rustc_version", + "smallvec 0.6.13", + "winapi 0.3.8", ] [[package]] name = "peeking_take_while" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" dependencies = [ - "fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fixedbitset", ] [[package]] name = "phf" version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" dependencies = [ - "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared", ] [[package]] name = "phf_codegen" version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" dependencies = [ - "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_generator", + "phf_shared", ] [[package]] name = "phf_generator" version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" dependencies = [ - "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared", + "rand 0.6.5", ] [[package]] name = "phf_shared" version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" dependencies = [ - "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "siphasher", + "unicase 1.4.2", ] [[package]] name = "pin-project" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" dependencies = [ - "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-internal", ] [[package]] name = "pin-project-internal" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", ] [[package]] name = "pin-project-lite" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" [[package]] name = "pin-utils" version = "0.1.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" [[package]] name = "piston-float" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b058c3a640efd4bcf63266512e4bb03187192c1b29edd38b16d5a014613e3199" [[package]] name = "piston-viewport" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d96dd995f7dabe6d57cda668ec0fda39d6fe6e1e0b23f772582f383f2013611" dependencies = [ - "piston-float 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "piston-float", ] [[package]] name = "pistoncore-input" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c612ce242c7bac8e96426a0ca34275fd980af440f0cca7c6c0e840ef8a4052f" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "piston-viewport", + "serde", + "serde_derive", ] [[package]] name = "pkg-config" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" + +[[package]] +name = "plotters" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" +dependencies = [ + "js-sys", + "num-traits 0.2.11", + "wasm-bindgen", + "web-sys", +] [[package]] name = "png" -version = "0.15.1" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef859a23054bbfee7811284275ae522f0434a3c8e7f4b74bd4a35ae7e1c4a283" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)", - "inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "crc32fast", + "deflate", + "inflate", ] [[package]] @@ -2509,851 +2795,919 @@ name = "portpicker" version = "0.1.0" source = "git+https://github.com/wusyong/portpicker-rs?branch=fix_ipv6#06b989ac271ada33f9d44e7bcfcb10d55ead0c43" dependencies = [ - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5", ] [[package]] name = "ppv-lite86" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] name = "pretty_env_logger" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" dependencies = [ - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono", + "env_logger", + "log 0.4.8", ] [[package]] name = "proc-macro-hack" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", ] [[package]] name = "proc-macro-nested" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" [[package]] name = "proc-macro2" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0", ] [[package]] name = "proc-macro2" version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0", ] [[package]] name = "proc-macro2" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0", ] [[package]] name = "prometheus" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "fnv", + "lazy_static", + "protobuf", + "quick-error", + "spin", ] [[package]] name = "prometheus-static-metric" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "proc-macro2 0.3.8", + "quote 0.5.2", + "syn 0.13.11", ] [[package]] name = "protobuf" -version = "2.8.1" +version = "2.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a5325d019a4d837d3abde0a836920f959e33d350f77b5f1e289e061e774942" [[package]] name = "quick-error" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" dependencies = [ - "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8", ] [[package]] name = "quote" version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", ] [[package]] name = "quote" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", ] [[package]] name = "rand" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" dependencies = [ - "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.8", ] [[package]] name = "rand" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "winapi 0.3.8", ] [[package]] name = "rand" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg 0.1.2", + "rand_xorshift", + "winapi 0.3.8", ] [[package]] name = "rand" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "libc", + "rand_chacha 0.2.1", + "rand_core 0.5.1", + "rand_hc 0.2.0", + "rand_pcg 0.2.1", ] [[package]] name = "rand_chacha" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7", + "rand_core 0.3.1", ] [[package]] name = "rand_chacha" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" dependencies = [ - "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "c2-chacha", + "rand_core 0.5.1", ] [[package]] name = "rand_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" dependencies = [ - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2", ] [[package]] name = "rand_core" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", ] [[package]] name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1", ] [[package]] name = "rand_isaac" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1", ] [[package]] name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "rand_core 0.4.2", + "winapi 0.3.8", ] [[package]] name = "rand_os" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_os" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.8", ] [[package]] name = "rand_pcg" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7", + "rand_core 0.4.2", ] [[package]] name = "rand_pcg" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1", ] [[package]] name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_xoshiro" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1", ] [[package]] name = "raw-window-handle" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "rayon" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" dependencies = [ - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque", + "either", + "rayon-core", ] [[package]] name = "rayon-core" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" dependencies = [ - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque", + "crossbeam-queue 0.2.1", + "crossbeam-utils 0.7.2", + "lazy_static", + "num_cpus", ] [[package]] name = "rdrand" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1", ] [[package]] name = "redox_syscall" version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" [[package]] name = "redox_users" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "redox_syscall", + "rust-argon2 0.7.0", ] [[package]] name = "regex" -version = "1.3.1" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", ] [[package]] name = "regex-automata" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", ] [[package]] name = "regex-syntax" -version = "0.6.12" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" [[package]] name = "remove_dir_all" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8", ] [[package]] name = "reqwest" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "hyper-rustls", + "js-sys", + "lazy_static", + "log 0.4.8", + "mime 0.3.16", + "mime_guess 2.0.3", + "percent-encoding 2.1.0", + "pin-project-lite", + "rustls", + "serde", + "serde_urlencoded", + "time", + "tokio", + "tokio-rustls", + "url 2.1.1", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", ] [[package]] name = "ring" version = "0.16.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "lazy_static", + "libc", + "spin", + "untrusted", + "web-sys", + "winapi 0.3.8", ] [[package]] name = "rodio" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" dependencies = [ - "cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cpal", + "hound", + "lazy_static", + "lewton", ] [[package]] name = "ron" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1", + "bitflags", + "serde", ] [[package]] name = "roots" version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c67c712ab62be58b24ab8960e2b95dd4ee00aac115c76f2709657821fe376d" [[package]] name = "rouille" version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112568052ec17fa26c6c11c40acbb30d3ad244bf3d6da0be181f5e7e42e5004f" dependencies = [ - "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)", - "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "multipart 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rust-argon2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3", + "brotli2", + "chrono", + "deflate", + "filetime", + "multipart", + "num_cpus", + "rand 0.5.6", + "serde", + "serde_derive", + "serde_json", + "sha1", + "term", + "threadpool", + "time", + "tiny_http", + "url 1.7.2", ] [[package]] name = "rust-argon2" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416f5109bdd413cec4f04c029297838e7604c993f8d1483b1d438f23bdc3eb35" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils 0.6.6", +] + +[[package]] +name = "rust-argon2" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" +dependencies = [ + "base64 0.11.0", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils 0.7.2", ] [[package]] name = "rustc-demangle" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "rustc-hash" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver", ] [[package]] name = "rustls" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", - "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0", + "log 0.4.8", + "ring", + "sct", + "webpki", ] [[package]] name = "rustls-native-certs" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" dependencies = [ - "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe", + "rustls", + "schannel", + "security-framework", ] [[package]] name = "rusttype" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" dependencies = [ - "rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rusttype 0.8.2", ] [[package]] name = "rusttype" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" dependencies = [ - "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "approx 0.3.2", + "arrayvec 0.5.1", + "crossbeam-deque", + "crossbeam-utils 0.7.2", + "linked-hash-map", + "num_cpus", + "ordered-float", + "rustc-hash", + "stb_truetype", ] [[package]] name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" [[package]] name = "safemem" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" [[package]] name = "same-file" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util", ] [[package]] name = "scan_fmt" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248286eec0f55678879ef1caec3d76276643ebcb5460d8cb6e732ef40f50aabe" dependencies = [ - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", ] [[package]] name = "schannel" version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "winapi 0.3.8", ] [[package]] name = "scoped_threadpool" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" [[package]] name = "scopeguard" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" dependencies = [ - "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ring", + "untrusted", ] [[package]] name = "sdl2" version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "lazy_static", + "libc", + "num 0.1.42", + "rand 0.6.5", + "sdl2-sys", ] [[package]] name = "sdl2-sys" version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", ] [[package]] name = "security-framework" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "core-foundation 0.7.0", + "core-foundation-sys 0.7.0", + "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" dependencies = [ - "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0", + "libc", ] [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver-parser", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" dependencies = [ - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", ] [[package]] name = "serde_json" -version = "1.0.42" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" dependencies = [ - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa", + "ryu", + "serde", ] [[package]] name = "serde_urlencoded" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ - "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa", + "itoa", + "serde", + "url 2.1.1", ] [[package]] name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "shared_library" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "libc", ] [[package]] name = "shlex" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "shred" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" dependencies = [ - "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "shred-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.12", + "hashbrown", + "mopa", + "rayon", + "shred-derive", + "smallvec 0.6.13", ] [[package]] name = "shred-derive" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f37080f2751fbf091dbdebaa95bd6cf9dbf74ad1d50396b1908518a1747fdf" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", ] [[package]] name = "shrev" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5752e017e03af9d735b4b069f53b7a7fd90fefafa04d8bd0c25581b0bff437f" [[package]] name = "siphasher" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" [[package]] name = "slab" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" dependencies = [ - "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit", ] [[package]] name = "smallvec" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" [[package]] name = "smithay-client-toolkit" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" dependencies = [ - "andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-protocols 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", + "andrew", + "bitflags", + "dlib", + "lazy_static", + "memmap", + "nix", + "wayland-client 0.21.13", + "wayland-commons 0.21.13", + "wayland-protocols 0.21.13", ] [[package]] name = "smithay-client-toolkit" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" dependencies = [ - "andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-protocols 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", + "andrew", + "bitflags", + "dlib", + "lazy_static", + "memmap", + "nix", + "wayland-client 0.23.6", + "wayland-protocols 0.23.6", ] [[package]] name = "smithay-clipboard" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a59486e68b5596f664deedf01c46297f4af60379adae20175357a814d40f69e" dependencies = [ - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smithay-client-toolkit 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "nix", + "smithay-client-toolkit 0.6.6", ] [[package]] name = "specs" version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4943fde8c5d3d14c3d19d2a4c7abbd7b626c270a19e6cd35252294a48feb698c" dependencies = [ - "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", - "shrev 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2", + "derivative", + "hashbrown", + "hibitset", + "log 0.4.8", + "rayon", + "serde", + "shred", + "shrev", + "tuple_utils", ] [[package]] @@ -3361,1362 +3715,981 @@ name = "specs-idvs" version = "0.1.0" source = "git+https://gitlab.com/veloren/specs-idvs.git#111548cf44e9bb4c43feb12aa3fc253953ac6e4a" dependencies = [ - "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "specs", ] [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" [[package]] name = "static_assertions" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" [[package]] name = "stb_truetype" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", ] [[package]] name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" [[package]] name = "sum_type" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" [[package]] name = "svg_fmt" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" [[package]] name = "syn" version = "0.13.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" dependencies = [ - "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8", + "quote 0.5.2", + "unicode-xid 0.1.0", ] [[package]] name = "syn" version = "0.15.44" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", ] [[package]] name = "syn" -version = "1.0.8" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "unicode-xid 0.2.0", ] [[package]] name = "synstructure" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", + "unicode-xid 0.2.0", ] [[package]] name = "tempdir" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" dependencies = [ - "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6", + "remove_dir_all", ] [[package]] name = "term" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "dirs", + "winapi 0.3.8", ] [[package]] name = "termcolor" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" dependencies = [ - "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width", ] [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", ] [[package]] name = "threadpool" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" dependencies = [ - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus", ] [[package]] name = "tiff" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4", + "lzw", + "num-derive", + "num-traits 0.2.11", ] [[package]] name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "redox_syscall", + "winapi 0.3.8", ] [[package]] name = "tiny_http" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" dependencies = [ - "ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ascii", + "chrono", + "chunked_transfer", + "log 0.4.8", + "url 1.7.2", ] [[package]] name = "tinytemplate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" dependencies = [ - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", ] [[package]] name = "tokio" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "fnv", + "iovec", + "lazy_static", + "memchr", + "mio", + "num_cpus", + "pin-project-lite", + "slab", ] [[package]] name = "tokio-rustls" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", + "rustls", + "tokio", + "webpki", ] [[package]] name = "tokio-util" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" dependencies = [ - "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures-core", + "futures-sink", + "log 0.4.8", + "pin-project-lite", + "tokio", ] [[package]] name = "toml" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" dependencies = [ - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] name = "tower-service" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "treeculler" version = "0.1.0" source = "git+https://gitlab.com/yusdacra/treeculler.git#6c0fdf1c1cbf00be22e37410985d6a3973cd9bed" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11", ] [[package]] name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "tuple_utils" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" [[package]] name = "twoway" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] name = "unicase" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5", ] [[package]] name = "unicase" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ - "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1", ] [[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" dependencies = [ - "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.2.0", ] [[package]] name = "unicode-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" [[package]] name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "untrusted" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" [[package]] name = "url" version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" dependencies = [ - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", ] [[package]] name = "url" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0", + "matches", + "percent-encoding 2.1.0", ] [[package]] name = "uuid" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" dependencies = [ - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5", + "serde", ] [[package]] name = "uvth" version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" dependencies = [ - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.3.9", + "log 0.4.8", + "num_cpus", ] [[package]] name = "vcpkg" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" [[package]] name = "vek" -version = "0.9.11" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b833a133490ae98e9e3db1c77fc28e844f8e51b12eb35b4ab8a2082cb7cb441a" dependencies = [ - "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "approx 0.1.1", + "num-integer", + "num-traits 0.1.43", + "rustc_version", + "serde", + "static_assertions", ] [[package]] name = "veloren-chat-cli" version = "0.5.0" dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "veloren-client 0.5.0", - "veloren-common 0.5.0", + "log 0.4.8", + "pretty_env_logger", + "veloren-client", + "veloren-common", ] [[package]] name = "veloren-client" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "veloren-common 0.5.0", + "authc", + "byteorder 1.3.4", + "hashbrown", + "image", + "log 0.4.8", + "num_cpus", + "specs", + "uvth", + "vek", + "veloren-common", ] [[package]] name = "veloren-common" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", - "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lz4-compress 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "notify 5.0.0-pre.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", - "sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "authc", + "bincode", + "criterion", + "crossbeam", + "dot_vox", + "find_folder", + "hashbrown", + "image", + "indexmap", + "lazy_static", + "log 0.4.8", + "lz4-compress", + "mio", + "mio-extras", + "notify", + "parking_lot 0.9.0", + "rand 0.7.3", + "rayon", + "ron", + "serde", + "serde_derive", + "serde_json", + "specs", + "specs-idvs", + "sum_type", + "vek", ] [[package]] name = "veloren-server" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "portpicker 0.1.0 (git+https://github.com/wusyong/portpicker-rs?branch=fix_ipv6)", - "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rouille 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", - "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "veloren-common 0.5.0", - "veloren-world 0.5.0", + "authc", + "chrono", + "crossbeam", + "hashbrown", + "lazy_static", + "log 0.4.8", + "portpicker", + "prometheus", + "prometheus-static-metric", + "rand 0.7.3", + "ron", + "rouille", + "scan_fmt", + "serde", + "serde_derive", + "specs", + "specs-idvs", + "uvth", + "vek", + "veloren-common", + "veloren-world", ] [[package]] name = "veloren-server-cli" version = "0.5.0" dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "veloren-common 0.5.0", - "veloren-server 0.5.0", + "log 0.4.8", + "pretty_env_logger", + "veloren-common", + "veloren-server", ] [[package]] name = "veloren-voxygen" version = "0.5.0" dependencies = [ - "authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)", - "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)", - "conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)", - "cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "dispatch 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx_device_gl 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx_window_glutin 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "glsl-include 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)", - "guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "msgbox 0.4.0 (git+https://github.com/bekker/msgbox-rs.git?rev=68fe39a)", - "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", - "treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)", - "uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "veloren-client 0.5.0", - "veloren-common 0.5.0", - "veloren-server 0.5.0", - "veloren-world 0.5.0", - "winit 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "authc", + "backtrace", + "bincode", + "chrono", + "conrod_core", + "conrod_winit", + "cpal", + "criterion", + "crossbeam", + "deunicode", + "directories", + "dispatch", + "dot_vox", + "euc", + "failure", + "fern", + "gfx", + "gfx_device_gl", + "gfx_window_glutin", + "git2", + "glsl-include", + "glutin", + "guillotiere", + "hashbrown", + "image", + "log 0.4.8", + "msgbox", + "num 0.2.1", + "rand 0.7.3", + "rodio", + "ron", + "serde", + "serde_derive", + "specs", + "specs-idvs", + "treeculler", + "uvth", + "vek", + "veloren-client", + "veloren-common", + "veloren-server", + "veloren-world", + "winit", + "winres", ] [[package]] name = "veloren-world" version = "0.5.0" dependencies = [ - "arr_macro 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "packed_simd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "veloren-common 0.5.0", + "arr_macro", + "bincode", + "bitvec", + "hashbrown", + "image", + "itertools", + "lazy_static", + "log 0.4.8", + "minifb", + "noise", + "num 0.2.1", + "ordered-float", + "packed_simd", + "pretty_env_logger", + "rand 0.7.3", + "rand_chacha 0.2.1", + "rayon", + "ron", + "roots", + "serde", + "serde_derive", + "vek", + "veloren-common", ] [[package]] name = "version_check" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" [[package]] name = "version_check" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "walkdir" -version = "2.2.9" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "same-file", + "winapi 0.3.8", + "winapi-util", ] [[package]] name = "want" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8", + "try-lock", ] [[package]] name = "wasi" -version = "0.7.0" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasm-bindgen" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "serde", + "serde_json", + "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" dependencies = [ - "bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "bumpalo", + "lazy_static", + "log 0.4.8", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" dependencies = [ - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3", + "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9", + "quote 1.0.3", + "syn 1.0.16", + "wasm-bindgen-backend", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" [[package]] name = "wayland-client" version = "0.21.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "downcast-rs", + "libc", + "nix", + "wayland-commons 0.21.13", + "wayland-scanner 0.21.13", + "wayland-sys 0.21.13", ] [[package]] name = "wayland-client" version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "downcast-rs", + "libc", + "nix", + "wayland-commons 0.23.6", + "wayland-scanner 0.23.6", + "wayland-sys 0.23.6", ] [[package]] name = "wayland-commons" version = "0.21.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" dependencies = [ - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", + "nix", + "wayland-sys 0.21.13", ] [[package]] name = "wayland-commons" version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" dependencies = [ - "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", + "nix", + "wayland-sys 0.23.6", ] [[package]] name = "wayland-protocols" version = "0.21.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afde2ea2a428eee6d7d2c8584fdbe8b82eee8b6c353e129a434cd6e07f42145" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "wayland-client 0.21.13", + "wayland-commons 0.21.13", + "wayland-scanner 0.21.13", + "wayland-sys 0.21.13", ] [[package]] name = "wayland-protocols" version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "wayland-client 0.23.6", + "wayland-commons 0.23.6", + "wayland-scanner 0.23.6", ] [[package]] name = "wayland-scanner" version = "0.21.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3828c568714507315ee425a9529edc4a4aa9901409e373e9e0027e7622b79e" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "xml-rs", ] [[package]] name = "wayland-scanner" version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30", + "quote 0.6.13", + "xml-rs", ] [[package]] name = "wayland-sys" version = "0.21.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" dependencies = [ - "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dlib", + "lazy_static", ] [[package]] name = "wayland-sys" version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" dependencies = [ - "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dlib", + "lazy_static", ] [[package]] name = "web-sys" version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" dependencies = [ - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys", + "wasm-bindgen", ] [[package]] name = "webpki" version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" dependencies = [ - "ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ring", + "untrusted", ] [[package]] name = "webpki-roots" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" dependencies = [ - "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki", ] [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "wincolor" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8" dependencies = [ - "android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.18.5 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", + "android_glue", + "backtrace", + "bitflags", + "cocoa 0.18.5", + "core-foundation 0.6.4", + "core-graphics", + "lazy_static", + "libc", + "log 0.4.8", + "objc", + "parking_lot 0.9.0", + "percent-encoding 2.1.0", + "raw-window-handle", + "serde", + "smithay-client-toolkit 0.4.6", + "wayland-client 0.21.13", + "winapi 0.3.8", + "x11-dl", ] [[package]] name = "winreg" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8", ] [[package]] name = "winres" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4fb510bbfe5b8992ff15f77a2e6fe6cf062878f0eda00c0f44963a807ca5dc" dependencies = [ - "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml", ] [[package]] name = "ws2_32-sys" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] [[package]] name = "x11-clipboard" -version = "0.3.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e937afd03b64b7be4f959cc044e09260a47241b71e56933f37db097bf7859d" dependencies = [ - "xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "xcb", ] [[package]] name = "x11-dl" -version = "2.18.4" +version = "2.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "libc", + "maybe-uninit", + "pkg-config", ] [[package]] name = "xcb" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "log 0.4.8", ] [[package]] name = "xdg" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" [[package]] name = "xml-rs" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" -"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" -"checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58" -"checksum andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" -"checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" -"checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" -"checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" -"checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -"checksum arr_macro 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a105bfda48707cf19220129e78fca01e9639433ffaef4163546ed8fb04120a5" -"checksum arr_macro_impl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" -"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" -"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -"checksum ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" -"checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" -"checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum auth-common 0.1.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" -"checksum authc 1.0.0 (git+https://gitlab.com/veloren/auth.git?rev=65571ade0d954a0e0bd995fdb314854ff146ab97)" = "" -"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" -"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" -"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" -"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" -"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" -"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -"checksum bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ab639324e3ee8774d296864fbc0dbbb256cf1a41c490b94cba90c082915f92" -"checksum bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" -"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" -"checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" -"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -"checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" -"checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" -"checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" -"checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -"checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" -"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" -"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" -"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" -"checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" -"checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" -"checksum cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0395175ecba60accac076a02c31d143b9dcd9d5eb5316d7163a3273803b765c7" -"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" -"checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" -"checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -"checksum cgl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" -"checksum chashmap 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff41a3c2c1e39921b9003de14bf0439c7b63a9039637c291e1a64925d8ddfa45" -"checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" -"checksum chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" -"checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" -"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum clipboard-win 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3a093d6fed558e5fe24c3dfc85a68bb68f1c824f440d3ba5aca189e2998786b" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum cocoa 0.18.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1706996401131526e36b3b49f0c4d912639ce110996f3ca144d78946727bce54" -"checksum cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" -"checksum color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" -"checksum colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "433e7ac7d511768127ed85b0c4947f47a254131e37864b2dc13f52aa32cd37e5" -"checksum conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)" = "" -"checksum conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)" = "" -"checksum conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git?branch=hide_text)" = "" -"checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" -"checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" -"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" -"checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" -"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" -"checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" -"checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" -"checksum coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" -"checksum cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ded070249be850b5b59e1e3a44a70b8ae395e0e5c65b487131d8909a8208120" -"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "938703e165481c8d612ea3479ac8342e5615185db37765162e762ec3523e2fc6" -"checksum criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccdc6ce8bbe352ca89025bee672aa6d24f4eb8c53e3a8b5d1bc58011da072a2" -"checksum crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2d818a4990769aac0c7ff1360e233ef3a41adcb009ebb2036bf6915eb0f6b23c" -"checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" -"checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" -"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" -"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" -"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" -"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" -"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" -"checksum csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d" -"checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" -"checksum ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" -"checksum daggy 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9293a0da7d1bc1f30090ece4d9f9de79a07be7302ddb00e5eb1fefb6ee6409e2" -"checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" -"checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" -"checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" -"checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" -"checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" -"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" -"checksum dispatch 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" -"checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" -"checksum dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11afd3251e588f2770226659b2a1d55ec2f8aaf2ca42bdcdbd01ff53b4a81e70" -"checksum downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" -"checksum draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" -"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" -"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" -"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" -"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -"checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" -"checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" -"checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" -"checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" -"checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" -"checksum fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e69ab0d5aca163e388c3a49d284fed6c3d0810700e77c5ae2756a50ec1a4daaa" -"checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" -"checksum find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" -"checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -"checksum fsevent 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1616e68919f49d311720c3cf316e0a3522d8f2bd08f8da35f6b8a0fa12f9234b" -"checksum fsevent-sys 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a41f1722e9bf862f62429d192f37d0c82c589aa18783aa06f0c4e5c3c90649fb" -"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" -"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" -"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" -"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" -"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" -"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" -"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -"checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" -"checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" -"checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" -"checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" -"checksum gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" -"checksum gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" -"checksum gfx_device_gl 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)" = "109c385fa380c18888633aa27d1e16cbae518469702a2f69dcb5f52d5378bebc" -"checksum gfx_gl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8525888d909a6424b04f9136976f07a85fc1f3704555c1a73897e258326c8319" -"checksum gfx_window_glutin 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "310ff66f08b5a55854b18fea2f48bdbb75c94458207ba574c9723be78e97a646" -"checksum gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" -"checksum gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2db9fad8f1b0d4c7338a210a6cbdf081dcc1a3c223718c698c4f313f6c288acb" -"checksum gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2a57872499171d279f8577ce83837da4cae62b08dd32892236ed67ab7ea61030" -"checksum git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c1af51ea8a906616af45a4ce78eacf25860f7a13ae7bf8a814693f0f4037a26" -"checksum gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39a23d5e872a275135d66895d954269cf5e8661d234eb1c2480f4ce0d586acbd" -"checksum gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" -"checksum gleam 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5" -"checksum glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61" -"checksum glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408" -"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -"checksum glsl-include 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daa2afb1631e7ab4543e0dde0e3fc68bb49c58fee89c07f30a26553b1f684ab6" -"checksum glutin 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "938ce7a2b1bbfe1535166133bea3f9c1b46350d2794b49561303575e9e1b9949" -"checksum glutin_egl_sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772edef3b28b8ad41e4ea202748e65eefe8e5ffd1f4535f1219793dbb20b3d4c" -"checksum glutin_emscripten_sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "245b3fdb08df6ffed7585365851f8404af9c7e2dd4b59f15262e968b6a95a0c7" -"checksum glutin_gles2_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89996c30857ae1b4de4b5189abf1ea822a20a9fe9e1c93e5e7b862ff0bdd5cdf" -"checksum glutin_glx_sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1290a5ca5e46fcfa7f66f949cc9d9194b2cb6f2ed61892c8c2b82343631dba57" -"checksum glutin_wgl_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f801bbc91efc22dd1c4818a47814fc72bf74d024510451b119381579bfa39021" -"checksum gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70409d6405db8b1591602fcd0cbe8af52cd9976dd39194442b4c149ba343f86d" -"checksum gtk 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d695d6be4110618a97c19cd068e8a00e53e33b87e3c65cdc5397667498b1bc24" -"checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91" -"checksum guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)" = "" -"checksum gzip-header 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0131feb3d3bb2a5a238d8a4d09f6353b7ebfdc52e77bccbf4ea6eaa751dde639" -"checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" -"checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" -"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" -"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" -"checksum hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47e7292fd9f7fe89fa35c98048f2d0a69b79ed243604234d18f6f8a1aa6f408d" -"checksum hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" -"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" -"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" -"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" -"checksum hyper-rustls 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" -"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826" -"checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" -"checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" -"checksum inotify 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc39ee997811267bf8aa0b10e1674c5bea6caacc1957eede5ea45251fe33c6d5" -"checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" -"checksum instant 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6c346c299e3fe8ef94dc10c2c0253d858a69aac1245157a3bf4125915d528caf" -"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" -"checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" -"checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" -"checksum lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0" -"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" -"checksum libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4870c781f6063efb83150cd22c1ddf6ecf58531419e7570cdcced46970f64a16" -"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -"checksum libssh2-sys 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10" -"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" -"checksum line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum lz4-compress 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f966533a922a9bba9e95e594c1fdb3b9bf5fdcdb11e37e51ad84cd76e468b91" -"checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" -"checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -"checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" -"checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -"checksum minifb 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799c20458eb0dd69f48cea5014afe736b363818c86d7ca61dbb56e1c0585014c" -"checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" -"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" -"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" -"checksum msgbox 0.4.0 (git+https://github.com/bekker/msgbox-rs.git?rev=68fe39a)" = "" -"checksum multipart 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)" = "adba94490a79baf2d6a23eac897157047008272fa3eecb3373ae6377b91eca28" -"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -"checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" -"checksum noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "337525774dd8a197b613a01ea88058ef0ed023e5ed1e4b7e93de478e1f2bf770" -"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum notify 5.0.0-pre.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b00c0b65188bffb5598c302e19b062feb94adef02c31f15622a163c95d673c3" -"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -"checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" -"checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" -"checksum num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fcb0cf31fb3ff77e6d2a6ebd6800df7fdcd106f2ad89113c9130bcd07f93dffc" -"checksum num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" -"checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e" -"checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454" -"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" -"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" -"checksum objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -"checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -"checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -"checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" -"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" -"checksum orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" -"checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" -"checksum osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -"checksum packed_simd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a85ea9fc0d4ac0deb6fe7911d38786b32fc11119afd9e9d38b84ff691ce64220" -"checksum pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45374801e224373c3c0393cd48073c81093494c8735721e81d1dbaa4096b2767" -"checksum pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1" -"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" -"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -"checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" -"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -"checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" -"checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" -"checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" -"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" -"checksum piston-float 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b058c3a640efd4bcf63266512e4bb03187192c1b29edd38b16d5a014613e3199" -"checksum piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d96dd995f7dabe6d57cda668ec0fda39d6fe6e1e0b23f772582f383f2013611" -"checksum pistoncore-input 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c612ce242c7bac8e96426a0ca34275fd980af440f0cca7c6c0e840ef8a4052f" -"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -"checksum png 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f00ec9242f8e01119e83117dbadf34c5228ac2f1c4ddcd92bffa340d52291de" -"checksum portpicker 0.1.0 (git+https://github.com/wusyong/portpicker-rs?branch=fix_ipv6)" = "" -"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" -"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" -"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" -"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" -"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" -"checksum prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" -"checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" -"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -"checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" -"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" -"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" -"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -"checksum rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a788ae3edb696cfcba1c19bfd388cc4b8c21f8a408432b199c072825084da58a" -"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -"checksum rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" -"checksum raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" -"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" -"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" -"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" -"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" -"checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" -"checksum rodio 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0e0dfa7c8b17c6428f6e992a22ea595922cc86f946191b6b59e7ce96b77262" -"checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" -"checksum roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e4c67c712ab62be58b24ab8960e2b95dd4ee00aac115c76f2709657821fe376d" -"checksum rouille 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "112568052ec17fa26c6c11c40acbb30d3ad244bf3d6da0be181f5e7e42e5004f" -"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" -"checksum rust-argon2 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "416f5109bdd413cec4f04c029297838e7604c993f8d1483b1d438f23bdc3eb35" -"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustls 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" -"checksum rustls-native-certs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" -"checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" -"checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" -"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" -"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" -"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum scan_fmt 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "faf737f37ca340201889b5f48ecde47f233e9da3cbf3d04be27883adac39b4da" -"checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" -"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" -"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -"checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" -"checksum sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" -"checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" -"checksum security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" -"checksum security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" -"checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" -"checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" -"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" -"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" -"checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" -"checksum shred-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c245c03fd923292ae18e01eadf65606fdc995c175433104ef3eee956db7c2d7" -"checksum shrev 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b5752e017e03af9d735b4b069f53b7a7fd90fefafa04d8bd0c25581b0bff437f" -"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" -"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" -"checksum smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" -"checksum smithay-client-toolkit 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "93960e8975909fcb14cc755de93af2149d8b8f4eb368315537d40cfd0f324054" -"checksum smithay-clipboard 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9667a262ef7a9ff1c55a7e665cd3d36f9bc2809f94167b1fb3fc31423a83f8c0" -"checksum specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4943fde8c5d3d14c3d19d2a4c7abbd7b626c270a19e6cd35252294a48feb698c" -"checksum specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)" = "" -"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" -"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" -"checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -"checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" -"checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" -"checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" -"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" -"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "661641ea2aa15845cddeb97dad000d22070bb5c1fb456b96c1cba883ec691e92" -"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" -"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" -"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" -"checksum tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" -"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" -"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" -"checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" -"checksum tokio-rustls 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a" -"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" -"checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" -"checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" -"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" -"checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" -"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" -"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" -"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" -"checksum uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" -"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" -"checksum vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "1eb3ca8ea588deba055424cc1a79a830428b2f6c270b8d8f91946f660fa4d8ee" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" -"checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" -"checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" -"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" -"checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" -"checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" -"checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" -"checksum wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" -"checksum wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" -"checksum wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" -"checksum wayland-commons 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" -"checksum wayland-protocols 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "4afde2ea2a428eee6d7d2c8584fdbe8b82eee8b6c353e129a434cd6e07f42145" -"checksum wayland-protocols 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" -"checksum wayland-scanner 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3828c568714507315ee425a9529edc4a4aa9901409e373e9e0027e7622b79e" -"checksum wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" -"checksum wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" -"checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" -"checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" -"checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" -"checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" -"checksum winit 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8" -"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" -"checksum winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4fb510bbfe5b8992ff15f77a2e6fe6cf062878f0eda00c0f44963a807ca5dc" -"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -"checksum x11-clipboard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89bd49c06c9eb5d98e6ba6536cf64ac9f7ee3a009b2f53996d405b3944f6bcea" -"checksum x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)" = "be65e1342a3baae65439cd03306778831a3d133b0d20243a7fb83fd5cf403c58" -"checksum xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5e917a3f24142e9ff8be2414e36c649d47d6cc2ba81f16201cdef96e533e02de" -"checksum xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" -"checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5" +checksum = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5" From 80dafebac535f57c296a679a6cb94c63136b891a Mon Sep 17 00:00:00 2001 From: Songtronix Date: Mon, 9 Mar 2020 20:52:04 +0100 Subject: [PATCH 109/387] fix: #517 --- server/src/events/player.rs | 12 +++++++++++- server/src/sys/message.rs | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/server/src/events/player.rs b/server/src/events/player.rs index 33ea7e7b63..3237ee57dd 100644 --- a/server/src/events/player.rs +++ b/server/src/events/player.rs @@ -1,7 +1,8 @@ use super::Event; -use crate::{client::Client, Server, StateExt}; +use crate::{auth_provider::AuthProvider, client::Client, Server, StateExt}; use common::{ comp, + comp::Player, msg::{ClientState, PlayerListUpdate, ServerMsg}, sync::{Uid, UidAllocator}, }; @@ -51,6 +52,15 @@ pub fn handle_client_disconnect(server: &mut Server, entity: EcsEntity) -> Event ))) } + // Make sure to remove the player from the logged in list. (See AuthProvider) + { + let players = state.ecs().read_storage::(); + let mut accounts = state.ecs().write_resource::(); + + if let Some(player) = players.get(entity) { + accounts.logout(player.uuid()); + } + } // Delete client entity if let Err(err) = state.delete_entity_recorded(entity) { error!("Failed to delete disconnected client: {:?}", err); diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index 47d02d23c3..b524c22fbc 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -300,7 +300,6 @@ impl<'a> System<'a> for Sys { None, ServerMsg::broadcast(format!("{} went offline.", &player.alias)), )); - accounts.logout(player.uuid()); } server_emitter.emit(ServerEvent::ClientDisconnect(entity)); client.postbox.send_message(ServerMsg::Disconnect); From 7132ef41361700d9f8210835163fb8ff7a150b04 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sun, 8 Mar 2020 23:32:34 -0400 Subject: [PATCH 110/387] Rearrange some operations in the server tick to reduce clientside latency of ServerEvent mediated effects --- CHANGELOG.md | 1 + client/src/lib.rs | 2 +- common/src/state.rs | 51 ++++++++++++++++-------- server/src/lib.rs | 73 ++++++++++++++++++++++------------ server/src/sys/mod.rs | 35 +++++++++------- server/src/sys/terrain_sync.rs | 8 +--- server/src/sys/waypoint.rs | 10 ++++- 7 files changed, 114 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37648ad8bf..8cdf3cf0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed highlighting of non-collectible sprites - Fixed /give_exp ignoring player argument - Extend run sfx to small animals to prevent sneak attacks by geese. +- Decreased clientside latency of ServerEvent mediated effects (e.g. projectiles, inventory operations, etc) ### Removed diff --git a/client/src/lib.rs b/client/src/lib.rs index 09841e3fa7..f2bc898373 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -410,7 +410,7 @@ impl Client { // 3) Update client local data // 4) Tick the client's LocalState - self.state.tick(dt, add_foreign_systems); + self.state.tick(dt, add_foreign_systems, true); // 5) Terrain let pos = self diff --git a/common/src/state.rs b/common/src/state.rs index c657785b25..0fbd3202d0 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -286,8 +286,35 @@ impl State { } } + // Run RegionMap tick to update entity region occupancy + pub fn update_region_map(&self) { + self.ecs.write_resource::().tick( + self.ecs.read_storage::(), + self.ecs.read_storage::(), + self.ecs.entities(), + ); + } + + // Apply terrain changes + pub fn apply_terrain_changes(&self) { + let mut terrain = self.ecs.write_resource::(); + let mut modified_blocks = std::mem::replace( + &mut self.ecs.write_resource::().blocks, + Default::default(), + ); + // Apply block modifications + // Only include in `TerrainChanges` if successful + modified_blocks.retain(|pos, block| terrain.set(*pos, *block).is_ok()); + self.ecs.write_resource::().modified_blocks = modified_blocks; + } + /// Execute a single tick, simulating the game state by the given duration. - pub fn tick(&mut self, dt: Duration, add_foreign_systems: impl Fn(&mut DispatcherBuilder)) { + pub fn tick( + &mut self, + dt: Duration, + add_foreign_systems: impl Fn(&mut DispatcherBuilder), + update_terrain_and_regions: bool, + ) { // Change the time accordingly. self.ecs.write_resource::().0 += dt.as_secs_f64() * DAY_CYCLE_FACTOR; self.ecs.write_resource::