MCPcopy Create free account
hub / github.com/ddnet/ddnet / NumClientsWithAddr

Method NumClientsWithAddr

src/engine/shared/network_server.cpp:153–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153int CNetServer::NumClientsWithAddr(NETADDR Addr)
154{
155 int FoundAddr = 0;
156 for(int i = 0; i < MaxClients(); ++i)
157 {
158 if(m_aSlots[i].m_Connection.State() == CNetConnection::EState::OFFLINE ||
159 (m_aSlots[i].m_Connection.State() == CNetConnection::EState::ERROR &&
160 (!m_aSlots[i].m_Connection.m_TimeoutProtected ||
161 !m_aSlots[i].m_Connection.m_TimeoutSituation)))
162 continue;
163
164 if(!net_addr_comp_noport(&Addr, m_aSlots[i].m_Connection.PeerAddress()))
165 FoundAddr++;
166 }
167
168 return FoundAddr;
169}
170
171bool CNetServer::Connlimit(NETADDR Addr)
172{

Callers

nothing calls this directly

Calls 3

net_addr_comp_noportFunction · 0.85
StateMethod · 0.45
PeerAddressMethod · 0.45

Tested by

no test coverage detected