Danbias/Code/Game/DanBiasServer/LobbySessions/MainLobby.h

50 lines
1.5 KiB
C
Raw Normal View History

2014-01-07 10:26:09 +01:00
/////////////////////////////////////////////////////////////////////
// Created by [Dennis Andersen] [2013]
/////////////////////////////////////////////////////////////////////
2013-12-13 23:47:16 +01:00
#ifndef DANBIASSERVER_MAINLOBBY_H
#define DANBIASSERVER_MAINLOBBY_H
2013-12-12 09:33:59 +01:00
2014-01-07 10:26:09 +01:00
#include "NetworkSession.h"
2013-12-19 12:32:23 +01:00
#include "GameLobby.h"
#include <Protocols.h>
#include <PostBox\IPostBox.h>
#include <WinTimer.h>
2013-12-12 09:33:59 +01:00
namespace DanBias
{
class MainLobby :public NetworkSession
{
public:
MainLobby();
virtual~MainLobby();
2013-12-12 09:33:59 +01:00
void Release();
2013-12-13 23:47:16 +01:00
void Frame();
void SetPostbox(Oyster::IPostBox<NetworkSession::NetEvent>* box);
2013-12-19 12:32:23 +01:00
Oyster::IPostBox<NetworkSession::NetEvent>* GetPostbox();
void SetRefreshFrequency(float delta);
float GetRefreshFrequency() const;
2013-12-12 09:33:59 +01:00
private:
2013-12-16 09:50:23 +01:00
void ParseEvents();
void ParseGeneralProtocol(Oyster::Network::CustomNetProtocol& p, DanBias::LobbyClient* c);
void ParseLobbyProtocol(Oyster::Network::CustomNetProtocol& p, DanBias::LobbyClient* c);
2013-12-19 12:32:23 +01:00
void GeneralStatus(GameLogic::Protocol_General_Status& p, DanBias::LobbyClient* c);
2014-01-07 10:26:09 +01:00
void CreateGame(GameLogic::Protocol_LobbyCreateGame& p, DanBias::LobbyClient* c);
void JoinLobby(GameLogic::Protocol_LobbyJoin& p, DanBias::LobbyClient* c);
2013-12-12 09:33:59 +01:00
2013-12-18 08:44:10 +01:00
private:
2013-12-19 12:32:23 +01:00
Oyster::IPostBox<NetworkSession::NetEvent> *box;
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<GameLobby>> gameLobby;
Utility::WinTimer timer;
float refreshFrequency;
2014-01-07 10:26:09 +01:00
private:
friend class AdminInterface;
2013-12-12 09:33:59 +01:00
};
}//End namespace DanBias
#endif // !DANBIASGAME_GAMELOBBY_H