cleanup
This commit is contained in:
parent
98dd4e85c2
commit
ba6d33b081
3 changed files with 3 additions and 29 deletions
|
@ -74,8 +74,6 @@ async fn handle_new_user(
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// Create
|
// Create
|
||||||
let new_user = Arc::new(Mutex::new(generate_new_user(&state)));
|
let new_user = Arc::new(Mutex::new(generate_new_user(&state)));
|
||||||
tracing::debug!("User created at ptr: {:p}", new_user);
|
|
||||||
tracing::debug!("User borrowed ptr: {:p}", *&new_user);
|
|
||||||
|
|
||||||
// Notify client of new username
|
// Notify client of new username
|
||||||
sender
|
sender
|
||||||
|
@ -84,14 +82,6 @@ async fn handle_new_user(
|
||||||
|
|
||||||
// Register using `addr` as key until something longer lived exists
|
// Register using `addr` as key until something longer lived exists
|
||||||
state.online_users.lock().unwrap().insert(*addr, new_user);
|
state.online_users.lock().unwrap().insert(*addr, new_user);
|
||||||
tracing::debug!(
|
|
||||||
"New user inserted at ptr: {:p}",
|
|
||||||
state.online_users.lock().unwrap().get(addr).unwrap()
|
|
||||||
);
|
|
||||||
tracing::debug!(
|
|
||||||
"New user hashmap deref ptr: {:p}",
|
|
||||||
*state.online_users.lock().unwrap().get(addr).unwrap()
|
|
||||||
);
|
|
||||||
|
|
||||||
// Hydrate client
|
// Hydrate client
|
||||||
// this should probably be combined and sent as one
|
// this should probably be combined and sent as one
|
||||||
|
|
|
@ -152,14 +152,6 @@ fn handle_user_log_in(
|
||||||
tx.send(to_string::<ChatMessage>(&ChatMessage { text: msg })?)?;
|
tx.send(to_string::<ChatMessage>(&ChatMessage { text: msg })?)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::debug!(
|
|
||||||
"User updated at ptr: {:p}",
|
|
||||||
state.online_users.lock().unwrap().get(&addr).unwrap()
|
|
||||||
);
|
|
||||||
tracing::debug!(
|
|
||||||
"User updated deref ptr: {:p}",
|
|
||||||
*state.online_users.lock().unwrap().get(&addr).unwrap()
|
|
||||||
);
|
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"Online Users: {} Offline Users: {}",
|
"Online Users: {} Offline Users: {}",
|
||||||
state.online_users.lock().unwrap().len(),
|
state.online_users.lock().unwrap().len(),
|
||||||
|
@ -228,16 +220,8 @@ fn handle_close(
|
||||||
state.online_users.lock().unwrap().remove(&addr).unwrap(),
|
state.online_users.lock().unwrap().remove(&addr).unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
tracing::debug!(
|
tx.send(server_summary_update(state))?;
|
||||||
"User moved to offline ptr: {:p}",
|
tx.send(chat_meta_update(state))?;
|
||||||
state.offline_users.lock().unwrap().get(&name).unwrap()
|
|
||||||
);
|
|
||||||
tracing::debug!(
|
|
||||||
"User offline deref ptr: {:p}",
|
|
||||||
*state.offline_users.lock().unwrap().get(&name).unwrap()
|
|
||||||
);
|
|
||||||
tx.send(server_summary_update(&state))?;
|
|
||||||
tx.send(chat_meta_update(&state))?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ async fn main() -> Result<()> {
|
||||||
let listener = tokio::net::TcpListener::bind(address)
|
let listener = tokio::net::TcpListener::bind(address)
|
||||||
.await
|
.await
|
||||||
.with_context(|| format!("{} is not a valid bind address.", address))?;
|
.with_context(|| format!("{} is not a valid bind address.", address))?;
|
||||||
tracing::debug!("listening on {}", listener.local_addr()?);
|
tracing::info!("listening on {}", listener.local_addr()?);
|
||||||
axum::serve(
|
axum::serve(
|
||||||
listener,
|
listener,
|
||||||
app.into_make_service_with_connect_info::<SocketAddr>(),
|
app.into_make_service_with_connect_info::<SocketAddr>(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue