MCPcopy Create free account
hub / github.com/cuberite/cuberite / AddClient

Method AddClient

src/Chunk.cpp:1772–1797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1770
1771
1772bool cChunk::AddClient(cClientHandle* a_Client)
1773{
1774 for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr)
1775 {
1776 if (a_Client == *itr)
1777 {
1778 // Already there, nothing needed
1779 return false;
1780 }
1781 }
1782 m_LoadedByClient.push_back( a_Client );
1783
1784 for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr )
1785 {
1786 /*
1787 // DEBUG:
1788 LOGD("cChunk: Entity #%d (%s) at [%i, %i, %i] spawning for player \"%s\"",
1789 (*itr)->GetUniqueID(), (*itr)->GetClass(),
1790 m_PosX, m_PosY, m_PosZ,
1791 a_Client->GetUsername().c_str()
1792 );
1793 */
1794 (*itr)->SpawnOn(*a_Client);
1795 }
1796 return true;
1797}
1798
1799
1800

Callers 3

OnConnectionAcceptedMethod · 0.45
AddChunkClientMethod · 0.45
OnConnectionAcceptedMethod · 0.45

Calls 3

beginMethod · 0.80
endMethod · 0.80
SpawnOnMethod · 0.45

Tested by

no test coverage detected