2014-01-13 12:44:33 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
// Created by [Dennis Andersen] [2013]
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
#include "GameSession.h"
|
|
|
|
#include "GameClient.h"
|
|
|
|
|
2014-01-14 09:25:22 +01:00
|
|
|
#include <Protocols.h>
|
2014-01-13 12:44:33 +01:00
|
|
|
#include <PostBox\PostBox.h>
|
|
|
|
#include <GameLogicStates.h>
|
|
|
|
#include <Windows.h>
|
2014-01-15 08:18:06 +01:00
|
|
|
#include <OysterMath.h>
|
2014-01-13 12:44:33 +01:00
|
|
|
|
|
|
|
using namespace Utility::DynamicMemory;
|
|
|
|
using namespace Oyster;
|
|
|
|
using namespace Oyster::Network;
|
|
|
|
using namespace Oyster::Thread;
|
|
|
|
using namespace GameLogic;
|
|
|
|
|
|
|
|
namespace DanBias
|
|
|
|
{
|
|
|
|
bool GameSession::DoWork( )
|
|
|
|
{
|
|
|
|
if(GetAsyncKeyState(VK_UP))
|
|
|
|
{
|
|
|
|
Protocol_General_Status p(Protocol_General_Status::States_ready);
|
|
|
|
Send(p.GetProtocol());
|
|
|
|
Sleep(100);
|
|
|
|
}
|
2014-01-15 08:18:06 +01:00
|
|
|
if(GetAsyncKeyState(VK_DOWN))
|
|
|
|
{
|
|
|
|
Oyster::Math::Float4x4 world = Oyster::Math::Matrix::identity;
|
|
|
|
Protocol_CreateObject p(world, 2, "../Content/crate");
|
|
|
|
Send(p.GetProtocol());
|
|
|
|
Sleep(100);
|
|
|
|
}
|
2014-01-13 12:44:33 +01:00
|
|
|
|
2014-01-15 11:03:25 +01:00
|
|
|
this->ParseEvents();
|
|
|
|
|
|
|
|
this->gameInstance.NewFrame();
|
|
|
|
|
|
|
|
this->UpdateGameObjects();
|
|
|
|
|
2014-01-13 12:44:33 +01:00
|
|
|
return this->isRunning;
|
|
|
|
}
|
|
|
|
|
2014-01-15 11:03:25 +01:00
|
|
|
void GameSession::UpdateGameObjects()
|
|
|
|
{
|
|
|
|
while(!this->modifiedClient.IsEmpty())
|
|
|
|
{
|
|
|
|
//There is something that needs update
|
|
|
|
GameSessionEvent e = this->modifiedClient.Pop();
|
|
|
|
|
|
|
|
switch (e.value)
|
|
|
|
{
|
|
|
|
case GameSessionEvent::EventType_Player:
|
|
|
|
//e.data.player->GetOrientation();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-13 12:44:33 +01:00
|
|
|
}//End namespace DanBias
|
|
|
|
|