67 enum class InstanceState :
int {
75 struct CreateServerLevelOps {
88 CreateServerLevelOps& operator=(CreateServerLevelOps
const&);
89 CreateServerLevelOps(CreateServerLevelOps
const&);
90 CreateServerLevelOps();
105 struct HostMultiplayerOps {
119 HostMultiplayerOps& operator=(HostMultiplayerOps
const&);
120 HostMultiplayerOps(HostMultiplayerOps
const&);
121 HostMultiplayerOps();
124 struct NetworkToggleOptions {
137 NetworkToggleOptions& operator=(NetworkToggleOptions
const&);
138 NetworkToggleOptions(NetworkToggleOptions
const&);
139 NetworkToggleOptions();
145 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
146 ::ll::TypedStorage<1, 1, bool const> mIsDedicatedServer;
147 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
148 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
149 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
150 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
151 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
152 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
153 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
154 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
155 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
156 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
157 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
158 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
159 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
160 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
161 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
162 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
163 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
164 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
165 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
166 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
167 ::ll::TypedStorage<8, 64, ::std::function<void(::Connection::DisconnectFailReason,
char const*)>>
168 mUnrecoverableErrorCallback;
169 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
170 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
171 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
172 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
173 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
174 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
175 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
176 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
177 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
178 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
179 ::ll::TypedStorage<1, 1, bool> mbInitialized;
180 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
181 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
182 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
183 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
184 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
185 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
186 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
187 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
188 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
189 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
190 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
201 virtual ~ServerInstance() ;
203 virtual
void onLowMemory(::LowMemorySeverity) ;
205 virtual
void onLevelCorrupt() ;
207 virtual
void onGameModeChanged() ;
209 virtual
void onTick(
int nTick,
int maxTick) ;
211 virtual
void onInternetUpdate() ;
213 virtual
void onGameSessionReset() ;
215 virtual
void onLevelExit() ;
217 virtual
void onRequestResourceReload() ;
219 virtual
void onLowDiskSpace(
bool const bSet) ;
221 virtual
void onOutOfDiskSpace(
bool const bSet) ;
223 virtual
void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode) ;
225 virtual
void onAppSuspended() ;
227 virtual
void onAppResumed() ;
229 virtual
void updateScreens() ;
237 MCAPI
void _resetServerScriptManager();
239 MCAPI
void _shutdownStorage(::Bedrock::UniqueOwnerPointer<::
LevelStorage>& storage);
241 MCAPI
void _update();
243 MCAPI
bool _useClientSideChunkGeneration(::
LevelData* levelData) const;
245 MCAPI
void disconnectAllClients(::Connection::DisconnectFailReason reason);
251 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
253 MCAPI ::ItemRegistryRef getServerItemRegistry()
const;
258 MCAPI
void leaveGameSync();
261 MCAPI
void onCriticalScriptError(::Connection::DisconnectFailReason clientReason,
char const* logMessage);
263 MCAPI
void queueForServerThread(::std::function<
void()> command);
266 MCAPI
void setScriptWatchdogCriticalErrorCallback(::std::function<
void(
char const*)> criticalErrorCallback);
268 MCAPI
void setUnrecoverableErrorCallback(
269 ::std::function<
void(::Connection::DisconnectFailReason,
char const*)> unrecoverableErrorCallback
274 MCAPI
void startLeaveGame();
278 MCAPI
void startServerThread();
285 MCAPI static ::brstd::move_only_function<
290 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
297 MCAPI static ::std::string
const& ASSET_EXTRACTION_ERROR();
299 MCAPI static ::std::string
const& ENTITY_REGISTRY_CREATION_ERROR();
301 MCAPI static ::std::string
const& FINAL_LEVEL_STORAGE_STATE_ERROR();
303 MCAPI static ::std::string
const& HOST_MULTIPLAYER_ERROR();
305 MCAPI static ::std::string
const& INITIAL_LEVEL_STORAGE_STATE_ERROR();
307 MCAPI static ::std::string
const& LEVEL_STORAGE_CREATION_ERROR();
309 MCAPI static ::std::string
const& PACK_SOURCE_LOADING_ERROR();
311 MCAPI static ::std::string
const& POST_INIT_ERROR();
329 MCAPI
void $onLowMemory(::LowMemorySeverity);
331 MCAPI
void $onLevelCorrupt();
333 MCFOLD
void $onGameModeChanged();
335 MCFOLD
void $onTick(
int nTick,
int maxTick);
337 MCFOLD
void $onInternetUpdate();
339 MCFOLD
void $onGameSessionReset();
341 MCFOLD
void $onLevelExit();
343 MCAPI
void $onRequestResourceReload();
345 MCAPI
void $onLowDiskSpace(
bool const bSet);
347 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
349 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
351 MCAPI
void $onAppSuspended();
353 MCAPI
void $onAppResumed();
355 MCFOLD
void $updateScreens();