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

Method GetClientSlot

src/engine/shared/network_server.cpp:550–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550int CNetServer::GetClientSlot(const NETADDR &Addr)
551{
552 for(int i = 0; i < MaxClients(); i++)
553 {
554 if(m_aSlots[i].m_Connection.State() != CNetConnection::EState::OFFLINE &&
555 m_aSlots[i].m_Connection.State() != CNetConnection::EState::ERROR &&
556 net_addr_comp(m_aSlots[i].m_Connection.PeerAddress(), &Addr) == 0)
557 {
558 return i;
559 }
560 }
561 return -1;
562}
563
564static bool IsDDNetControlMsg(const CNetPacketConstruct *pPacket)
565{

Callers

nothing calls this directly

Calls 3

net_addr_compFunction · 0.85
StateMethod · 0.45
PeerAddressMethod · 0.45

Tested by

no test coverage detected