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