From 240d53cccd175e06e98a926d316e0b456b4c7e28 Mon Sep 17 00:00:00 2001 From: nokoe Date: Sun, 14 Dec 2025 11:44:38 +0100 Subject: add option to specify hand count in start command --- server/src/commands.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/src/commands.rs b/server/src/commands.rs index 2d9ba967..f5ec6ff5 100644 --- a/server/src/commands.rs +++ b/server/src/commands.rs @@ -42,6 +42,10 @@ enum Command { #[arg(short = 's', long)] skip_announce: bool, + /// Number of hands per player + #[arg(short = 'c', long)] + hand_count: Option, + /// Duration in seconds #[cfg(feature = "cheats")] timer: Option, @@ -161,6 +165,7 @@ impl Server { #[cfg(feature = "cheats")] timer, skip_announce, + hand_count, } => { if !self.game.lobby { self.broadcast @@ -179,10 +184,14 @@ impl Server { }) .ok(); } - let data = self + let mut data = self .index .generate_with_book(&spec) .map_err(|e| TrError::Plain(e.to_string()))?; + + if let Some(hand_count) = hand_count { + data.0.hand_count = hand_count; + } #[cfg(feature = "cheats")] self.load(data, timer.map(Duration::from_secs)); #[cfg(not(feature = "cheats"))] -- cgit v1.3