29 enum class StatsType : uint {
42 virtual void addStorageObserver(::std::unique_ptr<::LevelStorageObserver> observer) = 0;
44 virtual bool loadedSuccessfully()
const;
46 virtual ::std::unique_ptr<::CompoundTag>
47 getCompoundTag(::std::string
const& key, ::DBHelpers::Category category) = 0;
49 virtual bool hasKey(::std::string_view, ::DBHelpers::Category)
const = 0;
51 virtual void forEachKeyWithPrefix(
52 ::std::string_view prefix,
53 ::DBHelpers::Category category,
54 ::std::function<
void(::std::string_view, ::std::string_view)>
const& callback
59 virtual ::std::unique_ptr<::ChunkSource> createChunkStorage(::std::unique_ptr<::ChunkSource>, ::StorageVersion) = 0;
61 virtual void saveLevelData(
::LevelData const& levelData) = 0;
63 virtual ::Core::PathBuffer<::std::string>
const& getFullPath()
const = 0;
65 virtual ::Bedrock::Threading::Async<void>
66 saveData(::std::string
const& key, ::std::string&& data, ::DBHelpers::Category category) = 0;
70 virtual ::Bedrock::Threading::Async<void> deleteData(::std::string
const& key, ::DBHelpers::Category category) = 0;
72 virtual void getStatistics(::std::string& outStats, ::LevelStorage::StatsType statsType)
const = 0;
74 virtual bool clonePlayerData(::std::string_view fromKey, ::std::string_view toKey);
76 virtual ::Core::LevelStorageResult getLevelStorageState()
const = 0;
78 virtual ::ContentIdentity
const* getContentIdentity()
const = 0;
80 virtual void startShutdown() = 0;
82 virtual bool isShuttingDown()
const = 0;
84 virtual bool checkShutdownDone() = 0;
86 virtual bool loadData(::std::string_view key, ::std::string&
buffer, ::DBHelpers::Category category)
const;
88 virtual ::Core::LevelStorageResult getState()
const = 0;
90 virtual ::std::vector<::SnapshotFilenameAndLength>
91 createSnapshot(::std::string
const& filePrefix,
bool flushWriteCache) = 0;
93 virtual void releaseSnapshot() = 0;
95 virtual ::Bedrock::Threading::Async<void> compactStorage() = 0;
97 virtual void syncAndSuspendStorage() = 0;
99 virtual void resumeStorage() = 0;
101 virtual void setFlushAllowed(
bool flushAllowed) = 0;
103 virtual void flushToPermanentStorage() = 0;
105 virtual void freeCaches();
107 virtual void setCompactionCallback(::std::function<
void(::CompactionStatus)> callback) = 0;
109 virtual void setCriticalSyncSaveCallback(::std::function<
void()> callback) = 0;
111 virtual void corruptLevel();
118 MCAPI ::std::unique_ptr<::LevelStorageWriteBatch> createWriteBatch();
123 MCAPI ::std::string getServerId(
::Player const& client,
bool isXboxLive);
125 MCAPI ::std::vector<::std::string> loadAllPlayerIDs(
bool includeLocalPlayer)
const;
127 MCAPI ::std::unique_ptr<::CompoundTag> loadLocalPlayerData();
129 MCAPI ::std::unique_ptr<::CompoundTag> loadPlayerDataFromTag(::std::string_view saveTag);
131 MCAPI ::std::unique_ptr<::CompoundTag> loadServerPlayerData(
::Player const& client,
bool isXboxLive);
135 MCAPI ::Bedrock::Threading::Async<void>
136 saveData(::std::string
const& key,
::CompoundTag const& tag, ::DBHelpers::Category category);
142 MCAPI static ::std::string
const& LEGACY_CONSOLE_PLAYER_PREFIX();
144 MCAPI static ::std::string
const& LOCAL_PLAYER_TAG();
156 MCAPI
bool $clonePlayerData(::std::string_view fromKey, ::std::string_view toKey);
158 MCFOLD
void $corruptLevel();
Definition ContentIdentity.h:8