mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
keep lifebans at the tail of bans list. Fixes #131
This commit is contained in:
parent
f14f821120
commit
8f5f45c18f
|
@ -206,15 +206,20 @@ int CNetServer::BanAdd(NETADDR Addr, int Seconds, const char *pReason)
|
||||||
CBan *pInsertAfter = m_BanPool_FirstUsed;
|
CBan *pInsertAfter = m_BanPool_FirstUsed;
|
||||||
MACRO_LIST_FIND(pInsertAfter, m_pNext, Stamp < pInsertAfter->m_Info.m_Expires);
|
MACRO_LIST_FIND(pInsertAfter, m_pNext, Stamp < pInsertAfter->m_Info.m_Expires);
|
||||||
|
|
||||||
if(pInsertAfter)
|
if(pInsertAfter && Stamp != -1)
|
||||||
pInsertAfter = pInsertAfter->m_pPrev;
|
pInsertAfter = pInsertAfter->m_pPrev;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// add to last
|
// add to last
|
||||||
|
if (m_BanPool_FirstUsed->m_Info.m_Expires == -1)
|
||||||
|
pInsertAfter = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
pInsertAfter = m_BanPool_FirstUsed;
|
pInsertAfter = m_BanPool_FirstUsed;
|
||||||
while(pInsertAfter->m_pNext)
|
while(pInsertAfter->m_pNext && pInsertAfter->m_pNext->m_Info.m_Expires != -1)
|
||||||
pInsertAfter = pInsertAfter->m_pNext;
|
pInsertAfter = pInsertAfter->m_pNext;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(pInsertAfter)
|
if(pInsertAfter)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue