diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-10 21:54:03 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-10 21:54:03 +0200 |
commit | 61533450cba864f49653aed4021fedf39477c8fd (patch) | |
tree | 129e99eb7b6ab34cfd098fa854463b9d1a41f5b8 /server/src/state.rs | |
parent | 552711488539d651283bb8573a35aff737c8b132 (diff) | |
download | hurrycurry-61533450cba864f49653aed4021fedf39477c8fd.tar hurrycurry-61533450cba864f49653aed4021fedf39477c8fd.tar.bz2 hurrycurry-61533450cba864f49653aed4021fedf39477c8fd.tar.zst |
quick reload command
Diffstat (limited to 'server/src/state.rs')
-rw-r--r-- | server/src/state.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/src/state.rs b/server/src/state.rs index b496040b..2af436a3 100644 --- a/server/src/state.rs +++ b/server/src/state.rs @@ -57,6 +57,9 @@ enum Command { /// Send an effect Effect { name: String }, /// Reload the resource index + ReloadIndex, + /// Reload the current map + #[clap(alias = "r")] Reload, } @@ -159,6 +162,15 @@ impl State { ); } Command::Reload => { + if self.game.count_chefs() > 1 { + bail!("must be at most one player to reload"); + } + self.game.load( + self.index.generate(self.game.data.spec.to_string()).await?, + None, + ); + } + Command::ReloadIndex => { self.index.reload()?; } Command::Download { r#type, name } => { |