GameLogic - Pre merge with Netowkr

This commit is contained in:
dean11 2013-12-16 09:50:23 +01:00
parent 34d79d1207
commit 7cda07507a
4 changed files with 24 additions and 23 deletions

View File

@ -18,25 +18,26 @@ namespace DanBias
void MainLobby::Frame() void MainLobby::Frame()
{ {
if(!this->box.IsEmpty()) ParseEvents();
{
NetEvent &e = this->box.Fetch();
ParseEvent(e);
}
} }
//////// Private //////// Private
void MainLobby::ParseEvent(NetEvent& e) void MainLobby::ParseEvents()
{ {
static const short i = MAXSHORT; if(!this->box.IsEmpty())
if(e.protocol[0].type != Oyster::Network::NetAttributeType_Short) return;
short f = e.protocol[0].value.netShort;
switch (f)
{ {
default: NetEvent &e = this->box.Fetch();
break;
if(e.protocol[0].type != Oyster::Network::NetAttributeType_Short) return;
short f = e.protocol[0].value.netShort;
switch (f)
{
default:
break;
}
} }
} }

View File

@ -15,7 +15,7 @@ namespace DanBias
void Frame(); void Frame();
private: private:
void ParseEvent(NetEvent& e); void ParseEvents();
}; };
}//End namespace DanBias }//End namespace DanBias

View File

@ -7,15 +7,15 @@
/* THERE CAN ABSOLUTLEY NOT BE TWO DEFINITIONS WITH THE SAME ID!! */ /* THERE CAN ABSOLUTLEY NOT BE TWO DEFINITIONS WITH THE SAME ID!! */
#define protocol_PlayerNavigation 0 #define protocol_Gamplay_PlayerNavigation 0
#define protocol_PlayerPosition 1 #define protocol_Gamplay_PlayerPosition 1
#define protocol_ObjectPosition 2 #define protocol_Gamplay_ObjectPosition 2
#define protocol_Lobby_Msg 60 #define protocol_Lobby_Msg 100
#define protocol_General_Disconnect 100 #define protocol_General_Disconnect 200
#define protocol_General_Ping 101 #define protocol_General_Ping 201
#define PROTOCOL_TEST 1000 #define PROTOCOL_TEST 1000
#endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H #endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H

View File

@ -54,7 +54,7 @@ namespace Oyster
template <class T> template <class T>
bool PostBox<T>::IsEmpty() bool PostBox<T>::IsEmpty()
{ {
return !messages.IsEmpty(); return messages.IsEmpty();
} }
} }