Respect reserved slots in old serverinfo

Noticed in https://github.com/ddnet/ddnet/pull/5850 that reserved slots
were not respected
This commit is contained in:
def 2022-09-18 13:21:04 +02:00
parent 62a95416c3
commit fa80b157aa

View file

@ -1886,7 +1886,8 @@ void CServer::CacheServerInfo(CCache *pCache, int Type, bool SendClients)
}
else
{
str_format(aBuf, sizeof(aBuf), "%s [%d/%d]", Config()->m_SvName, ClientCount, m_NetServer.MaxClients());
const int MaxClients = maximum(ClientCount, m_NetServer.MaxClients() - Config()->m_SvReservedSlots);
str_format(aBuf, sizeof(aBuf), "%s [%d/%d]", Config()->m_SvName, ClientCount, MaxClients);
p.AddString(aBuf, 64);
}
}