Running astyle.
This commit is contained in:
@@ -58,12 +58,12 @@ ServerManager::Init(unsigned serverPort, bool ipv6, ServerTransportProtocol prot
|
||||
tcpAcceptHelper->Listen(serverPort, ipv6, logDir, m_lobbyThread);
|
||||
m_acceptHelperPool.push_back(tcpAcceptHelper);
|
||||
}
|
||||
/* if (proto & TRANSPORT_PROTOCOL_SCTP)
|
||||
{
|
||||
boost::shared_ptr<ServerAcceptInterface> sctpAcceptHelper(new ServerAcceptHelper<boost::asio::ip::sctp>(GetGui(), m_ioService));
|
||||
sctpAcceptHelper->Listen(serverPort, ipv6, logDir, m_lobbyThread);
|
||||
m_acceptHelperPool.push_back(sctpAcceptHelper);
|
||||
}*/
|
||||
/* if (proto & TRANSPORT_PROTOCOL_SCTP)
|
||||
{
|
||||
boost::shared_ptr<ServerAcceptInterface> sctpAcceptHelper(new ServerAcceptHelper<boost::asio::ip::sctp>(GetGui(), m_ioService));
|
||||
sctpAcceptHelper->Listen(serverPort, ipv6, logDir, m_lobbyThread);
|
||||
m_acceptHelperPool.push_back(sctpAcceptHelper);
|
||||
}*/
|
||||
}
|
||||
|
||||
GuiInterface &
|
||||
|
||||
@@ -50,19 +50,16 @@ public:
|
||||
typedef typename P::endpoint P_endpoint;
|
||||
|
||||
ServerAcceptHelper(ServerCallback &serverCallback, boost::shared_ptr<boost::asio::io_service> ioService)
|
||||
: m_ioService(ioService), m_serverCallback(serverCallback)
|
||||
{
|
||||
: m_ioService(ioService), m_serverCallback(serverCallback) {
|
||||
m_acceptor.reset(new P_acceptor(*m_ioService));
|
||||
}
|
||||
|
||||
virtual ~ServerAcceptHelper()
|
||||
{
|
||||
virtual ~ServerAcceptHelper() {
|
||||
}
|
||||
|
||||
// Set the parameters.
|
||||
virtual void Listen(unsigned serverPort, bool ipv6, const std::string &/*logDir*/,
|
||||
boost::shared_ptr<ServerLobbyThread> lobbyThread)
|
||||
{
|
||||
boost::shared_ptr<ServerLobbyThread> lobbyThread) {
|
||||
m_lobbyThread = lobbyThread;
|
||||
|
||||
try {
|
||||
@@ -78,16 +75,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Close()
|
||||
{
|
||||
virtual void Close() {
|
||||
boost::system::error_code ec;
|
||||
m_acceptor->close(ec);
|
||||
// Ignore any error, because we are terminating.
|
||||
}
|
||||
protected:
|
||||
|
||||
void InternalListen(unsigned serverPort, bool ipv6)
|
||||
{
|
||||
void InternalListen(unsigned serverPort, bool ipv6) {
|
||||
if (serverPort < 1024)
|
||||
throw ServerException(__FILE__, __LINE__, ERR_SOCK_INVALID_PORT, 0);
|
||||
|
||||
@@ -117,8 +112,7 @@ protected:
|
||||
}
|
||||
|
||||
void HandleAccept(boost::shared_ptr<typename P::socket> acceptedSocket,
|
||||
const boost::system::error_code &error)
|
||||
{
|
||||
const boost::system::error_code &error) {
|
||||
if (!error) {
|
||||
boost::asio::socket_base::non_blocking_io command(true);
|
||||
acceptedSocket->io_control(command);
|
||||
@@ -139,13 +133,11 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
ServerCallback &GetCallback()
|
||||
{
|
||||
ServerCallback &GetCallback() {
|
||||
return m_serverCallback;
|
||||
}
|
||||
|
||||
ServerLobbyThread &GetLobbyThread()
|
||||
{
|
||||
ServerLobbyThread &GetLobbyThread() {
|
||||
return *m_lobbyThread;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,8 +86,12 @@ public:
|
||||
return *m_sendBuffer;
|
||||
}
|
||||
|
||||
void Close() {m_callback.CloseSession(shared_from_this());}
|
||||
void HandlePacket(boost::shared_ptr<NetPacket> packet) {m_callback.HandlePacket(shared_from_this(), packet);}
|
||||
void Close() {
|
||||
m_callback.CloseSession(shared_from_this());
|
||||
}
|
||||
void HandlePacket(boost::shared_ptr<NetPacket> packet) {
|
||||
m_callback.HandlePacket(shared_from_this(), packet);
|
||||
}
|
||||
|
||||
void ResetActivityTimer();
|
||||
unsigned GetActivityTimerElapsedSec() const;
|
||||
|
||||
Reference in New Issue
Block a user