74 enum class InstanceState :
int {
85 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
86 ::ll::TypedStorage<8, 8, ::IMinecraftApp const&> mApp;
87 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
88 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
89 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
90 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
91 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
92 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
93 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
94 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
95 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
96 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
97 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
98 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
99 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
100 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
101 ::ll::TypedStorage<8, 80,
::SPSCQueue<::std::function<void()>, 512>> mCommandQueue;
102 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
103 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
104 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
105 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
106 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
107 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
108 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*,
char const*)>> mUnrecoverableErrorCallback;
109 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
110 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
111 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
112 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
113 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
114 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
115 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
116 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::BlockTypeRegistry>> mBlockRegistry;
117 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
118 ::ll::TypedStorage<1, 1, bool> mbInitialized;
119 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
120 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
121 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
122 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
123 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
124 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
125 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
126 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
127 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
143 virtual void onLowMemory(::LowMemorySeverity) ;
146 virtual void onLevelCorrupt() ;
149 virtual void onCriticalScriptError(
char const* clientDisconnectMessage,
char const* logMessage) ;
152 virtual void onGameModeChanged() ;
155 virtual void onTick(
int nTick,
int maxTick) ;
158 virtual void onInternetUpdate() ;
161 virtual void onGameSessionReset() ;
164 virtual void onLevelExit() ;
167 virtual void onRequestResourceReload() ;
170 virtual void onLowDiskSpace(
bool const bSet) ;
173 virtual void onOutOfDiskSpace(
bool const bSet) ;
176 virtual void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode) ;
179 virtual void onAppSuspended() ;
182 virtual void onAppResumed() ;
185 virtual void updateScreens() ;
193 ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>
const& coordinator
196 MCAPI
void _resetServerScriptManager();
200 MCAPI
void _update();
202 MCAPI
bool _useClientSideChunkGeneration(
::LevelData* levelData)
const;
204 MCAPI
void disconnectAllClientsWithMessage(::std::string msg);
206 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
208 MCAPI ::ItemRegistryRef getServerItemRegistry()
const;
210 MCAPI
bool initializeServer(
214 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>
const& pathManager,
215 ::std::chrono::seconds maxPlayerIdleTime,
216 ::std::string levelId,
217 ::std::string levelName,
218 ::std::string serverName,
226 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>
const& resourcePackRepository,
227 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>
const& contentTierManager,
230 ::std::string
const& basePath,
231 ::Bedrock::NotNullNonOwnerPtr<::LevelData> levelData,
232 ::std::unique_ptr<::EducationOptions> educationOptions,
234 ::std::function<
void()> criticalSaveCallback,
235 ::std::function<
void()> compactionCallback,
238 bool enableWorldSessionEndPoint,
239 ::std::shared_ptr<::Core::FileStorageArea> storageAreaForLevel,
241 bool enableItemStackNetManager,
242 bool enableItemTransactionLogger,
243 ::std::optional<::PlayerMovementSettings> playerMovementSettings,
246 bool isServerVisibleToLanDiscovery,
247 bool enablePacketRateLimiting,
249 ::std::optional<bool> clientSideGenerationEnabled,
250 ::ForceBlockNetworkIdsAreHashes blockNetworkIdsAreHashes,
251 ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner> networkSessionOwner,
255 ::NetherNet::LogSeverity defaultLogSeverity,
257 ::std::optional<::NetherNet::NetworkID> netherNetId
260 MCAPI
void leaveGameSync();
262 MCAPI
void queueForServerThread(::std::function<
void()> command);
264 MCAPI
void setScriptWatchdogCriticalErrorCallback(::std::function<
void(
char const*)> criticalErrorCallback);
267 setUnrecoverableErrorCallback(::std::function<
void(
char const*,
char const*)> unrecoverableErrorCallback);
269 MCAPI
void setWakeupFrequency(
int hertz);
271 MCAPI
void startLeaveGame();
273 MCAPI
void startServerThread();
279 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
285 MCAPI static ::std::chrono::nanoseconds
const& SERVER_MAX_DELAY_BEFORE_SLOWDOWN();
292 $ctor(
::IMinecraftApp& app, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>
const& coordinator);
304 MCAPI
void $onLevelCorrupt();
306 MCAPI
void $onCriticalScriptError(
char const* clientDisconnectMessage,
char const* logMessage);
308 MCFOLD
void $onGameModeChanged();
310 MCFOLD
void $onTick(
int nTick,
int maxTick);
312 MCFOLD
void $onInternetUpdate();
314 MCFOLD
void $onGameSessionReset();
316 MCFOLD
void $onLevelExit();
318 MCAPI
void $onRequestResourceReload();
320 MCAPI
void $onLowDiskSpace(
bool const bSet);
322 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
324 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
326 MCAPI
void $onAppSuspended();
328 MCAPI
void $onAppResumed();
330 MCFOLD
void $updateScreens();