feat: logging
This commit is contained in:
@@ -94,8 +94,10 @@ fn client_exit(room_map: &RoomMap, room_id: &Option<String>, client_id: &Option<
|
|||||||
if let (Some(room_id), Some(client_id)) = (room_id, client_id) {
|
if let (Some(room_id), Some(client_id)) = (room_id, client_id) {
|
||||||
let mut room_map = room_map.lock().unwrap();
|
let mut room_map = room_map.lock().unwrap();
|
||||||
if let Some(client_map) = room_map.get_mut(room_id) {
|
if let Some(client_map) = room_map.get_mut(room_id) {
|
||||||
|
information!("Client: {} exit from room: {}", client_id, room_id);
|
||||||
client_map.remove(client_id);
|
client_map.remove(client_id);
|
||||||
if client_map.is_empty() {
|
if client_map.is_empty() {
|
||||||
|
information!("Room is empty, close room: {}", room_id);
|
||||||
room_map.remove(room_id);
|
room_map.remove(room_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user