Fix bug where timed out people can connect more than sv_max_clients_per_ip times

This commit is contained in:
def 2016-01-03 01:42:28 +01:00
parent 7223d0ecc1
commit c78ade00c1

View file

@ -145,7 +145,9 @@ int CNetServer::NumClientsWithAddr(NETADDR Addr)
for(int i = 0; i < MaxClients(); ++i)
{
if(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_OFFLINE ||
m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ERROR)
(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ERROR &&
(!m_aSlots[i].m_Connection.m_TimeoutProtected ||
!m_aSlots[i].m_Connection.m_TimeoutSituation)))
continue;
OtherAddr = *m_aSlots[i].m_Connection.PeerAddress();