MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / pushResponses

Method pushResponses

source/game/StarCelestialDatabase.cpp:676–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676void CelestialSlaveDatabase::pushResponses(List<CelestialResponse> responses) {
677 RecursiveMutexLocker locker(m_mutex);
678
679 for (auto& response : responses) {
680 if (auto celestialChunk = response.leftPtr()) {
681 m_pendingChunkRequests.remove(celestialChunk->chunkIndex);
682 m_chunkCache.set(celestialChunk->chunkIndex, std::move(*celestialChunk));
683 } else if (auto celestialSystemObjects = response.rightPtr()) {
684 m_pendingSystemRequests.remove(celestialSystemObjects->systemLocation);
685 auto chunkLocation = chunkIndexFor(celestialSystemObjects->systemLocation);
686 if (auto chunk = m_chunkCache.ptr(chunkLocation))
687 chunk->systemObjects[celestialSystemObjects->systemLocation] = std::move(celestialSystemObjects->planets);
688 }
689 }
690}
691
692void CelestialSlaveDatabase::cleanup() {
693 RecursiveMutexLocker locker(m_mutex);

Callers 1

handlePacketsMethod · 0.80

Calls 5

leftPtrMethod · 0.45
removeMethod · 0.45
setMethod · 0.45
rightPtrMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected