game creation works

This commit is contained in:
Adam 2024-05-03 19:13:00 -04:00
parent de67f31ba3
commit 302efad4c9

View file

@ -60,7 +60,8 @@ pub async fn websocket(stream: WebSocket, state: Arc<AppState>) {
tracing::debug!("Text: {}", text); tracing::debug!("Text: {}", text);
if let Ok(new_game) = serde_json::from_str::<NewGameRequest>(&text) { if let Ok(new_game) = serde_json::from_str::<NewGameRequest>(&text) {
tracing::debug!("{:#?}", new_game); tracing::debug!("{:#?}", &new_game);
state.games.lock().unwrap().push(CAHGame::new(new_game).expect("error creating game"));
} else { } else {
// just echo // just echo
let _res = sender.send(Message::Text(text)).await; let _res = sender.send(Message::Text(text)).await;