Added General Protocol to DataRecieved overloads

This commit is contained in:
Dander7BD 2014-02-12 09:54:33 +01:00
parent 6bf7bc898e
commit fdb7a7e1b6
2 changed files with 128 additions and 111 deletions

View File

@ -496,10 +496,8 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, ClientEventArgs> e )
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.
// Block irrelevant messages. if( ProtocolIsGameplay(ID) )
if( !ProtocolIsGameplay(ID) ) {
return;
switch(ID) switch(ID)
{ {
case protocol_Gameplay_ObjectPickup: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectPickup: break; /** @todo TODO: implement */
@ -604,4 +602,14 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, ClientEventArgs> e )
case protocol_Gameplay_ObjectDie: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectDie: break; /** @todo TODO: implement */
default: break; default: break;
} }
}
else if( ProtocolIsGeneral(ID) )
{
switch( ID )
{
case protocol_General_Status: break; /** @todo TODO: implement */
case protocol_General_Text: break; /** @todo TODO: implement */
default: break;
}
}
} }

View File

@ -141,9 +141,8 @@ void LobbyState::DataRecieved( NetEvent<NetworkClient*, ClientEventArgs> e )
short ID = data[0].value.netShort; // fetching the id data. short ID = data[0].value.netShort; // fetching the id data.
// Block irrelevant messages. // Block irrelevant messages.
if( !ProtocolIsLobby(ID) ) if( ProtocolIsLobby(ID) )
return; {
switch(ID) switch(ID)
{ {
case protocol_Lobby_Create: break; /** @todo TODO: implement */ case protocol_Lobby_Create: break; /** @todo TODO: implement */
@ -155,4 +154,14 @@ void LobbyState::DataRecieved( NetEvent<NetworkClient*, ClientEventArgs> e )
case protocol_Lobby_GameData: break; /** @todo TODO: implement */ case protocol_Lobby_GameData: break; /** @todo TODO: implement */
default: break; default: break;
} }
}
else if( ProtocolIsGeneral(ID) )
{
switch( ID )
{
case protocol_General_Status: break; /** @todo TODO: implement */
case protocol_General_Text: break; /** @todo TODO: implement */
default: break;
}
}
} }