refactor message handling to drive state transitions

This commit is contained in:
2025-05-17 11:04:26 -06:00
parent d9d7325e04
commit fee5576efd
6 changed files with 24 additions and 43 deletions
-5
View File
@@ -42,11 +42,6 @@ impl Context {
ewebsock::WsMessage::Text(msg) => {
let game_resp: GameResponse = serde_json::from_str(&msg).unwrap();
if let GameResponse::JoinResponse { username, token } = &game_resp {
self.username = username.clone();
self.token = token.clone();
}
Some(game_resp)
}
_ => None,