67 enum class InstanceState :
int {
75 struct CreateServerLevelOps {
88 CreateServerLevelOps& operator=(CreateServerLevelOps
const&);
89 CreateServerLevelOps(CreateServerLevelOps
const&);
90 CreateServerLevelOps();
111 struct HostMultiplayerOps {
125 HostMultiplayerOps& operator=(HostMultiplayerOps
const&);
126 HostMultiplayerOps(HostMultiplayerOps
const&);
127 HostMultiplayerOps();
130 struct NetworkToggleOptions {
144 NetworkToggleOptions& operator=(NetworkToggleOptions
const&);
145 NetworkToggleOptions(NetworkToggleOptions
const&);
146 NetworkToggleOptions();
152 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
153 ::ll::TypedStorage<1, 1, bool const> mIsDedicatedServer;
154 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
155 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
156 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
157 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
158 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
159 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
160 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
161 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
162 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
163 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
164 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
165 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
166 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
167 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
168 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
169 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
170 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
171 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
172 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
173 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
174 ::ll::TypedStorage<8, 64, ::std::function<void(::Connection::DisconnectFailReason,
char const*)>>
175 mUnrecoverableErrorCallback;
176 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
177 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
178 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
179 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
180 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
181 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
182 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
183 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
184 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
185 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
186 ::ll::TypedStorage<1, 1, bool> mbInitialized;
187 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
188 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
189 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
190 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
191 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
192 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
193 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
194 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
195 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
196 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
197 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
208 virtual ~ServerInstance() ;
210 virtual
void onLowMemory(::LowMemorySeverity) ;
212 virtual
void onLevelCorrupt() ;
214 virtual
void onGameModeChanged() ;
216 virtual
void onTick(
int nTick,
int maxTick) ;
218 virtual
void onInternetUpdate() ;
220 virtual
void onGameSessionReset() ;
222 virtual
void onLevelExit() ;
224 virtual
void onRequestResourceReload() ;
226 virtual
void onLowDiskSpace(
bool const bSet) ;
228 virtual
void onOutOfDiskSpace(
bool const bSet) ;
230 virtual
void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode) ;
232 virtual
void onAppSuspended() ;
234 virtual
void onAppResumed() ;
236 virtual
void updateScreens() ;
246 MCAPI
void _resetServerScriptManager();
248 MCAPI
void _shutdownStorage(::Bedrock::UniqueOwnerPointer<::
LevelStorage>& storage);
250 MCAPI
void _update();
252 MCAPI
bool _useClientSideChunkGeneration(::
LevelData* levelData) const;
254 MCAPI
void disconnectAllClients(::Connection::DisconnectFailReason reason);
256 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager() const;
262 MCAPI_S
void leaveGameSync();
264 MCAPI
void onCriticalScriptError(::Connection::DisconnectFailReason clientReason,
char const* logMessage);
266 MCAPI
void queueForServerThread(::
std::function<
void()> command);
268 MCAPI_S
void setScriptWatchdogCriticalErrorCallback(::
std::function<
void(
char const*)> criticalErrorCallback);
270 MCAPI_S
void setUnrecoverableErrorCallback(
271 ::
std::function<
void(::Connection::DisconnectFailReason,
char const*)> unrecoverableErrorCallback
274 MCAPI_C
void startLeaveGame();
276 MCAPI_S
void startServerThread();
282 MCAPI_C static ::brstd::move_only_function<
290 MCAPI static ::
std::
string const& ASSET_EXTRACTION_ERROR();
292 MCAPI static ::
std::
string const& ENTITY_REGISTRY_CREATION_ERROR();
294 MCAPI static ::
std::
string const& FINAL_LEVEL_STORAGE_STATE_ERROR();
296 MCAPI static ::
std::
string const& HOST_MULTIPLAYER_ERROR();
298 MCAPI static ::
std::
string const& INITIAL_LEVEL_STORAGE_STATE_ERROR();
300 MCAPI static ::
std::
string const& LEVEL_STORAGE_CREATION_ERROR();
302 MCAPI static ::
std::
string const& PACK_SOURCE_LOADING_ERROR();
304 MCAPI static ::
std::
string const& POST_INIT_ERROR();
306 MCAPI static ::
std::chrono::nanoseconds const& SERVER_MAX_DELAY_BEFORE_SLOWDOWN();
324 MCAPI
void $onLevelCorrupt();
326 MCFOLD
void $onGameModeChanged();
328 MCFOLD
void $onTick(
int nTick,
int maxTick);
330 MCFOLD
void $onInternetUpdate();
332 MCFOLD
void $onGameSessionReset();
334 MCFOLD
void $onLevelExit();
336 MCAPI
void $onRequestResourceReload();
338 MCAPI
void $onLowDiskSpace(
bool const bSet);
340 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
342 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode);
344 MCAPI
void $onAppSuspended();
346 MCAPI
void $onAppResumed();
348 MCFOLD
void $updateScreens();
351 MCAPI
void $onLowMemory(::LowMemorySeverity);