2013-12-12 09:33:59 +01:00
|
|
|
#include "MainLobby.h"
|
2013-12-16 09:00:11 +01:00
|
|
|
#include <PlayerProtocols.h>
|
2013-12-18 13:07:10 +01:00
|
|
|
#include <PostBox\PostBox.h>
|
2013-12-12 09:33:59 +01:00
|
|
|
|
|
|
|
namespace DanBias
|
|
|
|
{
|
|
|
|
MainLobby::MainLobby()
|
|
|
|
{
|
2013-12-18 13:07:10 +01:00
|
|
|
this->box = new Oyster::PostBox<DanBias::NetworkSession::NetEvent>();
|
2013-12-12 09:33:59 +01:00
|
|
|
}
|
|
|
|
MainLobby::~MainLobby()
|
|
|
|
{
|
2013-12-18 13:07:10 +01:00
|
|
|
delete this->box;
|
|
|
|
this->box = 0;
|
2013-12-12 09:33:59 +01:00
|
|
|
}
|
|
|
|
void MainLobby::Release()
|
|
|
|
{
|
2013-12-18 13:07:10 +01:00
|
|
|
this->CloseSession(0);
|
2013-12-13 23:47:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainLobby::Frame()
|
|
|
|
{
|
2013-12-16 09:50:23 +01:00
|
|
|
ParseEvents();
|
2013-12-16 09:00:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//////// Private
|
2013-12-16 09:50:23 +01:00
|
|
|
void MainLobby::ParseEvents()
|
2013-12-16 09:00:11 +01:00
|
|
|
{
|
2013-12-18 13:07:10 +01:00
|
|
|
if(this->box && !this->box->IsEmpty())
|
2013-12-16 09:50:23 +01:00
|
|
|
{
|
2013-12-18 08:44:10 +01:00
|
|
|
NetEvent &e = this->box->Fetch();
|
2013-12-16 09:00:11 +01:00
|
|
|
|
2013-12-16 09:50:23 +01:00
|
|
|
if(e.protocol[0].type != Oyster::Network::NetAttributeType_Short) return;
|
2013-12-12 09:33:59 +01:00
|
|
|
|
2013-12-16 09:50:23 +01:00
|
|
|
short f = e.protocol[0].value.netShort;
|
|
|
|
|
|
|
|
switch (f)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2013-12-13 23:47:16 +01:00
|
|
|
}
|
2013-12-12 09:33:59 +01:00
|
|
|
}
|
2013-12-16 09:00:11 +01:00
|
|
|
|
2013-12-12 09:33:59 +01:00
|
|
|
}//End namespace DanBias
|