summaryrefslogtreecommitdiff
path: root/server/src/state.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-01 17:53:11 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-01 17:53:11 +0200
commitddb2d69dc08d08abeadc70f7346106ad1e8b445b (patch)
treeda814c3b2e65e686ab069be8d1f42bb9a9d1ad18 /server/src/state.rs
parent35cc10b1f4bcbe6f31b9d1b0916fa942f0829480 (diff)
downloadhurrycurry-ddb2d69dc08d08abeadc70f7346106ad1e8b445b.tar
hurrycurry-ddb2d69dc08d08abeadc70f7346106ad1e8b445b.tar.bz2
hurrycurry-ddb2d69dc08d08abeadc70f7346106ad1e8b445b.tar.zst
show message when /end
Diffstat (limited to 'server/src/state.rs')
-rw-r--r--server/src/state.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/src/state.rs b/server/src/state.rs
index ffcc8fa2..265dbcbc 100644
--- a/server/src/state.rs
+++ b/server/src/state.rs
@@ -99,6 +99,18 @@ impl State {
self.game.load(data, Some(Duration::from_secs(timer)));
}
Command::End => {
+ self.tx
+ .send(PacketC::ServerMessage {
+ text: format!(
+ "Game was aborted by {}.",
+ self.game
+ .players
+ .get(&player)
+ .ok_or(anyhow!("player missing"))?
+ .name
+ ),
+ })
+ .ok();
self.game
.load(self.index.generate("lobby-none-none".to_string())?, None);
}