From 708cbe2c92b2de53333a293ad4e8b6ba500793d3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 17 Aug 2024 15:52:20 +0200 Subject: customers send message clear --- server/bot/src/algos/customer.rs | 10 ++++++++++ server/protocol/src/lib.rs | 2 +- server/src/entity/mod.rs | 9 ++++----- 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'server') diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs index 2e0a45b4..716897f7 100644 --- a/server/bot/src/algos/customer.rs +++ b/server/bot/src/algos/customer.rs @@ -132,6 +132,11 @@ impl BotAlgo for Customer { *self = Customer::Exiting { path }; BotInput { extra: vec![ + PacketS::Communicate { + message: None, + timeout: Some(0.), + player: me, + }, PacketS::ApplyScore(Score { points: -1, demands_failed: 1, @@ -178,6 +183,11 @@ impl BotAlgo for Customer { }; BotInput { extra: vec![ + PacketS::Communicate { + message: None, + timeout: Some(0.), + player: me, + }, PacketS::Communicate { message: Some(Message::Effect("satisfied".to_string())), timeout: None, diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index 7b3b39a5..a55eabe2 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -231,7 +231,7 @@ pub enum Menu { Score(Score), } -#[derive(Debug, Clone, Copy, Serialize, Deserialize, Encode, Decode)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, Encode, Decode, Default)] pub struct MessageTimeout { pub remaining: f32, pub initial: f32, diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs index 20370d0c..d8fa5654 100644 --- a/server/src/entity/mod.rs +++ b/server/src/entity/mod.rs @@ -55,14 +55,13 @@ pub trait Entity { // macro_rules! entities { // ($($e:ident),*) => { -// #[derive(Debug)] -// pub enum Entity { $($e($e)),* } -// impl EntityT for Entity { +// pub enum DynEntity { $($e($e)),* } +// impl Entity for DynEntity { // fn tick(&mut self, c: EntityContext<'_>) -> Result<()> { -// match self { $(Entity::$e(x) => x.tick(c)),*, } +// match self { $(DynEntity::$e(x) => x.tick(c)),*, } // } // fn destructor(&mut self, c: EntityContext<'_>) { -// match self { $(Entity::$e(x) => x.destructor(c)),*, } +// match self { $(DynEntity::$e(x) => x.destructor(c)),*, } // } // } // }; -- cgit v1.2.3-70-g09d2