Skip to content

Commit

Permalink
clear client info on server
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 10, 2024
1 parent 9572432 commit 7c67c03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/handler/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
20 changes: 16 additions & 4 deletions src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ pub struct User {
pub username: String,
pub path: Option<String>, // the user's location
pub point: Option<u64>,
pub region: Option<Region>,
//pub region: Option<Region>,
pub region_start: Option<u64>,
pub region_end: Option<u64>,
}

impl User {
Expand All @@ -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<String>, point: Option<u64>, region: Option<Region>) {
pub fn update(
&mut self,
path: Option<String>,
point: Option<u64>,
region_start: Option<u64>,
region_end: Option<u64>,
) {
self.path = path;
self.point = point;
self.region = region;
//self.region = region;
self.region_start = region_start;
self.region_end = region_end;
}
}

0 comments on commit 7c67c03

Please sign in to comment.