bunch of stuff

This commit is contained in:
Dander7BD 2014-02-18 16:44:38 +01:00
parent e37dd606ba
commit a6f740e1f8
3 changed files with 20 additions and 1 deletions

View File

@ -314,6 +314,13 @@ void GameState::ReadKeyInput()
void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e ) void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> 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; CustomNetProtocol data = e.args.data.protocol;
short ID = data[0].value.netShort; // fetching the id data. short ID = data[0].value.netShort; // fetching the id data.

View File

@ -133,6 +133,16 @@ void LanMenuState::ChangeState( ClientState next )
this->privData->nextState = next; this->privData->nextState = next;
} }
void LanMenuState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> 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<LanMenuState*>& e ) void OnButtonInteract_Connect( Oyster::Event::ButtonEvent<LanMenuState*>& e )
{ {
switch( e.state ) switch( e.state )

View File

@ -21,6 +21,8 @@ namespace DanBias
virtual bool Release(); virtual bool Release();
void ChangeState( ClientState next ); void ChangeState( ClientState next );
void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e );
private: private:
struct MyData; struct MyData;
::Utility::DynamicMemory::UniquePointer<MyData> privData; ::Utility::DynamicMemory::UniquePointer<MyData> privData;