From bcd5764aa03e128e06c355272b7b81eac8d4501d Mon Sep 17 00:00:00 2001 From: stale Date: Sun, 29 May 2022 20:45:03 -0300 Subject: improved pubs listing, many minor fixes --- src/types.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/types.rs') diff --git a/src/types.rs b/src/types.rs index 84e7d46..d467982 100644 --- a/src/types.rs +++ b/src/types.rs @@ -10,6 +10,7 @@ use std::{ }; use warp::ws::Message; use tokio::sync::RwLock; +use serde::Serialize; use crate::minesweeper; #[derive(Debug, Clone)] @@ -23,15 +24,19 @@ pub struct Config { pub socket_addr: SocketAddr, } -#[derive(Debug)] -pub struct Room { +#[derive(Debug, Serialize)] +pub struct RoomConf { pub name: String, - pub players: PlayerMap, - pub peer_limit: usize, + pub player_cap: usize, pub public: bool, + pub board_conf: minesweeper::BoardConf, +} + +pub struct Room { + pub conf: RoomConf, + pub players: PlayerMap, pub driver: tokio::task::JoinHandle<()>, pub cmd_stream: CmdTx, - pub board_conf: minesweeper::BoardConf, } #[derive(Debug)] -- cgit v1.2.3