summaryrefslogtreecommitdiff
path: root/src/types.rs
diff options
context:
space:
mode:
authorstale <redkugelblitzin@gmail.com>2022-06-30 06:34:59 -0300
committerstale <redkugelblitzin@gmail.com>2022-06-30 06:34:59 -0300
commitf70c1df91afa0a211de0b743da6c0dad59fd23be (patch)
tree44a0531ca5088aff24e41d38dd91d54985e478af /src/types.rs
parentb73533c659ff5c8ad822631fb442d50d238a6b44 (diff)
redid the live cursor position system
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs8
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
}