From f70c1df91afa0a211de0b743da6c0dad59fd23be Mon Sep 17 00:00:00 2001 From: stale Date: Thu, 30 Jun 2022 06:34:59 -0300 Subject: redid the live cursor position system --- src/types.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/types.rs') 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, } #[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 } -- cgit v1.2.3