From 7c67c034fc96059812b0b9ffacc50d4ed5a9b15b Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 10 Jun 2024 00:58:10 -0700 Subject: [PATCH] clear client info on server --- src/handler/room.rs | 4 ++-- src/user.rs | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/handler/room.rs b/src/handler/room.rs index 5cd6c86..19d11a5 100644 --- a/src/handler/room.rs +++ b/src/handler/room.rs @@ -317,9 +317,9 @@ pub mod update { let user = client.user_mut().unwrap(); - let region = to_region(region_start, region_end); + //let region = to_region(region_start, region_end); - user.update(path, point, region); + user.update(path, point, region_start, region_end); } } diff --git a/src/user.rs b/src/user.rs index 0297079..4b2fc94 100644 --- a/src/user.rs +++ b/src/user.rs @@ -35,7 +35,9 @@ pub struct User { pub username: String, pub path: Option, // the user's location pub point: Option, - pub region: Option, + //pub region: Option, + pub region_start: Option, + pub region_end: Option, } impl User { @@ -44,13 +46,23 @@ impl User { username: _username, path: None, point: None, - region: None, + //region: None, + region_start: None, + region_end: None, } } - pub fn update(&mut self, path: Option, point: Option, region: Option) { + pub fn update( + &mut self, + path: Option, + point: Option, + region_start: Option, + region_end: Option, + ) { self.path = path; self.point = point; - self.region = region; + //self.region = region; + self.region_start = region_start; + self.region_end = region_end; } }