mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
updating existing bans' expiration would break ordering in bans sorted list
This commit is contained in:
parent
0c16a58563
commit
385be8a716
|
@ -174,15 +174,11 @@ int CNetServer::BanAdd(NETADDR Addr, int Seconds, const char *pReason)
|
|||
if(Seconds)
|
||||
Stamp = time_timestamp() + Seconds;
|
||||
|
||||
// search to see if it already exists
|
||||
// search to remove it if it already exists
|
||||
pBan = m_aBans[IpHash];
|
||||
MACRO_LIST_FIND(pBan, m_pHashNext, net_addr_comp(&pBan->m_Info.m_Addr, &Addr) == 0);
|
||||
if(pBan)
|
||||
{
|
||||
// adjust the ban
|
||||
pBan->m_Info.m_Expires = Stamp;
|
||||
return 0;
|
||||
}
|
||||
BanRemoveByObject(pBan);
|
||||
|
||||
if(!m_BanPool_FirstFree)
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue