This commit is contained in:
Adam 2024-08-02 02:46:07 -04:00
parent ba6d33b081
commit 0b82e65061

View file

@ -73,7 +73,7 @@ async fn handle_new_user(
addr: &SocketAddr, addr: &SocketAddr,
) -> 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)));
// Notify client of new username // Notify client of new username
sender sender
@ -85,18 +85,18 @@ async fn handle_new_user(
// Hydrate client // Hydrate client
// this should probably be combined and sent as one // this should probably be combined and sent as one
sender.send(Message::Text(chat_meta_update(&state))).await?; sender.send(Message::Text(chat_meta_update(state))).await?;
sender.send(Message::Text(motd())).await?; sender.send(Message::Text(motd())).await?;
sender sender
.send(Message::Text(server_summary_update(&state))) .send(Message::Text(server_summary_update(state)))
.await?; .await?;
sender.send(Message::Text(games_update(&state))).await?; sender.send(Message::Text(games_update(state))).await?;
// Broadcast new user's existence // Broadcast new user's existence
// this should probably be combined and sent as one // this should probably be combined and sent as one
state.tx.send(announce_join(&state, addr))?; state.tx.send(announce_join(state, addr))?;
state.tx.send(server_summary_update(&state))?; state.tx.send(server_summary_update(state))?;
state.tx.send(chat_meta_update(&state))?; state.tx.send(chat_meta_update(state))?;
Ok(()) Ok(())
} }