diff options
author | metamuffin <metamuffin@disroot.org> | 2025-08-31 12:45:01 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-08-31 12:45:09 +0200 |
commit | 531a607d04d6b46a44fe1661390dfc9d49eb1ec0 (patch) | |
tree | efa9b2c6e254dcc64cea558bc49e6b99ebd3403d | |
parent | ec821070e59f03c3a6eedf654ff2ab9081bc2bd8 (diff) | |
download | hurrycurry-531a607d04d6b46a44fe1661390dfc9d49eb1ec0.tar hurrycurry-531a607d04d6b46a44fe1661390dfc9d49eb1ec0.tar.bz2 hurrycurry-531a607d04d6b46a44fe1661390dfc9d49eb1ec0.tar.zst |
add /start option to skip announce
-rw-r--r-- | server/src/commands.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs index 718f1617..460f6581 100644 --- a/server/src/commands.rs +++ b/server/src/commands.rs @@ -33,10 +33,16 @@ use std::{fmt::Write, time::Duration}; #[clap(multicall = true)] enum Command { /// Start a new game + #[clap(alias = "s")] Start { /// Gamedata specification #[arg(default_value = "junior")] spec: String, + + /// Skip announement and pause at game start + #[arg(short = 's', long)] + skip_announce: bool, + /// Duration in seconds timer: Option<u64>, }, @@ -132,7 +138,11 @@ impl Server { replies: &mut Vec<PacketC>, ) -> Result<(), TrError> { match command { - Command::Start { spec, timer } => { + Command::Start { + spec, + timer, + skip_announce, + } => { if !self.game.lobby { self.tx .send(PacketC::ServerMessage { @@ -156,9 +166,11 @@ impl Server { .await .map_err(|e| TrError::Plain(e.to_string()))?; self.load(data, timer.map(Duration::from_secs)); - self.start_pause_timer = 3.5; - self.packet_out - .push_back(PacketC::Menu(Menu::AnnounceStart)); + if !skip_announce { + self.start_pause_timer = 3.5; + self.packet_out + .push_back(PacketC::Menu(Menu::AnnounceStart)); + } } Command::End => { self.tx |