78 enum class InstanceState :
int {
86 struct CreateServerLevelOps {
89 using CreateDimensionFactoryCallback =
91 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
98 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
99 ::ll::TypedStorage<1, 1, bool> mServerAuthSound;
100 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
101 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mClientResourcePackManager;
106 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
109 mCreateDimensionFactoryAndManager;
114 CreateServerLevelOps& operator=(CreateServerLevelOps
const&);
115 CreateServerLevelOps(CreateServerLevelOps
const&);
116 CreateServerLevelOps();
119 struct HostMultiplayerOps {
123 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
124 ::ll::TypedStorage<8, 8, ::NetworkServerConfig&&> mNetworkServerConfig;
125 ::ll::TypedStorage<8, 48, ::KeyManager> mHostPublicKey;
126 ::ll::TypedStorage<4, 4, int> mMaxChunkRadius;
127 ::ll::TypedStorage<1, 1, bool> mShouldAnnounce;
128 ::ll::TypedStorage<8, 8, ::ServerNetworkHandlerDependencies&&> mServerNetworkOptions;
133 HostMultiplayerOps& operator=(HostMultiplayerOps
const&);
134 HostMultiplayerOps(HostMultiplayerOps
const&);
135 HostMultiplayerOps();
138 struct NetworkToggleOptions {
142 ::ll::TypedStorage<8, 8, ::AppPlatform const&> mPlatform;
143 ::ll::TypedStorage<1, 1, bool> mDisableLanSignaling;
144 ::ll::TypedStorage<1, 1, bool> mIsServerVisibleToLanDiscovery;
145 ::ll::TypedStorage<1, 1, bool> mEnablePacketRateLimiting;
146 ::ll::TypedStorage<8, 8, ::ConnectionDefinition const&> mConnectionDefinition;
151 NetworkToggleOptions& operator=(NetworkToggleOptions
const&);
152 NetworkToggleOptions(NetworkToggleOptions
const&);
153 NetworkToggleOptions();
159 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
160 ::ll::TypedStorage<1, 1, bool const> mIsDedicatedServer;
161 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
162 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ServerNetworkSystem>> mNetwork;
163 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
164 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
165 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
166 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
167 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
168 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
169 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
170 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
171 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
172 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
173 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
174 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
175 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
176 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
177 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
178 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
179 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
180 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
181 ::ll::TypedStorage<8, 64, ::std::function<void(::Connection::DisconnectFailReason,
char const*)>>
182 mUnrecoverableErrorCallback;
183 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
184 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
185 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
186 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
187 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
188 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
189 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
190 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
191 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
192 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
193 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
194 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
195 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
196 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
197 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
198 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
199 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
200 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
201 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
202 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
203 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
207 ::ll::TypedStorage<8, 8, ::
std::unique_ptr<::ServerInitialization::IServerInitializer>> mInitializer;
212 mServerPerformanceDataRegistrationToken;
222 virtual ~ServerInstance() = default;
224 virtual
void onLowMemory(::LowMemorySeverity) ;
226 virtual
void onLevelCorrupt() ;
228 virtual
void onGameModeChanged() ;
230 virtual
void onTick(
int nTick,
int maxTick) ;
232 virtual
void onInternetUpdate() ;
234 virtual
void onGameSessionReset() ;
236 virtual
void onLevelExit() ;
238 virtual
void onRequestResourceReload() ;
240 virtual
void onLowDiskSpace(
bool const bSet, uint64) ;
242 virtual
void onOutOfDiskSpace(
bool const bSet, uint64) ;
244 virtual
void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode) ;
246 virtual
void onAppSuspended() ;
248 virtual
void onAppResumed() ;
250 virtual
void updateScreens() ;
258 MCAPI
void _resetServerScriptManager();
264 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
267 MCAPI ::std::string getLevelId()
const;
272 MCAPI
void leaveGameSync();
274 MCAPI
void onCriticalScriptError(::Connection::DisconnectFailReason clientReason,
char const* logMessage);
276 MCAPI
void queueForServerThread(::std::function<
void()> command);
279 MCAPI
bool requestInGamePause(
bool status);
282 MCAPI
void startLeaveGame();
284 MCAPI
void startServerThread();
290 MCAPI
static bool _useClientSideChunkGeneration(
::LevelData* levelData);
295 MCAPI static ::brstd::move_only_function<
300 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
307 MCAPI static ::std::string
const& ASSET_EXTRACTION_ERROR();
309 MCAPI static ::std::string
const& ENTITY_REGISTRY_CREATION_ERROR();
311 MCAPI static ::std::string
const& FINAL_LEVEL_STORAGE_STATE_ERROR();
313 MCAPI static ::std::string
const& HOST_MULTIPLAYER_ERROR();
315 MCAPI static ::std::string
const& INITIAL_LEVEL_STORAGE_STATE_ERROR();
317 MCAPI static ::std::string
const& LEVEL_STORAGE_CREATION_ERROR();
319 MCAPI static ::std::string
const& PACK_SOURCE_LOADING_ERROR();
322 MCAPI static ::std::string
const& POST_INIT_ERROR();
335 MCAPI
void $onLowMemory(::LowMemorySeverity);
337 MCAPI
void $onLevelCorrupt();
339 MCFOLD
void $onGameModeChanged();
341 MCFOLD
void $onTick(
int nTick,
int maxTick);
343 MCFOLD
void $onInternetUpdate();
345 MCFOLD
void $onGameSessionReset();
347 MCFOLD
void $onLevelExit();
349 MCAPI
void $onRequestResourceReload();
351 MCAPI
void $onLowDiskSpace(
bool const bSet, uint64);
353 MCAPI
void $onOutOfDiskSpace(
bool const bSet, uint64);
355 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
357 MCAPI
void $onAppSuspended();
359 MCAPI
void $onAppResumed();
361 MCFOLD
void $updateScreens();