mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Don't count (connecting) players for voting
This commit is contained in:
parent
f0d2b9ab69
commit
39b34bf40c
|
@ -702,7 +702,8 @@ int CServer::DistinctClientCount() const
|
|||
int ClientCount = 0;
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if(m_aClients[i].m_State != CClient::STATE_EMPTY)
|
||||
// connecting clients with spoofed ips can clog slots without being ingame
|
||||
if(ClientIngame(i))
|
||||
{
|
||||
ClientCount++;
|
||||
for(int j = 0; j < i; j++)
|
||||
|
|
|
@ -930,7 +930,7 @@ void CGameContext::OnTick()
|
|||
continue;
|
||||
|
||||
// connecting clients with spoofed ips can clog slots without being ingame
|
||||
if(((CServer *)Server())->m_aClients[i].m_State != CServer::CClient::STATE_INGAME)
|
||||
if(!Server()->ClientIngame(i))
|
||||
continue;
|
||||
|
||||
// don't count votes by blacklisted clients
|
||||
|
@ -1507,7 +1507,8 @@ void CGameContext::OnClientConnected(int ClientID, void *pData)
|
|||
bool Empty = true;
|
||||
for(auto &pPlayer : m_apPlayers)
|
||||
{
|
||||
if(pPlayer)
|
||||
// connecting clients with spoofed ips can clog slots without being ingame
|
||||
if(pPlayer && Server()->ClientIngame(pPlayer->GetCID()))
|
||||
{
|
||||
Empty = false;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue