aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-28 18:52:44 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-28 18:52:44 +0100
commit538dd76061f15eddef9391475a82b1e820b7ea1f (patch)
treea407d91b65ace48e7ded40c62e1bc7a141376722 /server/src
parent69f0eb9b2eb60ef00a6ae235269258b92aa3527f (diff)
downloadhurrycurry-538dd76061f15eddef9391475a82b1e820b7ea1f.tar
hurrycurry-538dd76061f15eddef9391475a82b1e820b7ea1f.tar.bz2
hurrycurry-538dd76061f15eddef9391475a82b1e820b7ea1f.tar.zst
show message for empty scoreboards
Diffstat (limited to 'server/src')
-rw-r--r--server/src/commands.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs
index 64fa50f6..b6b00c22 100644
--- a/server/src/commands.rs
+++ b/server/src/commands.rs
@@ -39,8 +39,8 @@ enum Command {
timer: Option<u64>,
},
/// Shows the best entries of the scoreboard for this map.
- #[clap(alias = "top5")]
- Top {
+ #[clap(alias = "top", alias = "top5")]
+ Scoreboard {
/// Name of the map, default: current
map: Option<String>,
/// Send text instead of document
@@ -247,7 +247,7 @@ impl Server {
algo,
)));
}
- Command::Top { map, text } => {
+ Command::Scoreboard { map, text } => {
let mapname = map.as_ref().unwrap_or(&self.game.data.current_map);
if let Some(board) = self.scoreboard.get(mapname) {
@@ -286,7 +286,7 @@ impl Server {
es: board
.best
.iter()
- .take(5)
+ .take(10)
.enumerate()
.map(|(place, entry)| DocumentElement::Text {
s: trm!(
@@ -307,6 +307,11 @@ impl Server {
}],
})));
}
+ } else {
+ replies.push(PacketC::ServerMessage {
+ message: trm!("c.menu.scoreboard.no_finish", s = mapname.to_string()),
+ error: false,
+ });
}
}
Command::Info { map } => {