DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

5409a8d8c9754cee5562f63c70d252c9a62095b4 — Jonni Liljamo 1 year, 10 months ago f920882
feat(client): handle create game datarequestresponse
1 files changed, 5 insertions(+), 2 deletions(-)

M client/src/plugins/networking/systems/events/receive/mod.rs
M client/src/plugins/networking/systems/events/receive/mod.rs => client/src/plugins/networking/systems/events/receive/mod.rs +5 -2
@@ 21,7 21,7 @@ use crate::{
    plugins::menu::{
        ui::{
            connect::{ConnectScreenData, ConnectState},
            play::PlayScreenData,
            play::{PlayScreenData, PlayScreenState},
        },
        MenuState,
    },


@@ 84,7 84,10 @@ pub fn message_events(
        for response in events.read::<DataRequestChannel, DataRequestResponse>() {
            match DataRequestType::from_u8(&response.r#type) {
                DataRequestType::GameCreate => {
                    // TODO: set cur_game, send player to lobby screen
                    // TODO: handle possible error (unwrap,
                    //       and if the response data is an error)
                    play_data.cur_game = serde_json::from_str(&response.data).unwrap();
                    play_data.state = PlayScreenState::InLobbyHost;
                }
                DataRequestType::GameAllForming => {
                    // TODO: handle possible error