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

Method FillAntibot

src/engine/server/server.cpp:2588–2611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2586}
2587
2588void CServer::FillAntibot(CAntibotRoundData *pData)
2589{
2590 for(int ClientId = 0; ClientId < MAX_CLIENTS; ClientId++)
2591 {
2592 CAntibotPlayerData *pPlayer = &pData->m_aPlayers[ClientId];
2593 if(m_aClients[ClientId].m_State == CServer::CClient::STATE_EMPTY)
2594 {
2595 pPlayer->m_aAddress[0] = '\0';
2596 }
2597 else
2598 {
2599 // No need for expensive str_copy since we don't truncate and the string is
2600 // ASCII anyway
2601 static_assert(std::size((CAntibotPlayerData{}).m_aAddress) >= NETADDR_MAXSTRSIZE);
2602 static_assert(std::is_same_v<decltype(CServer{}.ClientAddrStringImpl(ClientId, true)), const std::array<char, NETADDR_MAXSTRSIZE> &>);
2603 mem_copy(pPlayer->m_aAddress, ClientAddrStringImpl(ClientId, true).data(), NETADDR_MAXSTRSIZE);
2604 pPlayer->m_Sixup = m_aClients[ClientId].m_Sixup;
2605 pPlayer->m_DnsblNone = m_aClients[ClientId].m_DnsblState == EDnsblState::NONE;
2606 pPlayer->m_DnsblPending = m_aClients[ClientId].m_DnsblState == EDnsblState::PENDING;
2607 pPlayer->m_DnsblBlacklisted = m_aClients[ClientId].m_DnsblState == EDnsblState::BLACKLISTED;
2608 pPlayer->m_Authed = IsRconAuthed(ClientId);
2609 }
2610 }
2611}
2612
2613void CServer::ExpireServerInfo()
2614{

Callers 1

UpdateMethod · 0.45

Calls 1

mem_copyFunction · 0.85

Tested by

no test coverage detected