72 enum class InstanceState :
int {
80 struct CreateServerLevelOps {
83 using CreateDimensionFactoryCallback =
85 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
92 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
93 ::ll::TypedStorage<1, 1, bool> mServerAuthSound;
94 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
95 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mClientResourcePackManager;
100 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
103 mCreateDimensionFactoryAndManager;
108 CreateServerLevelOps& operator=(CreateServerLevelOps
const&);
109 CreateServerLevelOps(CreateServerLevelOps
const&);
110 CreateServerLevelOps();
115 MCAPI ~CreateServerLevelOps();
125 struct HostMultiplayerOps {
129 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
130 ::ll::TypedStorage<8, 8, ::NetworkServerConfig&&> mNetworkServerConfig;
131 ::ll::TypedStorage<8, 8, ::std::string const&> mHostPublicKey;
132 ::ll::TypedStorage<4, 4, int> mMaxChunkRadius;
133 ::ll::TypedStorage<1, 1, bool> mShouldAnnounce;
134 ::ll::TypedStorage<8, 8, ::ServerNetworkHandlerDependencies&&> mServerNetworkOptions;
139 HostMultiplayerOps& operator=(HostMultiplayerOps
const&);
140 HostMultiplayerOps(HostMultiplayerOps
const&);
141 HostMultiplayerOps();
144 struct NetworkToggleOptions {
148 ::ll::TypedStorage<8, 8, ::AppPlatform const&> mPlatform;
149 ::ll::TypedStorage<1, 1, bool> mDisableLanSignaling;
150 ::ll::TypedStorage<1, 1, bool> mIsServerVisibleToLanDiscovery;
151 ::ll::TypedStorage<1, 1, bool> mEnablePacketRateLimiting;
152 ::ll::TypedStorage<8, 8, ::ConnectionDefinition const&> mConnectionDefinition;
157 NetworkToggleOptions& operator=(NetworkToggleOptions
const&);
158 NetworkToggleOptions(NetworkToggleOptions
const&);
159 NetworkToggleOptions();
165 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
166 ::ll::TypedStorage<1, 1, bool const> mIsDedicatedServer;
167 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
168 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
169 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
170 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
171 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
172 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
173 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
174 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
175 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
176 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
177 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
178 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
179 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
180 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
181 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
182 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
183 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
184 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
185 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
186 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
187 ::ll::TypedStorage<8, 64, ::std::function<void(::Connection::DisconnectFailReason,
char const*)>>
188 mUnrecoverableErrorCallback;
189 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
190 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
191 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
192 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
193 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
194 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
195 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
196 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
197 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
198 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
199 ::ll::TypedStorage<1, 1, bool> mbInitialized;
200 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
201 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
202 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
203 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
204 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
205 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
206 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
207 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
208 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
209 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
210 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
221 virtual ~ServerInstance() ;
223 virtual
void onLowMemory(::LowMemorySeverity) ;
225 virtual
void onLevelCorrupt() ;
227 virtual
void onGameModeChanged() ;
229 virtual
void onTick(
int nTick,
int maxTick) ;
231 virtual
void onInternetUpdate() ;
233 virtual
void onGameSessionReset() ;
235 virtual
void onLevelExit() ;
237 virtual
void onRequestResourceReload() ;
239 virtual
void onLowDiskSpace(
bool const bSet) ;
241 virtual
void onOutOfDiskSpace(
bool const bSet) ;
243 virtual
void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode) ;
245 virtual
void onAppSuspended() ;
247 virtual
void onAppResumed() ;
249 virtual
void updateScreens() ;
257 MCAPI
void _resetServerScriptManager();
259 MCAPI
void _shutdownStorage(::Bedrock::UniqueOwnerPointer<::
LevelStorage>& storage);
261 MCAPI
void _update();
263 MCAPI
bool _useClientSideChunkGeneration(::
LevelData* levelData) const;
265 MCAPI
void disconnectAllClients(::Connection::DisconnectFailReason reason);
271 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
273 MCAPI ::ItemRegistryRef getServerItemRegistry()
const;
278 MCAPI
void leaveGameSync();
281 MCAPI
void onCriticalScriptError(::Connection::DisconnectFailReason clientReason,
char const* logMessage);
283 MCAPI
void queueForServerThread(::std::function<
void()> command);
286 MCAPI
void setScriptWatchdogCriticalErrorCallback(::std::function<
void(
char const*)> criticalErrorCallback);
288 MCAPI
void setUnrecoverableErrorCallback(
289 ::std::function<
void(::Connection::DisconnectFailReason,
char const*)> unrecoverableErrorCallback
294 MCAPI
void startLeaveGame();
298 MCAPI
void startServerThread();
305 MCAPI static ::brstd::move_only_function<
310 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
317 MCAPI static ::std::string
const& ASSET_EXTRACTION_ERROR();
319 MCAPI static ::std::string
const& ENTITY_REGISTRY_CREATION_ERROR();
321 MCAPI static ::std::string
const& FINAL_LEVEL_STORAGE_STATE_ERROR();
323 MCAPI static ::std::string
const& HOST_MULTIPLAYER_ERROR();
325 MCAPI static ::std::string
const& INITIAL_LEVEL_STORAGE_STATE_ERROR();
327 MCAPI static ::std::string
const& LEVEL_STORAGE_CREATION_ERROR();
329 MCAPI static ::std::string
const& PACK_SOURCE_LOADING_ERROR();
331 MCAPI static ::std::string
const& POST_INIT_ERROR();
349 MCAPI
void $onLowMemory(::LowMemorySeverity);
351 MCAPI
void $onLevelCorrupt();
353 MCFOLD
void $onGameModeChanged();
355 MCFOLD
void $onTick(
int nTick,
int maxTick);
357 MCFOLD
void $onInternetUpdate();
359 MCFOLD
void $onGameSessionReset();
361 MCFOLD
void $onLevelExit();
363 MCAPI
void $onRequestResourceReload();
365 MCAPI
void $onLowDiskSpace(
bool const bSet);
367 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
369 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
371 MCAPI
void $onAppSuspended();
373 MCAPI
void $onAppResumed();
375 MCFOLD
void $updateScreens();