aboutsummaryrefslogtreecommitdiff
path: root/server/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands.rs')
-rw-r--r--server/src/commands.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs
index 8e3d926a..1ffe4cd1 100644
--- a/server/src/commands.rs
+++ b/server/src/commands.rs
@@ -78,6 +78,13 @@ enum Command {
Tile { name: String },
/// Show all possible demands for this map
Demands,
+ /// Ready yourself
+ Ready {
+ #[arg(short, long)]
+ force: bool,
+ #[arg(short, long)]
+ unready: bool,
+ },
/// Reload the resource index
ReloadIndex,
#[clap(alias = "summon", alias = "bot")]
@@ -167,9 +174,10 @@ impl Server {
.map_err(|e| TrError::Plain(e.to_string()))?;
self.load(data, timer.map(Duration::from_secs));
if !skip_announce {
- self.start_pause_timer = 3.5;
+ self.announce_timer = 3.5;
self.packet_out
.push_back(PacketC::Menu(Menu::AnnounceStart));
+ self.update_paused();
}
}
Command::End => {
@@ -206,6 +214,17 @@ impl Server {
None,
);
}
+ Command::Ready { force, unready } => {
+ for c in self.connections.values_mut() {
+ if c.players.contains(&player) || force {
+ c.ready = true;
+ }
+ if unready && c.players.contains(&player) {
+ c.ready = false;
+ }
+ }
+ self.update_paused();
+ }
Command::ReloadIndex => {
self.index
.reload()