LeviLamina
Loading...
Searching...
No Matches
LevelStorage.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/CompactionStatus.h"
7#include "mc/deps/core/file/PathBuffer.h"
8#include "mc/deps/core/threading/IAsyncResult.h"
9#include "mc/world/level/storage/StorageVersion.h"
10#include "mc/world/level/storage/db_helpers/Category.h"
11
12// auto generated forward declare list
13// clang-format off
14class ChunkSource;
15class CompoundTag;
16class ContentIdentity;
17class LevelData;
20class Player;
22namespace Core { struct LevelStorageResult; }
23// clang-format on
24
26public:
27 // LevelStorage inner types define
28 enum class StatsType : uint {
29 Level0 = 0,
30 Level1 = 1,
31 Level2 = 2,
32 Memory = 3,
33 Default = 0,
34 };
35
36public:
37 // virtual functions
38 // NOLINTBEGIN
39 // vIndex: 0
40 virtual ~LevelStorage();
41
42 // vIndex: 1
43 virtual void addStorageObserver(::std::unique_ptr<::LevelStorageObserver>) = 0;
44
45 // vIndex: 2
46 virtual bool loadedSuccessfully() const;
47
48 // vIndex: 3
49 virtual ::std::unique_ptr<::CompoundTag> getCompoundTag(::std::string const&, ::DBHelpers::Category) = 0;
50
51 // vIndex: 4
52 virtual bool hasKey(::std::string_view, ::DBHelpers::Category) const = 0;
53
54 // vIndex: 5
55 virtual void forEachKeyWithPrefix(
56 ::std::string_view,
57 ::DBHelpers::Category,
58 ::std::function<void(::std::string_view, ::std::string_view)> const&
59 ) const = 0;
60
61 // vIndex: 6
62 virtual bool loadLevelData(::LevelData&) = 0;
63
64 // vIndex: 7
65 virtual ::std::unique_ptr<::ChunkSource> createChunkStorage(::std::unique_ptr<::ChunkSource>, ::StorageVersion) = 0;
66
67 // vIndex: 8
68 virtual void saveLevelData(::LevelData const&) = 0;
69
70 // vIndex: 9
71 virtual ::Core::PathBuffer<::std::string> const& getFullPath() const = 0;
72
73 // vIndex: 11
74 virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>
75 saveData(::std::string const&, ::std::string&&, ::DBHelpers::Category) = 0;
76
77 // vIndex: 10
78 virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> saveData(::LevelStorageWriteBatch const&) = 0;
79
80 // vIndex: 12
81 virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>
82 deleteData(::std::string const&, ::DBHelpers::Category) = 0;
83
84 // vIndex: 13
85 virtual void getStatistics(::std::string&, ::LevelStorage::StatsType) const = 0;
86
87 // vIndex: 14
88 virtual bool clonePlayerData(::std::string_view fromKey, ::std::string_view toKey);
89
90 // vIndex: 15
91 virtual ::Core::LevelStorageResult getLevelStorageState() const = 0;
92
93 // vIndex: 16
94 virtual ::ContentIdentity const* getContentIdentity() const = 0;
95
96 // vIndex: 17
97 virtual void startShutdown() = 0;
98
99 // vIndex: 18
100 virtual bool isShuttingDown() const = 0;
101
102 // vIndex: 19
103 virtual bool checkShutdownDone() = 0;
104
105 // vIndex: 20
106 virtual bool loadData(::std::string_view key, ::std::string& buffer, ::DBHelpers::Category category) const;
107
108 // vIndex: 21
109 virtual ::Core::LevelStorageResult getState() const = 0;
110
111 // vIndex: 22
112 virtual ::std::vector<::SnapshotFilenameAndLength> createSnapshot(::std::string const&, bool) = 0;
113
114 // vIndex: 23
115 virtual void releaseSnapshot() = 0;
116
117 // vIndex: 24
118 virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> compactStorage() = 0;
119
120 // vIndex: 25
121 virtual void syncAndSuspendStorage() = 0;
122
123 // vIndex: 26
124 virtual void resumeStorage() = 0;
125
126 // vIndex: 27
127 virtual void setFlushAllowed(bool) = 0;
128
129 // vIndex: 28
130 virtual void flushToPermanentStorage() = 0;
131
132 // vIndex: 29
133 virtual void freeCaches();
134
135 // vIndex: 30
136 virtual void setCompactionCallback(::std::function<void(::CompactionStatus)>) = 0;
137
138 // vIndex: 31
139 virtual void setCriticalSyncSaveCallback(::std::function<void()>) = 0;
140
141 // vIndex: 32
142 virtual void corruptLevel();
143 // NOLINTEND
144
145public:
146 // member functions
147 // NOLINTBEGIN
148 MCAPI ::std::string getServerId(::Player const& client, bool isXboxLive);
149
150 MCAPI ::std::vector<::std::string> loadAllPlayerIDs(bool includeLocalPlayer) const;
151
152 MCAPI ::std::unique_ptr<::CompoundTag> loadServerPlayerData(::Player const& client, bool isXboxLive);
153
154 MCAPI void save(::Player& player);
155
156 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>
157 saveData(::std::string const& key, ::CompoundTag const& tag, ::DBHelpers::Category category);
158 // NOLINTEND
159
160public:
161 // static variables
162 // NOLINTBEGIN
163 MCAPI static ::std::string const& LEGACY_CONSOLE_PLAYER_PREFIX();
164
165 MCAPI static ::std::string const& LOCAL_PLAYER_TAG();
166 // NOLINTEND
167
168public:
169 // destructor thunk
170 // NOLINTBEGIN
171 MCAPI void $dtor();
172 // NOLINTEND
173
174public:
175 // virtual function thunks
176 // NOLINTBEGIN
177 MCFOLD bool $loadedSuccessfully() const;
178
179 MCAPI bool $clonePlayerData(::std::string_view fromKey, ::std::string_view toKey);
180
181 MCFOLD bool $loadData(::std::string_view key, ::std::string& buffer, ::DBHelpers::Category category) const;
182
183 MCFOLD void $freeCaches();
184
185 MCFOLD void $corruptLevel();
186 // NOLINTEND
187
188public:
189 // vftables
190 // NOLINTBEGIN
191 MCNAPI static void** $vftable();
192 // NOLINTEND
193};
Definition ChunkSource.h:34
Definition CompoundTag.h:13
Definition ContentIdentity.h:8
Definition LevelData.h:49
Definition LevelStorageObserver.h:5
Definition LevelStorageWriteBatch.h:14
Definition LevelStorage.h:25
static MCAPI void ** $vftable()
Definition Player.h:119
Definition SnapshotFilenameAndLength.h:5
Definition buffer.h:5