From df066f364acc88b73b080f547b2868412c6fff27 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Tue, 31 Aug 2021 18:55:28 +0300 Subject: [PATCH] Cooldowns - Add last_battlemode_change to Player component - check on last_battlemode_change in handle_battlemode - set last_battlemode_change after setting battlemode - still are not persisted in any way --- common/src/comp/player.rs | 11 ++++- server/src/cmd.rs | 75 +++++++++++++++++++--------------- server/src/sys/msg/register.rs | 9 ++-- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/common/src/comp/player.rs b/common/src/comp/player.rs index 76db8ddc55..8eecf6b90d 100644 --- a/common/src/comp/player.rs +++ b/common/src/comp/player.rs @@ -3,7 +3,7 @@ use specs::{Component, DerefFlaggedStorage, NullStorage}; use specs_idvs::IdvStorage; use uuid::Uuid; -use crate::resources::BattleMode; +use crate::resources::{BattleMode, Time}; const MAX_ALIAS_LEN: usize = 32; @@ -20,6 +20,7 @@ pub enum DisconnectReason { pub struct Player { pub alias: String, pub battle_mode: BattleMode, + pub last_battlemode_change: Option