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

Method StreamNext

src/Map.cpp:414–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412
413
414void cMap::StreamNext(cMapClient & a_Client)
415{
416 cClientHandle * Handle = a_Client.m_Handle;
417
418 if (a_Client.m_SendInfo)
419 {
420 Handle->SendMapInfo(m_ID, m_Scale);
421
422 a_Client.m_SendInfo = false;
423
424 return;
425 }
426
427 ++a_Client.m_NextDecoratorUpdate;
428
429 if (a_Client.m_NextDecoratorUpdate >= 4)
430 {
431 // TODO 2014-02-19 xdot
432 // This is dangerous as the player object may have been destroyed before the decorator is erased from the list
433 UpdateDecorators();
434
435 Handle->SendMapDecorators(m_ID, m_Decorators);
436
437 a_Client.m_NextDecoratorUpdate = 0;
438 }
439 else
440 {
441 ++a_Client.m_DataUpdate;
442
443 unsigned int Y = (a_Client.m_DataUpdate * 11) % m_Width;
444
445 const Byte * Colors = &m_Data[Y * m_Height];
446
447 Handle->SendMapColumn(m_ID, Y, 0, Colors, m_Height);
448 }
449}
450
451
452

Callers

nothing calls this directly

Calls 3

SendMapInfoMethod · 0.45
SendMapDecoratorsMethod · 0.45
SendMapColumnMethod · 0.45

Tested by

no test coverage detected