Compare commits
2 commits
9aaa0c87ea
...
ff3a51809c
Author | SHA1 | Date | |
---|---|---|---|
|
ff3a51809c | ||
|
38f1f19e7a |
3 changed files with 14 additions and 21 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -216,9 +216,9 @@ checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.1.7"
|
||||
version = "1.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
|
||||
checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
|
@ -1233,9 +1233,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
|||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.36.2"
|
||||
version = "0.36.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
|
||||
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue