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,9 +314,16 @@ void GameState::ReadKeyInput()
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;
short ID = data[0].value.netShort; // fetching the id data.
if( ProtocolIsGameplay(ID) )
{
switch(ID)

View File

@ -133,6 +133,16 @@ void LanMenuState::ChangeState( ClientState 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 )
{
switch( e.state )

View File

@ -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<MyData> privData;