Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
luftaquila committed Apr 18, 2024
1 parent 5e6910d commit 39ff927
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Client {
#[serde(skip)]
pub ip: Option<SocketAddr>,
#[serde(skip)]
tcp: Option<TcpStream>,
pub tcp: Option<TcpStream>,
#[serde(skip)]
pub disp: Vec<Rc<RefCell<Display>>>,
pub displays: Vec<Display>,
Expand Down
21 changes: 16 additions & 5 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ impl Server {
});
}
}

// TODO: check client display without warpzone
// TODO: duplicated client to client warpzone
}

/* merge all configured displays */
Expand Down Expand Up @@ -243,16 +246,24 @@ impl Server {

/* verify client */
for (i, client) in self.clients.iter_mut().enumerate() {
if client.borrow().cid == incoming_client.cid {
/* TODO: verify configured displays */

let mut client = client.borrow_mut();

if client.cid == incoming_client.cid {
/* verify configured displays */
for disp in client.displays.iter() {
for incoming_disp in incoming_client.displays.iter() {
// TODO: check configured displays are same
}
}

client.tcp = Some(stream.try_clone().unwrap());
client.ip = Some(stream.peer_addr().unwrap());
verified[i] = true;
client.borrow_mut().ip = Some(stream.peer_addr().unwrap());

println!(
"client {}({}) verified",
incoming_client.cid,
client.borrow().ip.unwrap()
client.ip.unwrap()
);
}
}
Expand Down

0 comments on commit 39ff927

Please sign in to comment.