diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index 3576ae65..9a0bd4db 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -314,9 +314,16 @@ void GameState::ReadKeyInput() void GameState::DataRecieved( NetEvent e ) { + if( e.args.type == NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend ) + { // TODO: Reconnect + const char *breakpoint = "temp trap"; + this->privData->nwClient->Disconnect(); + this->ChangeState( GameClientState::ClientState_Main ); + } + CustomNetProtocol data = e.args.data.protocol; short ID = data[0].value.netShort; // fetching the id data. - + if( ProtocolIsGameplay(ID) ) { switch(ID) diff --git a/Code/Game/GameClient/GameClientState/LanMenuState.cpp b/Code/Game/GameClient/GameClientState/LanMenuState.cpp index 11ca95da..178739d3 100644 --- a/Code/Game/GameClient/GameClientState/LanMenuState.cpp +++ b/Code/Game/GameClient/GameClientState/LanMenuState.cpp @@ -133,6 +133,16 @@ void LanMenuState::ChangeState( ClientState next ) this->privData->nextState = next; } +void LanMenuState::DataRecieved( NetEvent e ) +{ + if( e.args.type == NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend ) + { // TODO: Reconnect + const char *breakpoint = "temp trap"; + this->privData->nwClient->Disconnect(); + this->ChangeState( GameClientState::ClientState_Same ); + } +} + void OnButtonInteract_Connect( Oyster::Event::ButtonEvent& e ) { switch( e.state ) diff --git a/Code/Game/GameClient/GameClientState/LanMenuState.h b/Code/Game/GameClient/GameClientState/LanMenuState.h index 57889eee..9c6a8ec4 100644 --- a/Code/Game/GameClient/GameClientState/LanMenuState.h +++ b/Code/Game/GameClient/GameClientState/LanMenuState.h @@ -21,6 +21,8 @@ namespace DanBias virtual bool Release(); void ChangeState( ClientState next ); + void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e ); + private: struct MyData; ::Utility::DynamicMemory::UniquePointer privData;