mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 23:27:45 +00:00
56 lines
1,023 B
C
56 lines
1,023 B
C
![]() |
#pragma once
|
||
|
|
||
|
#ifndef _CSERVERLOBBY_H_
|
||
|
#define _CSERVERLOBBY_H_
|
||
|
|
||
|
#include <map>
|
||
|
|
||
|
#include <boost/shared_ptr.hpp>
|
||
|
#include <Server_Common/XMLConfig.h>
|
||
|
|
||
|
#include "Forwards.h"
|
||
|
|
||
|
const std::string LOBBY_VERSION = "0.0.5";
|
||
|
|
||
|
namespace Core
|
||
|
{
|
||
|
class LobbySession;
|
||
|
class XMLConfig;
|
||
|
typedef std::map< std::string, LobbySessionPtr > LobbySessionMap;
|
||
|
|
||
|
class ServerLobby
|
||
|
{
|
||
|
|
||
|
friend class LobbyConnection;
|
||
|
private:
|
||
|
|
||
|
LobbySessionMap m_sessionMap;
|
||
|
std::string m_configPath;
|
||
|
|
||
|
uint16_t m_port;
|
||
|
std::string m_ip;
|
||
|
|
||
|
public:
|
||
|
ServerLobby( const std::string& configPath );
|
||
|
~ServerLobby( void );
|
||
|
|
||
|
void run( int argc, char* argv[] );
|
||
|
|
||
|
bool loadSettings( int argc, char* argv[] );
|
||
|
|
||
|
void addSession( char* sessionId, LobbySessionPtr pSession )
|
||
|
{
|
||
|
m_sessionMap[std::string( sessionId )] = pSession;
|
||
|
}
|
||
|
|
||
|
LobbySessionPtr getSession( char* sessionId );
|
||
|
uint32_t m_numConnections;
|
||
|
boost::shared_ptr<XMLConfig> m_pConfig;
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|