aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2025-12-14 11:44:38 +0100
committernokoe <nokoe@mailbox.org>2025-12-14 11:44:38 +0100
commit240d53cccd175e06e98a926d316e0b456b4c7e28 (patch)
tree05dfdcf07f8b56b955aec0e6fc6122ca0e44a4f1 /server
parentf43daec5936b827285a14c50377bb592ed9d1311 (diff)
downloadhurrycurry-240d53cccd175e06e98a926d316e0b456b4c7e28.tar
hurrycurry-240d53cccd175e06e98a926d316e0b456b4c7e28.tar.bz2
hurrycurry-240d53cccd175e06e98a926d316e0b456b4c7e28.tar.zst
add option to specify hand count in start command
Diffstat (limited to 'server')
-rw-r--r--server/src/commands.rs11
1 files changed, 10 insertions, 1 deletions
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<usize>,
+
/// Duration in seconds
#[cfg(feature = "cheats")]
timer: Option<u64>,
@@ -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"))]