diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-20 15:03:37 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-20 15:03:37 +0200 |
commit | 371c81a17a706ef257c4a202a0de33116026e72f (patch) | |
tree | 19f53d1119fdc0fddc6bf3ffd24de9c31ab48159 /server/src/commands.rs | |
parent | 84d6d883275df97bdf6bbff8c9f4d6c657e8f14e (diff) | |
download | hurrycurry-371c81a17a706ef257c4a202a0de33116026e72f.tar hurrycurry-371c81a17a706ef257c4a202a0de33116026e72f.tar.bz2 hurrycurry-371c81a17a706ef257c4a202a0de33116026e72f.tar.zst |
show game abort message when aborting with /start
Diffstat (limited to 'server/src/commands.rs')
-rw-r--r-- | server/src/commands.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs index f5792a22..dab0e540 100644 --- a/server/src/commands.rs +++ b/server/src/commands.rs @@ -126,6 +126,23 @@ impl Server { ) -> Result<()> { match command { Command::Start { spec, timer } => { + if !self.game.lobby { + self.tx + .send(PacketC::ServerMessage { + message: trm!( + "s.state.game_aborted", + s = self + .game + .players + .get(&player) + .ok_or(anyhow!("player missing"))? + .name + .clone() + ), + error: false, + }) + .ok(); + } let data = self.index.generate(&spec).await?; self.load(data, Some(Duration::from_secs(timer))); } |