mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
cleanup on udplib if, and hopefully properly disconnect on unsuccessful
logins to prevent blocking legit users - will have to test dossing after this
This commit is contained in:
@@ -251,7 +251,8 @@ void ClientConnection::validateClient(const std::string & id, const std::string
|
||||
|
||||
LoginServer::getInstance().onValidateClient(suid, uname, this, true, NULL, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
}
|
||||
// else this case will never be reached, noop
|
||||
|
||||
disconnect(); // to remove from their connection count
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
+4
-7
@@ -1032,15 +1032,12 @@ void UdpManager::ProcessRawPacket(const PacketHistoryEntry *e)
|
||||
// connection establish packet must always be at least 6 bytes long as we must have a version number, no matter how it changes
|
||||
if (e->mBuffer[0] == 0 && e->mBuffer[1] == UdpConnection::cUdpPacketConnect && e->mLen == UdpConnection::cUdpPacketConnectSize)
|
||||
{
|
||||
if (mParams.maxConnectionsPerIP > 0)
|
||||
if (mParams.maxConnectionsPerIP > 0 && (mIpConnectionCount[e->mIp.GetAddress()] >= mParams.maxConnectionsPerIP))
|
||||
{
|
||||
if (mIpConnectionCount[e->mIp.GetAddress()] >= mParams.maxConnectionsPerIP)
|
||||
{
|
||||
// add a strike if they're over the count
|
||||
addStrike(e->mIp, 1);
|
||||
// add a strike if they're over the count
|
||||
addStrike(e->mIp, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (mConnectionListCount >= mParams.maxConnections)
|
||||
|
||||
Reference in New Issue
Block a user