diff options
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/types.rs b/src/types.rs index 2d6ae22..cb16042 100644 --- a/src/types.rs +++ b/src/types.rs @@ -12,6 +12,7 @@ use warp::ws::Message; use tokio::sync::RwLock; use serde::Serialize; use crate::minesweeper; +use crate::livepos; #[derive(Debug, Clone)] pub struct Config { @@ -35,8 +36,10 @@ pub struct RoomConf { pub struct Room { pub conf: RoomConf, pub players: PlayerMap, - pub driver: tokio::task::JoinHandle<()>, + pub game_driver: tokio::task::JoinHandle<()>, pub cmd_stream: CmdTx, + pub livepos_driver: tokio::task::JoinHandle<()>, + pub pos_stream: tokio::sync::mpsc::UnboundedSender<livepos::Req>, } #[derive(Debug)] @@ -58,7 +61,6 @@ pub struct Player { pub uid: usize, pub name: String, pub clr: String, - pub position: (usize, usize), } impl Display for Player { @@ -125,7 +127,7 @@ impl PlayerMap { let uid = self.uid_counter.fetch_add(1, Ordering::Relaxed); map.insert( conn.addr, - Player { conn, uid, name, clr, position: (0,0) }, + Player { conn, uid, name, clr }, ); uid } |