87 enum class InstanceState :
int {
95 struct CreateServerLevelOps {
98 using CreateDimensionFactoryCallback =
100 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
107 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
108 ::ll::TypedStorage<1, 1, bool> mServerAuthSound;
109 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
110 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mClientResourcePackManager;
115 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
118 mCreateDimensionFactoryAndManager;
123 CreateServerLevelOps& operator=(CreateServerLevelOps
const&);
124 CreateServerLevelOps(CreateServerLevelOps
const&);
125 CreateServerLevelOps();
128 struct NetworkToggleOptions {
132 ::ll::TypedStorage<8, 8, ::AppPlatform const&> mPlatform;
133 ::ll::TypedStorage<1, 1, bool> mDisableLanSignaling;
134 ::ll::TypedStorage<1, 1, bool> mIsServerVisibleToLanDiscovery;
135 ::ll::TypedStorage<1, 1, bool> mEnablePacketRateLimiting;
136 ::ll::TypedStorage<8, 8, ::ConnectionDefinition const&> mConnectionDefinition;
141 NetworkToggleOptions& operator=(NetworkToggleOptions
const&);
142 NetworkToggleOptions(NetworkToggleOptions
const&);
143 NetworkToggleOptions();
146 struct PostLevelArgs {
150 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerLevel>> mLevel;
151 ::ll::TypedStorage<8, 72, ::Experiments> mExperiments;
152 ::ll::TypedStorage<8, 1344, ::LevelSettings> mLevelSettings;
153 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mClientResourcePackManager;
154 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>> mResourcePackRepository;
155 ::ll::TypedStorage<8, 104, ::std::optional<::CommandsRegistryConfiguration const>>
156 mCommandsRegistryConfiguration;
157 ::ll::TypedStorage<4, 20, ::ConnectionDefinition> mConnectionDefinition;
158 ::ll::TypedStorage<8, 32, ::OwnerPtr<::EntityContext>> mLevelEntityContext;
159 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ScriptPackSettingsCache>> mPackSettingsCache;
160 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
170 PostLevelArgs& operator=(PostLevelArgs
const&);
171 PostLevelArgs(PostLevelArgs
const&);
179 ::ll::TypedStorage<8, 32, ::std::string> mLevelName;
183 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlueResolvedBiomeData>>>
184 mBiomeIdToResolvedData;
185 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ServerInstance::PostLevelArgs>> mPost;
192 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
193 ::ll::TypedStorage<1, 1, bool const> mIsDedicatedServer;
194 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
195 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ServerNetworkSystem>> mNetwork;
196 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
197 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
198 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
199 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
200 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
201 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
202 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
203 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
204 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
205 ::ll::TypedStorage<8, 80, ::std::mutex> mMutexDestruction;
206 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
207 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
208 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
209 ::ll::TypedStorage<8, 80, ::std::mutex> mResumeMutex;
210 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
211 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
212 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
213 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
214 ::ll::TypedStorage<8, 64, ::std::function<void(::Connection::DisconnectFailReason,
char const*)>>
215 mUnrecoverableErrorCallback;
216 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
217 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
218 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
219 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
220 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
221 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
222 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
223 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
224 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
225 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
226 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
227 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
228 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
229 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
230 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
231 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
232 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
233 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
234 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
235 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
236 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
240 ::ll::TypedStorage<8, 8, ::
std::unique_ptr<::ServerInitialization::IServerInitializer>> mInitializer;
245 mServerPerformanceDataRegistrationToken;
255 virtual ~ServerInstance() = default;
257 virtual
void onLowMemory(::LowMemorySeverity) ;
259 virtual
void onLevelCorrupt() ;
261 virtual
void onGameModeChanged() ;
263 virtual
void onTick(
int nTick,
int maxTick) ;
265 virtual
void onInternetUpdate() ;
267 virtual
void onGameSessionReset() ;
269 virtual
void onLevelExit() ;
271 virtual
void onRequestResourceReload() ;
273 virtual
void onLowDiskSpace(
bool const bSet, uint64) ;
275 virtual
void onOutOfDiskSpace(
bool const bSet, uint64) ;
277 virtual
void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode) ;
279 virtual
void onAppSuspended() ;
281 virtual
void onAppResumed() ;
283 virtual
void updateScreens() ;
291 MCAPI ::Bedrock::Threading::Async<
bool> _postLevelInitialization(::ServerInstance::
PostLevelArgs&& args);
293 MCAPI
void _resetServerScriptManager();
299 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
302 MCAPI ::std::string getLevelId()
const;
307 MCAPI
void leaveGameSync();
309 MCAPI
void onCriticalScriptError(::Connection::DisconnectFailReason clientReason,
char const* logMessage);
311 MCAPI
void queueForServerThread(::std::function<
void()> command);
314 MCAPI
bool requestInGamePause(
bool status);
317 MCAPI
void startLeaveGame();
319 MCAPI
void startServerThread();
325 MCAPI
static bool _useClientSideChunkGeneration(
::LevelData* levelData);
328 createHostMultiplayerCallback(
329 ::ServerInstance& instance,
337 MCAPI static ::brstd::move_only_function<
342 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
349 MCAPI static ::std::string
const& ASSET_EXTRACTION_ERROR();
351 MCAPI static ::std::string
const& ENTITY_REGISTRY_CREATION_ERROR();
353 MCAPI static ::std::string
const& FINAL_LEVEL_STORAGE_STATE_ERROR();
355 MCAPI static ::std::string
const& HOST_MULTIPLAYER_ERROR();
357 MCAPI static ::std::string
const& INITIAL_LEVEL_STORAGE_STATE_ERROR();
359 MCAPI static ::std::string
const& LEVEL_STORAGE_CREATION_ERROR();
361 MCAPI static ::std::string
const& PACK_SOURCE_LOADING_ERROR();
364 MCAPI static ::std::string
const& POST_INIT_ERROR();
377 MCAPI
void $onLowMemory(::LowMemorySeverity);
379 MCAPI
void $onLevelCorrupt();
381 MCFOLD
void $onGameModeChanged();
383 MCFOLD
void $onTick(
int nTick,
int maxTick);
385 MCFOLD
void $onInternetUpdate();
387 MCFOLD
void $onGameSessionReset();
389 MCFOLD
void $onLevelExit();
391 MCAPI
void $onRequestResourceReload();
393 MCAPI
void $onLowDiskSpace(
bool const bSet, uint64);
395 MCAPI
void $onOutOfDiskSpace(
bool const bSet, uint64);
397 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
399 MCAPI
void $onAppSuspended();
401 MCAPI
void $onAppResumed();
403 MCFOLD
void $updateScreens();