From 0aeda028a1b512a65b51a199225290839a3a5f94 Mon Sep 17 00:00:00 2001 From: stale Date: Tue, 12 Jul 2022 23:44:53 -0300 Subject: number tile room option, version bump --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index c884dbc..0c81844 100644 --- a/src/main.rs +++ b/src/main.rs @@ -309,7 +309,7 @@ async fn empty_rooms(rooms: &RoomMap) -> Vec { } fn room_from_form(uid: RoomId, rinfo: &HashMap, conf: &Conf) -> Result<(types::Room, bool), Rejection> { - if let (Some(w),Some(h),Some(num),Some(denom),public,asfm,rborders,revealol,Some(limit)) = ( + if let (Some(w),Some(h),Some(num),Some(denom),public,asfm,rborders,revealol,ntiler,Some(limit)) = ( rinfo.get("bwidth").and_then(|w| w.parse::().ok()), rinfo.get("bheight").and_then(|h| h.parse::().ok()), rinfo.get("mineratio-n").and_then(|n| n.parse::().ok()), @@ -318,6 +318,7 @@ fn room_from_form(uid: RoomId, rinfo: &HashMap, conf: &Conf) -> R rinfo.get("allsafe1move").map(|s| s == "on").unwrap_or(false), rinfo.get("rborders").map(|s| s == "on").unwrap_or(false), rinfo.get("revealonlose").map(|s| s == "on").unwrap_or(false), + rinfo.get("numtilereveal").map(|s| s == "on").unwrap_or(false), rinfo.get("limit").and_then(|l| l.parse::().ok()), ) { if w.get()*h.get() > conf.limits.board_area { @@ -325,7 +326,8 @@ fn room_from_form(uid: RoomId, rinfo: &HashMap, conf: &Conf) -> R } let board_conf = minesweeper::BoardConf { w, h, mine_ratio: (num,denom), - always_safe_first_move: asfm, revealed_borders: rborders, reveal_on_lose: revealol + always_safe_first_move: asfm, revealed_borders: rborders, + reveal_on_lose: revealol, num_tile_reveal: ntiler, }; let name = { let n = rinfo.get("rname").unwrap().to_owned(); -- cgit v1.2.3