Compare commits
No commits in common. "ff3a51809c9bd9e78b5816d4d8c2414e7b778ebc" and "9aaa0c87ea23b0da713091934042b33d4680995e" have entirely different histories.
ff3a51809c
...
9aaa0c87ea
3 changed files with 21 additions and 14 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -216,9 +216,9 @@ checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.1.8"
|
version = "1.1.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549"
|
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
|
@ -1233,9 +1233,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "object"
|
name = "object"
|
||||||
version = "0.36.3"
|
version = "0.36.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
|
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
|
@ -48,9 +48,10 @@ 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;
|
user_handler.process(message).await.unwrap();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
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;
|
||||||
|
@ -15,7 +16,7 @@ impl UserHandler {
|
||||||
UserHandler { state }
|
UserHandler { state }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn process(&self, message: NewUser) {
|
pub async fn process(&self, message: NewUser) -> Result<()> {
|
||||||
//
|
//
|
||||||
// Create, Register, and Hydrate new user
|
// Create, Register, and Hydrate new user
|
||||||
//
|
//
|
||||||
|
@ -37,13 +38,16 @@ 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
|
||||||
// message.sender.send(meta_chat_update(&self.state)).await;
|
.sender
|
||||||
// message
|
.send(meta_chat_update(&self.state))
|
||||||
// .sender
|
.await
|
||||||
// .send(meta_server_summary_update(&self.state))
|
.unwrap();
|
||||||
// .await
|
message
|
||||||
// .unwrap();
|
.sender
|
||||||
|
.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))
|
||||||
|
@ -76,6 +80,8 @@ 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