Danbias/Code/Game/DanBiasServer/ServerObjects/NetworkSession.h

46 lines
1.0 KiB
C
Raw Normal View History

2013-12-12 09:33:59 +01:00
#ifndef DANBIASSERVER_NETWORK_SESSION_H
#define DANBIASSERVER_NETWORK_SESSION_H
#define NOMINMAX
2013-12-12 09:33:59 +01:00
#include "Utilities.h"
2013-12-13 23:47:16 +01:00
#include <PostBox\PostBox.h>
2013-12-12 09:33:59 +01:00
#include <PlayerProtocols.h>
#include <vector>
namespace DanBias
{
2013-12-13 23:47:16 +01:00
class ClientObject;
2013-12-12 09:33:59 +01:00
class NetworkSession
{
2013-12-13 23:47:16 +01:00
public:
struct ClientEvent
{
ClientObject* reciever;
Oyster::Network::CustomNetProtocol protocol;
ClientEvent() { reciever = 0; }
~ClientEvent() { }
};
2013-12-12 09:33:59 +01:00
public:
NetworkSession();
~NetworkSession();
2013-12-13 23:47:16 +01:00
void AttachClient(Utility::DynamicMemory::SmartPointer<ClientObject> client);
2013-12-12 09:33:59 +01:00
void DetachClient(short ID);
void DetachClient();
2013-12-12 09:33:59 +01:00
void Kick();
2013-12-12 10:36:55 +01:00
void Send(Oyster::Network::CustomNetProtocol& protocol);
void Send(Oyster::Network::CustomNetProtocol& protocol, int ID);
2013-12-12 09:33:59 +01:00
//TODO: Do more lobby features
protected:
std::vector<Utility::DynamicMemory::SmartPointer<ClientObject>> clients;
2013-12-13 23:47:16 +01:00
Oyster::PostBox<DanBias::NetworkSession::ClientEvent> box;
2013-12-12 09:33:59 +01:00
};
}//End namespace DanBias
#endif // !DANBIASSERVER_NETWORK_SESSION_H