LeviLamina
Loading...
Searching...
No Matches
DBChunkStorage Class Reference
+ Inheritance diagram for DBChunkStorage:

Classes

struct  PreCavesAndCliffsMetaData
 

Public Types

enum class  ChunkCacheStatus : int { Missing = 0 , Available = 1 , DontCache = 2 }
 
enum class  LoadMode : int { None = 0 , Deferred = 1 }
 

Public Member Functions

virtual void shutdown ()
 
virtual bool isShutdownDone ()
 
virtual void loadChunk (::LevelChunk &lc, bool forceImmediateReplacementDataLoad)
 
virtual bool isChunkKnown (::ChunkPos const &chunkPos)
 
virtual bool isChunkSaved (::ChunkPos const &chunkPos)
 
virtual bool postProcess (::ChunkViewSource &neighborhood)
 
virtual void checkAndReplaceChunk (::ChunkViewSource &neighborhood, ::LevelChunk &lc)
 
virtual bool saveLiveChunk (::LevelChunk &lc)
 
virtual void writeEntityChunkTransfer (::LevelChunk &lc)
 
virtual void writeEntityChunkTransfersToUnloadedChunk (::ChunkKey const &chunkKey, ::std::vector<::ActorUnloadedChunkTransferEntry > const &transfers)
 
virtual void acquireDiscarded (::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter > ptr)
 
virtual void hintDiscardBatchBegin ()
 
virtual void hintDiscardBatchEnd ()
 
virtual void flushPendingDiscardedChunkWrites ()
 
virtual void flushThreadBatch ()
 
virtual ::std::unique_ptr<::BlendingDataProvidertryGetBlendingDataProvider ()
 
virtual ::std::shared_ptr<::LevelChunkMetaDataDictionaryloadLevelChunkMetaDataDictionary ()
 
virtual void deserializeActorStorageToLevelChunk (::LevelChunk &levelChunk)
 
virtual bool chunkPosNeedsBlending (::ChunkPos const &cp)
 
MCAPI DBChunkStorage (::std::unique_ptr<::ChunkSource > parent, ::DBStorage &storage, ::Scheduler &scheduler, ::Experiments const &experiments)
 
MCAPI ::std::pair< bool, ::std::shared_ptr<::BlendingData > > _cacheSeamlessChunkBlendingData (::ChunkPos chunkPos, bool isCompleted, ::std::shared_ptr<::BlendingData > blendingData)
 
MCAPI bool _checkSubChunksUseAbsoluteIndices (::DBChunkStorageKey key, ::LevelChunk const &lc, bool &flatworldsNeedFixup) const
 
MCAPI void _deserializeIndependentActorStorage (::LevelChunk &lc, ::std::string const &storageKeyDigestBuffer)
 
MCAPI ::std::optional<::LevelChunkFormat > _getLevelChunkFormat (::std::string_view prefix, ::std::string &buffer)
 
MCAPI bool _hasChunk (::DBChunkStorageKey const &key)
 
MCAPI bool _hasChunkUncached (::DBChunkStorageKey const &key)
 
MCAPI ::std::pair< bool, ::std::unique_ptr<::PersistentBlendData > > _levelChunkCanBeUsedForBlending (::DBChunkStorageKey const &lcKey)
 
MCAPI void _loadAndBlendFromDB (::LevelChunk &lc, ::LevelChunk &generatedChunk, ::ChunkViewSource &neighborhood)
 
MCAPI bool _loadChunkFromDB (::LevelChunk &lc, ::LevelChunk &generatedChunk, ::ChunkViewSource &neighborhood)
 
MCAPI void _saveBlendData (::LevelStorageWriteBatch &batch, ::std::string_view prefix, ::std::string &buffer, ::PersistentBlendData data) const
 
MCAPI void _serializeChunk (::LevelChunk &lc, ::LevelStorageWriteBatch &batch, bool markEntitiesProcesedOnChunkDiscard)
 
MCAPI void _serializeEntities (::LevelChunk &lc, ::LevelStorageWriteBatch &batch, ::std::string &buffer, bool markEntitiesProcesedOnChunkDiscard)
 
MCAPI ::std::pair< bool, ::std::shared_ptr<::BlendingData > > _tryGetBlendingDataForChunk (::ChunkPos const &checkPosition)
 
MCAPI::std::string _upgradeActorStorage (::ChunkKey chunkKey, ::std::string_view &legacyActorData)
 
MCAPI void _writeActorDigest (::LevelStorageWriteBatch &batch, ::ChunkKey const &chunkKey, ::std::string const &digestBuffer)
 
MCAPI void _writeDiscardChunksBatch ()
 
MCAPI void * $ctor (::std::unique_ptr<::ChunkSource > parent, ::DBStorage &storage, ::Scheduler &scheduler, ::Experiments const &experiments)
 
MCAPI void $dtor ()
 
MCAPI void $shutdown ()
 
MCAPI bool $isShutdownDone ()
 
MCAPI void $loadChunk (::LevelChunk &lc, bool forceImmediateReplacementDataLoad)
 
MCFOLD bool $isChunkKnown (::ChunkPos const &chunkPos)
 
MCFOLD bool $isChunkSaved (::ChunkPos const &chunkPos)
 
MCAPI bool $postProcess (::ChunkViewSource &neighborhood)
 
MCAPI void $checkAndReplaceChunk (::ChunkViewSource &neighborhood, ::LevelChunk &lc)
 
MCAPI bool $saveLiveChunk (::LevelChunk &lc)
 
MCAPI void $writeEntityChunkTransfer (::LevelChunk &lc)
 
MCAPI void $writeEntityChunkTransfersToUnloadedChunk (::ChunkKey const &chunkKey, ::std::vector<::ActorUnloadedChunkTransferEntry > const &transfers)
 
MCAPI void $acquireDiscarded (::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter > ptr)
 
MCAPI void $hintDiscardBatchBegin ()
 
MCAPI void $hintDiscardBatchEnd ()
 
MCAPI void $flushPendingDiscardedChunkWrites ()
 
MCAPI void $flushThreadBatch ()
 
MCAPI ::std::unique_ptr<::BlendingDataProvider$tryGetBlendingDataProvider ()
 
MCAPI ::std::shared_ptr<::LevelChunkMetaDataDictionary$loadLevelChunkMetaDataDictionary ()
 
MCAPI void $deserializeActorStorageToLevelChunk (::LevelChunk &levelChunk)
 
MCAPI bool $chunkPosNeedsBlending (::ChunkPos const &cp)
 
virtual ::std::shared_ptr<::LevelChunkgetExistingChunk (::ChunkPos const &)
 
virtual ::std::shared_ptr<::LevelChunkgetRandomChunk (::Random &random)
 
virtual ::std::shared_ptr<::LevelChunkcreateNewChunk (::ChunkPos const &cp, ::ChunkSource::LoadMode lm, bool readOnly)
 
virtual ::std::shared_ptr<::LevelChunkgetOrLoadChunk (::ChunkPos const &cp, ::ChunkSource::LoadMode lm, bool readOnly)
 
virtual void postProcessMobsAt (::BlockSource &region, int chunkWestBlock, int chunkNorthBlock, ::Random &random)
 
virtual void postProcessMobsAt (::BlockSource &region, ::BoundingBox const &chunkBB) const
 
virtual void compact ()
 
virtual bool isWithinWorldLimit (::ChunkPos const &cp) const
 
virtual ::std::unordered_map<::ChunkPos, ::std::weak_ptr<::LevelChunk > > const * getChunkMap ()
 
virtual ::std::unordered_map<::ChunkPos, ::std::weak_ptr<::LevelChunk > > const & getStorage () const
 
virtual void clearDeletedEntities ()
 
virtual bool canCreateViews () const
 
virtual void setLevelChunk (::std::shared_ptr<::LevelChunk >)
 
virtual bool canLaunchTasks () const
 
MCAPI bool _checkAndDispatchTaskForLevelChunk (::std::pair<::ChunkPos, ::ChunkState > const &chunkPosAndExpectedState, bool areInTask)
 
MCAPI void _checkForReplacementDataTask (::LevelChunk &lc, ::ChunkViewSource &chunks)
 
MCAPI void _checkForUnblockingChunks (::LevelChunk const &lc)
 
MCAPI void _checkLevelChunkForNextStage (::LevelChunk const &lc, ::LevelChunkGridAreaElement<::std::weak_ptr<::LevelChunk > > &grid, ::ChunkState stateToCheck)
 
MCAPI void _checkLevelChunkForPostProcessing (::LevelChunk const &lc, ::LevelChunkGridAreaElement<::std::weak_ptr<::LevelChunk > > &grid)
 
MCAPI bool _chunkAtStage (::std::weak_ptr<::LevelChunk > lcwp, ::ChunkState stateToCheck)
 
MCAPI void _createOrReplaceGridAreaMap (::std::shared_ptr<::LevelChunk > lc, bool createNeighbourGridsIfMissing)
 
MCAPI void _freeChunkGenerationGridMap (::ChunkPos const &cp, bool isLevelChunkDeletion)
 
MCAPI void _launchGenerationTask (::std::shared_ptr<::LevelChunk > const &lc, bool areInTask)
 
MCAPI void _launchLightingTask (::std::shared_ptr<::LevelChunk > const &lc, ::std::shared_ptr<::ChunkViewSource > const &chunks, bool areInTask)
 
MCAPI void _launchPostProcessingTask (::std::shared_ptr<::LevelChunk > const &lc, ::std::shared_ptr<::ChunkViewSource > const &chunks, bool areInTask)
 
MCAPI void _launchReplacementDataTask (::std::shared_ptr<::LevelChunk > const &lc, ::std::shared_ptr<::ChunkViewSource > const &chunks, bool areInTask)
 
MCAPI void _lightingTask (::std::shared_ptr<::LevelChunk > const &lc, ::ChunkViewSource &chunks)
 
MCAPI void _loadChunkTask (::LevelChunk &lc)
 
MCAPI void _postProcessingTask (::LevelChunk &lc, ::ChunkViewSource &chunks)
 
MCAPI void _saveDirtyChunks (::LevelStorage &)
 
MCAPI void _spawnChunkGenerationTasks (int numTasks, bool calledFromTask)
 
MCAPI void checkAndLaunchChunkGenerationTasks (bool calledFromTask)
 
MCAPI ::GridArea<::std::shared_ptr<::LevelChunk > > createEmptyView (::ChunkSource::LoadMode lm, bool circle, ::std::function< void(::buffer_span_mut<::std::shared_ptr<::LevelChunk > >, ::buffer_span< uint >)> add, ::ChunkSourceViewGenerateMode chunkViewGenerateMode, float const *serverBuildRatio)
 
MCAPI ::std::shared_ptr<::LevelChunkgetAvailableChunk (::ChunkPos const &cp)
 
MCAPI void initializeWithLevelStorageManagerConnector (::ILevelStorageManagerConnector &levelStorageManagerConnector)
 
MCAPI bool shouldServerGeneratePos (::ChunkPos const &chunkPos, float serverBuildRatio, int viewRadius)
 
MCAPI void * $ctor (::std::unique_ptr<::ChunkSource > parent)
 
MCFOLD void * $ctor ()
 
MCFOLD void * $ctor (::Bedrock::EnableNonOwnerReferences const &)
 
MCFOLD ::std::shared_ptr<::LevelChunk$getExistingChunk (::ChunkPos const &)
 
MCFOLD ::std::shared_ptr<::LevelChunk$getRandomChunk (::Random &random)
 
MCAPI ::std::shared_ptr<::LevelChunk$createNewChunk (::ChunkPos const &cp, ::ChunkSource::LoadMode lm, bool readOnly)
 
MCAPI ::std::shared_ptr<::LevelChunk$getOrLoadChunk (::ChunkPos const &cp, ::ChunkSource::LoadMode lm, bool readOnly)
 
MCAPI void $postProcessMobsAt (::BlockSource &region, int chunkWestBlock, int chunkNorthBlock, ::Random &random)
 
MCAPI void $postProcessMobsAt (::BlockSource &region, ::BoundingBox const &chunkBB) const
 
MCAPI void $compact ()
 
MCFOLD bool $isWithinWorldLimit (::ChunkPos const &cp) const
 
MCFOLD ::std::unordered_map<::ChunkPos, ::std::weak_ptr<::LevelChunk > > const * $getChunkMap ()
 
MCAPI ::std::unordered_map<::ChunkPos, ::std::weak_ptr<::LevelChunk > > const & $getStorage () const
 
MCFOLD void $clearDeletedEntities ()
 
MCFOLD bool $canCreateViews () const
 
MCFOLD void $setLevelChunk (::std::shared_ptr<::LevelChunk >)
 
MCAPI bool $canLaunchTasks () const
 

Static Public Member Functions

static MCAPI ::std::vector<::std::string > _deserializeChunkActorStorageKeys (::IDataInput &digestStream)
 
static MCAPI ::ConsoleChunkBlender::BlenderMode _getBlenderMode (::LevelChunk const &lc, ::Experiments const &experiments)
 
static MCAPI ::std::string deserializeActorStorageToString (bool hasActorDigestVersionTag, ::std::string const &storageKeyDigestBuffer, ::std::function< bool(::std::string_view, ::std::string &)> loadDataCallback)
 
static MCAPI ::Bedrock::Threading::ThreadLocalObject<::LevelStorageWriteBatch > & threadBatch ()
 
static MCAPI ::Bedrock::Threading::ThreadLocalObject<::std::string > & threadBuffer ()
 
static MCAPI void ** $vftable ()
 
static MCAPI bool & gPerfIsClientSide ()
 

Public Attributes

::ll::TypedStorage< 8, 64, ::std::unordered_map<::DBChunkStorageKey, ::DBChunkStorage::ChunkCacheStatus > > mHasChunkCache
 
::ll::TypedStorage< 8, 8, ::std::shared_mutex > mHasChunkCacheSharedMutex
 
::ll::TypedStorage< 8, 64, ::std::unordered_map<::ChunkPos, ::std::pair< bool, ::std::shared_ptr<::BlendingData > > > > mChunkBlendingDataCache
 
::ll::TypedStorage< 8, 8, ::std::shared_mutex > mChunkBlendingDataSharedMutex
 
::ll::TypedStorage< 8, 8, ::std::shared_mutex > mAttenuatorSharedMutex
 
::ll::TypedStorage< 8, 8, ::DBStorage & > mStorage
 
::ll::TypedStorage< 8, 24, ::std::vector<::std::shared_ptr<::LevelStorageWriteBatch > > > mBufferPool
 
::ll::TypedStorage< 8, 24, ::std::vector<::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter > > > mDiscardBatch
 
::ll::TypedStorage< 8, 64, ::std::unordered_set<::ChunkPos > > mLiveChunksBeingSaved
 
::ll::TypedStorage< 8, 64, ::std::unordered_map<::ChunkPos, ::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter > > > mDiscardedWhileLiveSaved
 
::ll::TypedStorage< 1, 1, bool > mBatch
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::TaskGroup > > mIOTaskGroup
 
::ll::TypedStorage< 8, 32, ::BaseGameVersionmCurrentLevelVersion
 
::ll::TypedStorage< 4, 4, int > mChunkSide
 
::ll::TypedStorage< 8, 8, ::Level * > mLevel
 
::ll::TypedStorage< 8, 8, ::Dimension * > mDimension
 
::ll::TypedStorage< 8, 8, ::ChunkSource * > mParent
 
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::ChunkSource > > mOwnedParent
 
::ll::TypedStorage< 8, 8, ::LevelChunkBuilderData * > mLevelChunkBuilderData
 
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mShuttingDown
 
::ll::TypedStorage< 8, 16, ::Bedrock::PubSub::SubscriptionmOnSaveSubscription
 
::ll::TypedStorage< 8, 16, ::Bedrock::PubSub::SubscriptionmOnLevelStorageAppSuspendSubscription
 
::std::shared_ptr<::Bedrock::EnableNonOwnerReferences::ControlBlockmControlBlock
 

Member Function Documentation

◆ shutdown()

virtual void DBChunkStorage::shutdown ( )
virtual

Reimplemented from ChunkSource.

◆ isShutdownDone()

virtual bool DBChunkStorage::isShutdownDone ( )
virtual

Reimplemented from ChunkSource.

◆ loadChunk()

virtual void DBChunkStorage::loadChunk ( ::LevelChunk & lc,
bool forceImmediateReplacementDataLoad )
virtual

Reimplemented from ChunkSource.

◆ isChunkKnown()

virtual bool DBChunkStorage::isChunkKnown ( ::ChunkPos const & chunkPos)
virtual

Reimplemented from ChunkSource.

◆ isChunkSaved()

virtual bool DBChunkStorage::isChunkSaved ( ::ChunkPos const & chunkPos)
virtual

Reimplemented from ChunkSource.

◆ postProcess()

virtual bool DBChunkStorage::postProcess ( ::ChunkViewSource & neighborhood)
virtual

Reimplemented from ChunkSource.

◆ checkAndReplaceChunk()

virtual void DBChunkStorage::checkAndReplaceChunk ( ::ChunkViewSource & neighborhood,
::LevelChunk & lc )
virtual

Reimplemented from ChunkSource.

◆ saveLiveChunk()

virtual bool DBChunkStorage::saveLiveChunk ( ::LevelChunk & lc)
virtual

Reimplemented from ChunkSource.

◆ writeEntityChunkTransfer()

virtual void DBChunkStorage::writeEntityChunkTransfer ( ::LevelChunk & lc)
virtual

Reimplemented from ChunkSource.

◆ writeEntityChunkTransfersToUnloadedChunk()

virtual void DBChunkStorage::writeEntityChunkTransfersToUnloadedChunk ( ::ChunkKey const & chunkKey,
::std::vector<::ActorUnloadedChunkTransferEntry > const & transfers )
virtual

Reimplemented from ChunkSource.

◆ acquireDiscarded()

virtual void DBChunkStorage::acquireDiscarded ( ::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter > ptr)
virtual

Reimplemented from ChunkSource.

◆ hintDiscardBatchBegin()

virtual void DBChunkStorage::hintDiscardBatchBegin ( )
virtual

Reimplemented from ChunkSource.

◆ hintDiscardBatchEnd()

virtual void DBChunkStorage::hintDiscardBatchEnd ( )
virtual

Reimplemented from ChunkSource.

◆ flushPendingDiscardedChunkWrites()

virtual void DBChunkStorage::flushPendingDiscardedChunkWrites ( )
virtual

Reimplemented from ChunkSource.

◆ flushThreadBatch()

virtual void DBChunkStorage::flushThreadBatch ( )
virtual

Reimplemented from ChunkSource.

◆ deserializeActorStorageToLevelChunk()

virtual void DBChunkStorage::deserializeActorStorageToLevelChunk ( ::LevelChunk & levelChunk)
virtual

Reimplemented from ChunkSource.

◆ chunkPosNeedsBlending()

virtual bool DBChunkStorage::chunkPosNeedsBlending ( ::ChunkPos const & cp)
virtual

Reimplemented from ChunkSource.


The documentation for this class was generated from the following file: