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