28 enum class StatsType : uint {
41 virtual void addStorageObserver(::std::unique_ptr<::LevelStorageObserver> observer) = 0;
43 virtual bool loadedSuccessfully()
const;
45 virtual ::std::unique_ptr<::CompoundTag>
46 getCompoundTag(::std::string
const& key, ::DBHelpers::Category category) = 0;
48 virtual bool hasKey(::std::string_view key, ::DBHelpers::Category category)
const = 0;
50 virtual void forEachKeyWithPrefix(
51 ::std::string_view prefix,
52 ::DBHelpers::Category category,
53 ::std::function<
void(::std::string_view, ::std::string_view)>
const& callback
58 virtual ::std::unique_ptr<::ChunkSource> createChunkStorage(::std::unique_ptr<::ChunkSource>, ::StorageVersion) = 0;
60 virtual void saveLevelData(
::LevelData const& levelData) = 0;
62 virtual ::Core::PathBuffer<::std::string>
const& getFullPath()
const = 0;
64 virtual ::Bedrock::Threading::Async<void>
65 saveData(::std::string
const& key, ::std::string&& data, ::DBHelpers::Category category) = 0;
69 virtual ::Bedrock::Threading::Async<void> deleteData(::std::string
const& key, ::DBHelpers::Category category) = 0;
71 virtual void getStatistics(::std::string& outStats, ::LevelStorage::StatsType statsType)
const = 0;
73 virtual bool clonePlayerData(::std::string_view fromKey, ::std::string_view toKey);
75 virtual ::Core::LevelStorageResult getLevelStorageState()
const = 0;
77 virtual ::ContentIdentity
const* getContentIdentity()
const = 0;
79 virtual void startShutdown() = 0;
81 virtual bool isShuttingDown()
const = 0;
83 virtual bool checkShutdownDone() = 0;
85 virtual bool loadData(::std::string_view key, ::std::string&
buffer, ::DBHelpers::Category category)
const;
87 virtual ::Core::LevelStorageResult getState()
const = 0;
89 virtual ::std::vector<::SnapshotFilenameAndLength>
90 createSnapshot(::std::string
const& filePrefix,
bool flushWriteCache) = 0;
92 virtual void releaseSnapshot() = 0;
94 virtual ::Bedrock::Threading::Async<void> compactStorage() = 0;
96 virtual void syncAndSuspendStorage() = 0;
98 virtual void resumeStorage() = 0;
100 virtual void setFlushAllowed(
bool flushAllowed) = 0;
102 virtual void flushToPermanentStorage() = 0;
104 virtual void freeCaches();
106 virtual void setCompactionCallback(::std::function<
void(::CompactionStatus)> callback) = 0;
108 virtual void setCriticalSyncSaveCallback(::std::function<
void()> callback) = 0;
110 virtual void corruptLevel();
117 MCAPI ::std::unique_ptr<::LevelStorageWriteBatch> createWriteBatch();
120 MCAPI ::std::string getServerId(
::Player const& client,
bool isXboxLive);
122 MCAPI ::std::vector<::std::string> loadAllPlayerIDs(
bool includeLocalPlayer)
const;
124 MCAPI ::std::unique_ptr<::CompoundTag> loadServerPlayerData(
::Player const& client,
bool isXboxLive);
128 MCAPI ::Bedrock::Threading::Async<void>
129 saveData(::std::string
const& key,
::CompoundTag const& tag, ::DBHelpers::Category category);
135 MCAPI static ::std::string
const& LEGACY_CONSOLE_PLAYER_PREFIX();
137 MCAPI static ::std::string
const& LOCAL_PLAYER_TAG();
149 MCFOLD
bool $loadedSuccessfully()
const;
151 MCAPI
bool $clonePlayerData(::std::string_view fromKey, ::std::string_view toKey);
153 MCFOLD
bool $loadData(::std::string_view key, ::std::string&
buffer, ::DBHelpers::Category category)
const;
155 MCFOLD
void $freeCaches();
157 MCFOLD
void $corruptLevel();
Definition ContentIdentity.h:8