79 enum class InstanceState :
int {
90 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
91 ::ll::TypedStorage<8, 8, ::IMinecraftApp const&> mApp;
92 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
93 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
94 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
95 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
96 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
97 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
98 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
99 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
100 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
101 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
102 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
103 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
104 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
105 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
106 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
107 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
108 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
109 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
110 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
111 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
112 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*,
char const*)>> mUnrecoverableErrorCallback;
113 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
114 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
115 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
116 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
117 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
118 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
119 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
120 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
121 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
122 ::ll::TypedStorage<1, 1, bool> mEnableRealmsStories;
123 ::ll::TypedStorage<1, 1, bool> mbInitialized;
124 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
125 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
126 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
127 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
128 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
129 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
130 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
131 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
132 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
133 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
134 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::ServerInstanceMessenger::IMessenger>>> mMessenger;
151 virtual void onLowMemory(::LowMemorySeverity) ;
154 virtual void onLevelCorrupt() ;
157 virtual void onCriticalScriptError(
char const* clientDisconnectMessage,
char const* logMessage) ;
160 virtual void onGameModeChanged() ;
163 virtual void onTick(
int nTick,
int maxTick) ;
166 virtual void onInternetUpdate() ;
169 virtual void onGameSessionReset() ;
172 virtual void onLevelExit() ;
175 virtual void onRequestResourceReload() ;
178 virtual void onLowDiskSpace(
bool const bSet) ;
181 virtual void onOutOfDiskSpace(
bool const bSet) ;
184 virtual void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode) ;
187 virtual void onAppSuspended() ;
190 virtual void onAppResumed() ;
193 virtual void updateScreens() ;
201 ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>
const& coordinator
204 MCAPI
void _resetServerScriptManager();
208 MCAPI
void _update();
210 MCAPI
bool _useClientSideChunkGeneration(
::LevelData* levelData)
const;
212 MCAPI
void disconnectAllClientsWithMessage(::std::string msg);
214 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
216 MCAPI ::ItemRegistryRef getServerItemRegistry()
const;
218 MCAPI
bool initializeServer(
222 ::std::optional<::PacketGroupDefinition::PacketGroupBuilder> packetGroupBuilder,
223 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>
const& pathManager,
224 ::std::chrono::seconds maxPlayerIdleTime,
225 ::std::string levelId,
226 ::std::string levelName,
227 ::std::string serverName,
235 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>
const& resourcePackRepository,
236 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>
const& contentTierManager,
239 ::std::string
const& basePath,
240 ::Bedrock::NotNullNonOwnerPtr<::LevelData> levelData,
241 ::std::unique_ptr<::EducationOptions> educationOptions,
243 ::std::function<
void()> criticalSaveCallback,
244 ::std::function<
void()> compactionCallback,
247 bool enableWorldSessionEndPoint,
248 ::std::shared_ptr<::Core::FileStorageArea> storageAreaForLevel,
250 bool enableItemStackNetManager,
251 bool enableItemTransactionLogger,
252 bool enableRealmsStories,
253 ::std::optional<::PlayerMovementSettings> playerMovementSettings,
256 bool disableLanSignaling,
257 bool isServerVisibleToLanDiscovery,
258 bool enablePacketRateLimiting,
260 ::std::optional<bool> clientSideGenerationEnabled,
261 ::ForceBlockNetworkIdsAreHashes blockNetworkIdsAreHashes,
262 ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner> networkSessionOwner,
266 ::NetherNet::LogSeverity defaultLogSeverity,
268 ::std::optional<::NetherNet::NetworkID> netherNetId,
270 ::std::optional<bool> disableClientVibrantVisuals,
271 ::std::unique_ptr<::IPacketSerializationController> packetController,
276 MCAPI
void leaveGameSync();
278 MCAPI
void queueForServerThread(::std::function<
void()> command);
280 MCAPI
void setScriptWatchdogCriticalErrorCallback(::std::function<
void(
char const*)> criticalErrorCallback);
283 setUnrecoverableErrorCallback(::std::function<
void(
char const*,
char const*)> unrecoverableErrorCallback);
285 MCAPI
void startServerThread();
291 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
297 MCAPI static ::std::chrono::nanoseconds
const& SERVER_MAX_DELAY_BEFORE_SLOWDOWN();
304 $ctor(
::IMinecraftApp& app, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>
const& coordinator);
316 MCAPI
void $onLevelCorrupt();
318 MCAPI
void $onCriticalScriptError(
char const* clientDisconnectMessage,
char const* logMessage);
320 MCFOLD
void $onGameModeChanged();
322 MCFOLD
void $onTick(
int nTick,
int maxTick);
324 MCFOLD
void $onInternetUpdate();
326 MCFOLD
void $onGameSessionReset();
328 MCFOLD
void $onLevelExit();
330 MCAPI
void $onRequestResourceReload();
332 MCAPI
void $onLowDiskSpace(
bool const bSet);
334 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
336 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
338 MCAPI
void $onAppSuspended();
340 MCAPI
void $onAppResumed();
342 MCFOLD
void $updateScreens();