aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/commands.rs20
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