Compare commits

...

2 commits

Author SHA1 Message Date
Adam
ff3a51809c redundant 2024-08-07 21:21:33 -04:00
Adam
38f1f19e7a update deps 2024-08-07 21:21:23 -04:00
3 changed files with 14 additions and 21 deletions

8
Cargo.lock generated
View file

@ -216,9 +216,9 @@ checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.7" version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -1233,9 +1233,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]] [[package]]
name = "object" name = "object"
version = "0.36.2" version = "0.36.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]

View file

@ -48,10 +48,9 @@ async fn main() -> Result<()> {
}); });
let user_handler = UserHandler::new(app_state.clone()); let user_handler = UserHandler::new(app_state.clone());
tokio::spawn(async move {
let _user_handler = tokio::spawn(async move {
while let Some(message) = users_rx.recv().await { while let Some(message) = users_rx.recv().await {
user_handler.process(message).await.unwrap(); user_handler.process(message).await;
} }
}); });

View file

@ -1,7 +1,6 @@
use crate::AppState; use crate::AppState;
use crate::NewUser; use crate::NewUser;
use crate::User; use crate::User;
use anyhow::Result;
use lib::*; use lib::*;
use serde_json::to_string; use serde_json::to_string;
use std::net::SocketAddr; use std::net::SocketAddr;
@ -16,7 +15,7 @@ impl UserHandler {
UserHandler { state } UserHandler { state }
} }
pub async fn process(&self, message: NewUser) -> Result<()> { pub async fn process(&self, message: NewUser) {
// //
// Create, Register, and Hydrate new user // Create, Register, and Hydrate new user
// //
@ -38,16 +37,13 @@ impl UserHandler {
// Hydrate client // Hydrate client
// this should probably be combined and sent as one // this should probably be combined and sent as one
message //
.sender // message.sender.send(meta_chat_update(&self.state)).await;
.send(meta_chat_update(&self.state)) // message
.await // .sender
.unwrap(); // .send(meta_server_summary_update(&self.state))
message // .await
.sender // .unwrap();
.send(meta_server_summary_update(&self.state))
.await
.unwrap();
message message
.sender .sender
.send(meta_games_browser_update(&self.state)) .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 // this races the broadcasts but if it's done last it'll probably show up
// last // last
message.sender.send(meta_motd()).await.unwrap(); message.sender.send(meta_motd()).await.unwrap();
Ok(())
} }
} }