summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/commands.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs
index 5354c266..c33f5832 100644
--- a/server/src/commands.rs
+++ b/server/src/commands.rs
@@ -40,6 +40,11 @@ enum Command {
/// Name of the map, default: current
map: Option<String>,
},
+ #[clap(alias = "mapinfo")]
+ Info {
+ /// Name of the map, default: current
+ map: Option<String>,
+ },
/// Abort the current game
End,
/// Download recipe/map's source declaration
@@ -184,6 +189,20 @@ impl Server {
bail!("{o}");
}
}
+ Command::Info { map } => {
+ let mapname = map.as_ref().unwrap_or(&self.game.data.current_map);
+ let info = self
+ .index
+ .maps
+ .get(mapname)
+ .ok_or(anyhow!("no information available"))?;
+ bail!(
+ "{:?}\nRecommended player count: {}\nDifficulty: {}",
+ info.name,
+ info.difficulty,
+ info.players
+ )
+ }
}
Ok(())
}