From 531a607d04d6b46a44fe1661390dfc9d49eb1ec0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 31 Aug 2025 12:45:01 +0200 Subject: add /start option to skip announce --- server/src/commands.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'server/src') 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, }, @@ -132,7 +138,11 @@ impl Server { replies: &mut Vec, ) -> 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 -- cgit v1.2.3-70-g09d2