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

Method StreamChunk

src/ClientHandle.cpp:360–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359
360void cClientHandle::StreamChunk(int a_ChunkX, int a_ChunkZ)
361{
362 if (m_State >= csDestroying)
363 {
364 // Don't stream chunks to clients that are being destroyed
365 return;
366 }
367
368 cWorld * World = m_Player->GetWorld();
369 ASSERT(World != NULL);
370
371 if (World->AddChunkClient(a_ChunkX, a_ChunkZ, this))
372 {
373 {
374 cCSLock Lock(m_CSChunkLists);
375 m_LoadedChunks.push_back(cChunkCoords(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ));
376 m_ChunksToSend.push_back(cChunkCoords(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ));
377 }
378 World->SendChunkTo(a_ChunkX, a_ChunkZ, this);
379 }
380}
381
382
383

Callers

nothing calls this directly

Calls 4

cChunkCoordsClass · 0.85
SendChunkToMethod · 0.80
GetWorldMethod · 0.45
AddChunkClientMethod · 0.45

Tested by

no test coverage detected