mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Only ban if trying to connect within 0.5 seconds
This commit is contained in:
parent
4987b26b7b
commit
34b7ea6193
|
@ -75,7 +75,7 @@ int CNetServer::Update()
|
||||||
m_aSlots[i].m_Connection.Update();
|
m_aSlots[i].m_Connection.Update();
|
||||||
if(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ERROR)
|
if(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ERROR)
|
||||||
{
|
{
|
||||||
if (Now - m_aSlots[i].m_Connection.ConnectTime() < time_freq() && NetBan())
|
if (Now - m_aSlots[i].m_Connection.ConnectTime() < time_freq() / 2 && NetBan())
|
||||||
NetBan()->BanAddr(ClientAddr(i), 60, "Too many connections");
|
NetBan()->BanAddr(ClientAddr(i), 60, "Too many connections");
|
||||||
else
|
else
|
||||||
Drop(i, m_aSlots[i].m_Connection.ErrorString());
|
Drop(i, m_aSlots[i].m_Connection.ErrorString());
|
||||||
|
|
Loading…
Reference in a new issue