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"
|
2014-01-14 09:25:22 +01:00
|
|
|
#include <Protocols.h>
|
2013-12-18 13:07:10 +01:00
|
|
|
#include <PostBox\IPostBox.h>
|
2014-01-22 15:22:52 +01:00
|
|
|
#include <WinTimer.h>
|
2013-12-12 09:33:59 +01:00
|
|
|
|
|
|
|
namespace DanBias
|
|
|
|
{
|
|
|
|
class MainLobby :public NetworkSession
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MainLobby();
|
2013-12-18 13:07:10 +01:00
|
|
|
virtual~MainLobby();
|
2013-12-12 09:33:59 +01:00
|
|
|
void Release();
|
|
|
|
|
2013-12-13 23:47:16 +01:00
|
|
|
void Frame();
|
|
|
|
|
2014-01-22 15:22:52 +01:00
|
|
|
void SetPostbox(Oyster::IPostBox<NetworkSession::NetEvent>* box);
|
2013-12-19 12:32:23 +01:00
|
|
|
Oyster::IPostBox<NetworkSession::NetEvent>* GetPostbox();
|
|
|
|
|
2014-01-22 15:22:52 +01:00
|
|
|
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();
|
2014-01-22 15:22:52 +01:00
|
|
|
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
|
|
|
|
2014-01-22 15:22:52 +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);
|
2014-01-22 15:22:52 +01:00
|
|
|
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;
|
2014-01-22 15:22:52 +01:00
|
|
|
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
|