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;