From 302efad4c993a9a80e555b89f19f801bc358c4c4 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Fri, 3 May 2024 19:13:00 -0400 Subject: [PATCH] game creation works --- src/api.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api.rs b/src/api.rs index 317adb3..c702adb 100644 --- a/src/api.rs +++ b/src/api.rs @@ -60,7 +60,8 @@ pub async fn websocket(stream: WebSocket, state: Arc) { tracing::debug!("Text: {}", text); if let Ok(new_game) = serde_json::from_str::(&text) { - tracing::debug!("{:#?}", new_game); + tracing::debug!("{:#?}", &new_game); + state.games.lock().unwrap().push(CAHGame::new(new_game).expect("error creating game")); } else { // just echo let _res = sender.send(Message::Text(text)).await;