redundant
This commit is contained in:
parent
38f1f19e7a
commit
ff3a51809c
2 changed files with 10 additions and 17 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue