summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2024-08-14 11:20:22 -0400
committerpommicket <pommicket@gmail.com>2024-08-14 11:20:22 -0400
commit8664ecfef8df4c1e2103a52d628f2693eefb6f89 (patch)
tree2f89b89c509a1467c7ca3d73fdd944226b2ade13 /server
parentdb63e7ada26e2aacbbaa3bf9a44fdafed9032c9e (diff)
index.html
Diffstat (limited to 'server')
-rw-r--r--server/src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 2c33174..03ae435 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -369,9 +369,10 @@ async fn handle_websocket(
)
.await?;
server.player_counts.lock().await.insert(id, 1);
+ *puzzle_id = Some(id);
ws.send(Message::Text(format!(
"id: {}",
- std::str::from_utf8(&id).expect("puzzle ID has bad utf-8???")
+ std::str::from_utf8(&id)?
)))
.await?;
let info = get_puzzle_info(server, &id).await?;
@@ -577,6 +578,7 @@ async fn main() {
tokio::time::sleep(std::time::Duration::from_secs(3600)).await;
}
});
+ println!("Server initialized! Waiting for connections...");
loop {
let (mut stream, addr) = match listener.accept().await {
Ok(result) => result,