62 public ::AppPlatformListener,
74 enum class InstanceState :
int {
82 struct CreateServerLevelOps {
85 using CreateDimensionFactoryCallback =
87 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
94 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
95 ::ll::TypedStorage<1, 1, bool> mServerAuthSound;
96 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
97 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mClientResourcePackManager;
102 ::Bedrock::NotNullNonOwnerPtr<::ILevel>,
105 mCreateDimensionFactoryAndManager;
110 CreateServerLevelOps& operator=(CreateServerLevelOps
const&);
111 CreateServerLevelOps(CreateServerLevelOps
const&);
112 CreateServerLevelOps();
115 struct HostMultiplayerOps {
119 ::ll::TypedStorage<8, 8, ::ServerInstance&> mInstance;
120 ::ll::TypedStorage<8, 8, ::NetworkServerConfig&&> mNetworkServerConfig;
121 ::ll::TypedStorage<8, 8, ::std::string const&> mHostPublicKey;
122 ::ll::TypedStorage<4, 4, int> mMaxChunkRadius;
123 ::ll::TypedStorage<1, 1, bool> mShouldAnnounce;
124 ::ll::TypedStorage<8, 8, ::ServerNetworkHandlerDependencies&&> mServerNetworkOptions;
129 HostMultiplayerOps& operator=(HostMultiplayerOps
const&);
130 HostMultiplayerOps(HostMultiplayerOps
const&);
131 HostMultiplayerOps();
134 struct NetworkToggleOptions {
138 ::ll::TypedStorage<8, 8, ::AppPlatform const&> mPlatform;
139 ::ll::TypedStorage<1, 1, bool> mDisableLanSignaling;
140 ::ll::TypedStorage<1, 1, bool> mIsServerVisibleToLanDiscovery;
141 ::ll::TypedStorage<1, 1, bool> mEnablePacketRateLimiting;
142 ::ll::TypedStorage<8, 8, ::ConnectionDefinition const&> mConnectionDefinition;
147 NetworkToggleOptions& operator=(NetworkToggleOptions
const&);
148 NetworkToggleOptions(NetworkToggleOptions
const&);
149 NetworkToggleOptions();
155 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
156 ::ll::TypedStorage<1, 1, bool const> mIsDedicatedServer;
157 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
158 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
159 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
160 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
161 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
162 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
163 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
164 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
165 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
166 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
167 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
168 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
169 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
170 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
171 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
172 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
173 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
174 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
175 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
176 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
177 ::ll::TypedStorage<8, 64, ::std::function<void(::Connection::DisconnectFailReason,
char const*)>>
178 mUnrecoverableErrorCallback;
179 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
180 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
181 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
182 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
183 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
184 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
185 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
186 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
187 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
188 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
189 ::ll::TypedStorage<1, 1, bool> mbInitialized;
190 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
191 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
192 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
193 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
194 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
195 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
196 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
197 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
198 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
199 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
200 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
211 virtual ~ServerInstance() ;
213 virtual
void onLowMemory(::LowMemorySeverity) ;
215 virtual
void onLevelCorrupt() ;
217 virtual
void onGameModeChanged() ;
219 virtual
void onTick(
int nTick,
int maxTick) ;
221 virtual
void onInternetUpdate() ;
223 virtual
void onGameSessionReset() ;
225 virtual
void onLevelExit() ;
227 virtual
void onRequestResourceReload() ;
229 virtual
void onLowDiskSpace(
bool const bSet) ;
231 virtual
void onOutOfDiskSpace(
bool const bSet) ;
233 virtual
void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState const& errorCode) ;
235 virtual
void onAppSuspended() ;
237 virtual
void onAppResumed() ;
239 virtual
void updateScreens() ;
249 MCAPI
void _resetServerScriptManager();
251 MCAPI
void _update();
253 MCAPI
bool _useClientSideChunkGeneration(::
LevelData* levelData) const;
256 MCAPI
void disconnectAllClients(::Connection::DisconnectFailReason reason);
259 MCFOLD
bool enableItemStackNetManager()
const;
263 MCAPI ::Bedrock::NonOwnerPointer<::CDNConfig> getCDNConfig()
const;
265 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
267 MCAPI ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator> getEventCoordinator();
270 MCAPI ::std::string getLevelId()
const;
273 MCFOLD ::ServerScriptManager* getScriptManager();
276 MCAPI ::Scripting::ScriptEngine* getScriptingEngine();
279 MCFOLD ::ServerGraphicsSettings
const& getServerGraphicsSettings()
const;
281 MCAPI ::ItemRegistryRef getServerItemRegistry()
const;
283 MCAPI ::Bedrock::NonOwnerPointer<::ServerTextSettings> getServerTextSettings()
const;
288 MCAPI
bool isLeaveGameDone()
const;
291 MCFOLD
bool isRealmsStoriesEnabled()
const;
293 MCAPI
void leaveGameSync();
296 MCAPI
void onCriticalScriptError(::Connection::DisconnectFailReason clientReason,
char const* logMessage);
298 MCAPI
void prepForEarlyDestruction();
301 MCAPI
void queueForServerThread(::std::function<
void()> command);
304 MCAPI
bool requestInGamePause(
bool status);
310 MCAPI
void setWakeupFrequency(
int hertz);
313 MCAPI
void startLeaveGame();
315 MCAPI
void startServerThread();
318 MCAPI
void suspend();
330 MCAPI static ::brstd::move_only_function<
335 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
342 MCAPI static ::std::string
const& ASSET_EXTRACTION_ERROR();
344 MCAPI static ::std::string
const& ENTITY_REGISTRY_CREATION_ERROR();
346 MCAPI static ::std::string
const& FINAL_LEVEL_STORAGE_STATE_ERROR();
348 MCAPI static ::std::string
const& HOST_MULTIPLAYER_ERROR();
350 MCAPI static ::std::string
const& INITIAL_LEVEL_STORAGE_STATE_ERROR();
352 MCAPI static ::std::string
const& LEVEL_STORAGE_CREATION_ERROR();
354 MCAPI static ::std::string
const& PACK_SOURCE_LOADING_ERROR();
356 MCAPI static ::std::string
const& POST_INIT_ERROR();
374 MCAPI
void $onLowMemory(::LowMemorySeverity);
376 MCAPI
void $onLevelCorrupt();
378 MCFOLD
void $onGameModeChanged();
380 MCFOLD
void $onTick(
int nTick,
int maxTick);
382 MCFOLD
void $onInternetUpdate();
384 MCFOLD
void $onGameSessionReset();
386 MCFOLD
void $onLevelExit();
388 MCAPI
void $onRequestResourceReload();
390 MCAPI
void $onLowDiskSpace(
bool const bSet);
392 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
394 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
396 MCAPI
void $onAppSuspended();
398 MCAPI
void $onAppResumed();
400 MCFOLD
void $updateScreens();