From ff3a51809c9bd9e78b5816d4d8c2414e7b778ebc Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:21:33 -0400 Subject: [PATCH] redundant --- server/src/main.rs | 5 ++--- server/src/user_handler.rs | 22 ++++++++-------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 07ab021..44b16ec 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -48,10 +48,9 @@ async fn main() -> Result<()> { }); let user_handler = UserHandler::new(app_state.clone()); - - let _user_handler = tokio::spawn(async move { + tokio::spawn(async move { while let Some(message) = users_rx.recv().await { - user_handler.process(message).await.unwrap(); + user_handler.process(message).await; } }); diff --git a/server/src/user_handler.rs b/server/src/user_handler.rs index b953948..9c685e4 100644 --- a/server/src/user_handler.rs +++ b/server/src/user_handler.rs @@ -1,7 +1,6 @@ use crate::AppState; use crate::NewUser; use crate::User; -use anyhow::Result; use lib::*; use serde_json::to_string; use std::net::SocketAddr; @@ -16,7 +15,7 @@ impl UserHandler { UserHandler { state } } - pub async fn process(&self, message: NewUser) -> Result<()> { + pub async fn process(&self, message: NewUser) { // // Create, Register, and Hydrate new user // @@ -38,16 +37,13 @@ impl UserHandler { // Hydrate client // this should probably be combined and sent as one - message - .sender - .send(meta_chat_update(&self.state)) - .await - .unwrap(); - message - .sender - .send(meta_server_summary_update(&self.state)) - .await - .unwrap(); + // + // message.sender.send(meta_chat_update(&self.state)).await; + // message + // .sender + // .send(meta_server_summary_update(&self.state)) + // .await + // .unwrap(); message .sender .send(meta_games_browser_update(&self.state)) @@ -80,8 +76,6 @@ impl UserHandler { // this races the broadcasts but if it's done last it'll probably show up // last message.sender.send(meta_motd()).await.unwrap(); - - Ok(()) } }