From 49df948de25d28601469e9ca993f33530989ebd0 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 22:55:49 +0100 Subject: v3.0.0: cursor-driven roulette felt with splits and corners; drop schema migrations; require 80x24 --- src/bin/client/connection.rs | 2 +- src/bin/client/main.rs | 15 +++++++++++++++ src/bin/client/repl.rs | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/bin/client') diff --git a/src/bin/client/connection.rs b/src/bin/client/connection.rs index ec5642c..7516836 100644 --- a/src/bin/client/connection.rs +++ b/src/bin/client/connection.rs @@ -49,7 +49,7 @@ pub fn connect( Ok(Ok((tls, fp))) => (tls, fp), Ok(Err(e)) => return Err(Box::new(TrustError(format!("{e}")))), Err(mpsc::RecvTimeoutError::Timeout) => { - return Err("Connection timed out after 3 seconds".into()); + return Err("Connection timed out after 10 seconds".into()); } Err(_) => return Err("Connection attempt failed".into()), }; diff --git a/src/bin/client/main.rs b/src/bin/client/main.rs index 1b701d8..9018026 100644 --- a/src/bin/client/main.rs +++ b/src/bin/client/main.rs @@ -10,6 +10,21 @@ fn main() { let args: Vec = std::env::args().collect(); let unsafe_mode = args.iter().any(|arg| arg == "--unsafe"); + // Every game board is drawn in place, so refuse a terminal that cannot fit + // them before touching the network or the terminal mode. + let size = crossterm::terminal::size(); + let (columns, rows) = match &size { + Ok((columns, rows)) => (*columns, *rows), + Err(_) => (0, 0), + }; + if let Some(message) = zagan_bet::client::ui::terminal_too_small(columns, rows) { + eprintln!("{message}"); + if size.is_err() { + eprintln!("Could not read the terminal size (is this a real terminal?)."); + } + std::process::exit(1); + } + if unsafe_mode { println!("WARNING: Running in UNSAFE mode - certificate verification disabled!"); } diff --git a/src/bin/client/repl.rs b/src/bin/client/repl.rs index d973596..2cf121d 100644 --- a/src/bin/client/repl.rs +++ b/src/bin/client/repl.rs @@ -712,6 +712,8 @@ fn map_key(key: crossterm::event::KeyEvent) -> Option { KeyCode::Backspace => Some(Key::Backspace), KeyCode::Up => Some(Key::Up), KeyCode::Down => Some(Key::Down), + KeyCode::Left => Some(Key::Left), + KeyCode::Right => Some(Key::Right), KeyCode::Tab => Some(Key::Tab), KeyCode::Esc => Some(Key::Esc), _ => None, -- cgit v1.2.3