mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-05 05:17:46 -04:00
clion, your formatting is pissing me off
This commit is contained in:
@@ -579,28 +579,22 @@ void Connection::onConnectionOverflowing(unsigned int totalBytes)
|
||||
|
||||
void Connection::onConnectionClosed(Connection *)
|
||||
{
|
||||
bool triggerOnConnectionClosed = true; // default - trigger the callback
|
||||
if (getService())
|
||||
{
|
||||
getService()->onConnectionClosed(this);
|
||||
}
|
||||
|
||||
|
||||
if (udpConnection)
|
||||
{
|
||||
UdpConnection::DisconnectReason reason = udpConnection->GetDisconnectReason();
|
||||
|
||||
if (reason == UdpConnection::cDisconnectDosAsshole) {
|
||||
triggerOnConnectionClosed = false; // no need - hopefully the destructor is just called
|
||||
}
|
||||
|
||||
UdpConnection::DisconnectReason reason = udpConnection->GetDisconnectReason();
|
||||
setDisconnectReason("Connection::onConnectionClosed (udplibrary:%s)", UdpConnection::DisconnectReasonText(reason));
|
||||
FATAL(ConfigSharedNetwork::getFatalOnConnectionClosed(), ("Connection closed %s", UdpConnection::DisconnectReasonText(reason)));
|
||||
}
|
||||
else
|
||||
{
|
||||
setDisconnectReason("Connection::onConnectionClosed called");
|
||||
}
|
||||
|
||||
if (triggerOnConnectionClosed && getService())
|
||||
{
|
||||
getService()->onConnectionClosed(this);
|
||||
}
|
||||
{
|
||||
setDisconnectReason("Connection::onConnectionClosed called");
|
||||
}
|
||||
|
||||
if (ConfigSharedNetwork::getLogConnectionOpenedClosed())
|
||||
{
|
||||
|
||||
@@ -192,7 +192,7 @@ Service::~Service()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
void Service::onConnectionClosed(Connection * c)
|
||||
{
|
||||
if (c)
|
||||
@@ -201,7 +201,9 @@ void Service::onConnectionClosed(Connection * c)
|
||||
if (f != connections.end())
|
||||
{
|
||||
if (m_tcpServer)
|
||||
{
|
||||
m_tcpServer->onConnectionClosed(c->getTcpClient());
|
||||
}
|
||||
connections.erase(f);
|
||||
}
|
||||
c->setService(0);
|
||||
@@ -214,16 +216,16 @@ void Service::onConnectionOpened(Connection * c)
|
||||
{
|
||||
if (c)
|
||||
{
|
||||
if (connections.size() < static_cast<size_t>(m_maxConnections))
|
||||
{
|
||||
c->setService(this);
|
||||
c->onConnectionOpened();
|
||||
connections.insert(c);
|
||||
if (connections.size() < static_cast<size_t>(m_maxConnections))
|
||||
{
|
||||
c->setService(this);
|
||||
c->onConnectionOpened();
|
||||
connections.insert(c);
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING(true, ("Service has reached it's maximum connection count (%d).", m_maxConnections));
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING(true, ("Service has reached it's maximum connection count (%d).", m_maxConnections));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user