diff --git a/Cargo.toml b/Cargo.toml index f1aed4c..86be904 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,11 @@ [package] -name = "minotaur" +name = "asterion" version = "0.3.0" edition = "2021" +authors = ["Alessandro Ricottone "] +license = "GPL-3.0-or-later" +description = "Find your way out of a dangeroussh labyrinth" +readme = "README.md" homepage = "https://github.com/ricott1/minotaur" repository = "https://github.com/ricott1/minotaur" keywords = ["cli", "dungeon", "game"] diff --git a/README.md b/README.md index c90387a..5135245 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Minotaur +# Asterion @@ -27,7 +27,7 @@ You need to have the [rust toolchain](https://www.rust-lang.org/tools/install). ### With cargo -`cargo install minotaur` +`cargo install asterion` ### Binaries @@ -35,4 +35,4 @@ Download the binaries from the latest release. ## Run -Just run the binary to start the server. The port can be specified with the `-p ` flag. \ No newline at end of file +Just run the binary to start the server. The port can be specified with the `-p ` flag. diff --git a/src/game/game.rs b/src/game/game.rs index 164e2cf..ce2d359 100644 --- a/src/game/game.rs +++ b/src/game/game.rs @@ -99,7 +99,7 @@ impl Game { b.2.cmp(&a.2) } }) - .collect_vec() + .collect_vec(); } fn update_top_minotaurs(&mut self) { @@ -423,7 +423,6 @@ impl Game { } pub fn draw(&self, player_id: PlayerId) -> AppResult { - //FIXME: if hero is transitioning from one maze to the other, join the two maze images (and crop them to simulate the exit->entrance transition) if let Some(hero) = self.heros.get(&player_id) { let (x, y) = hero.position(); let maze_id = hero.maze_id(); diff --git a/src/game/hero.rs b/src/game/hero.rs index 2796422..cdfc700 100644 --- a/src/game/hero.rs +++ b/src/game/hero.rs @@ -168,7 +168,7 @@ impl Hero { } pub fn past_visibility_duration(&self) -> Duration { - Duration::from_secs_f32(10.0 + 5.0 * self.memory as f32) + Duration::from_secs_f32(10.0 + 10.0 * self.memory as f32) } pub fn update_past_visible_positions(&mut self, visible_positions: HashSet) { diff --git a/src/main.rs b/src/main.rs index 47b7ecc..dcadca7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use asterion::{ssh::AppServer, store_path, AppResult}; use clap::{ArgAction, Parser}; use log::LevelFilter; use log4rs::{ @@ -6,12 +7,11 @@ use log4rs::{ encode::pattern::PatternEncoder, Config, }; -use minotaur::{ssh::AppServer, store_path, AppResult}; const DEFAULT_PORT: u16 = 2020; #[derive(Parser, Debug)] -#[clap(name="Minotaur", about = "Find your way in da maze", author, version, long_about = None)] +#[clap(name="Asterion", about = "Find your way in da maze", author, version, long_about = None)] struct Args { #[clap(long, short = 'p', action=ArgAction::Set, help = "Set port to listen on")] port: Option, diff --git a/src/ssh/client.rs b/src/ssh/client.rs index 73d7e20..c8566ba 100644 --- a/src/ssh/client.rs +++ b/src/ssh/client.rs @@ -18,7 +18,7 @@ use tokio_util::sync::CancellationToken; pub type PlayerId = uuid::Uuid; pub struct AppClient { - id: PlayerId, + player_id: PlayerId, username: String, client_sender: Sender, terminal_event_sender: Sender<(PlayerId, TerminalEvent)>, @@ -33,7 +33,7 @@ impl AppClient { terminal_event_sender: Sender<(PlayerId, TerminalEvent)>, ) -> Self { AppClient { - id: uuid::Uuid::new_v4(), + player_id: PlayerId::new_v4(), username: "".into(), client_sender, terminal_event_sender, @@ -63,12 +63,12 @@ impl AppClient { SSHEventHandler::start( stdin, self.terminal_event_sender.clone(), - self.id, + self.player_id, client_shutdown.clone(), self.server_shutdown.clone(), ); let tui = Tui::new( - self.id, + self.player_id, self.username.clone(), width, height, diff --git a/src/ui/ui.rs b/src/ui/ui.rs index 01541de..405949a 100644 --- a/src/ui/ui.rs +++ b/src/ui/ui.rs @@ -17,7 +17,7 @@ use ratatui::{ use std::time::{Duration, Instant}; const MINORADAR: [&'static str; 8] = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]; -const NAME_LENGTH: usize = 12; +const NAME_LENGTH: usize = 13; const TITLE: [&'static str; 29] = [ " ██▓ ▄▄▄ ▄████▄ ▄▄▄ ██████ ▄▄▄ ", @@ -91,7 +91,7 @@ fn format_duration(duration: &Duration) -> String { let formatted_duration = if hours > 0 { format!("{}h{:02}m{:02}s", hours, minutes, seconds) } else if minutes > 0 { - format!("{}h{:02}m{:02}s", hours, minutes, seconds) + format!("{:02}m{:02}s", minutes, seconds) } else { format!("{:02}s", seconds) }; @@ -104,7 +104,7 @@ fn render_header(frame: &mut Frame, game: &Game, hero: &Hero, area: Rect) -> App let mut lines = vec![ Line::from(format!( - "There {} {} hero{} in the labirynth...", + "There {} {} hero{} in the labyrinth...", if number_of_players == 1 { "is" } else { "are" }, number_of_players, if number_of_players == 1 { "" } else { "es" }, @@ -246,7 +246,7 @@ fn render_sidebar(frame: &mut Frame, game: &Game, hero: &Hero, area: Rect) -> Ap .take(10) .map(|(_, name, maze_id, kills)| { Line::from(format!( - "{: