76 enum class InstanceState :
int {
87 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastSyncTime;
88 ::ll::TypedStorage<8, 8, ::IMinecraftApp const&> mApp;
89 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Minecraft>> mMinecraft;
90 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerNetworkSystem>> mNetwork;
91 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LoopbackPacketSender>> mPacketSender;
92 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mSimTimer;
93 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Timer>> mRealTimer;
94 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scheduler>> mScheduler;
95 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EducationOptions>> mEducationOptions;
96 ::ll::TypedStorage<8, 8, ::LevelStorage*> mStorage;
97 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mInUpdate;
98 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mWriteRefCounter;
99 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mThreadShouldJoin;
100 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutexDestruction;
101 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>> mEventCoordinator;
102 ::ll::TypedStorage<4, 4, ::std::atomic<::ServerInstance::InstanceState>> mInstanceState;
103 ::ll::TypedStorage<8, 80,
::SPSCQueue<::std::function<void()>, 512>> mCommandQueue;
104 ::ll::TypedStorage<8, 16, ::std::thread> mServerInstanceThread;
105 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mResumeMutex;
106 ::ll::TypedStorage<8, 72, ::std::condition_variable> mResumeSignal;
107 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerScriptManager>> mServerScriptManager;
108 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Scripting::RegistryManager>> mScriptRegistryManager;
109 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*)>> mScriptWatchdogCriticalErrorCallback;
110 ::ll::TypedStorage<8, 64, ::std::function<void(
char const*,
char const*)>> mUnrecoverableErrorCallback;
111 ::ll::TypedStorage<1, 1, bool> mHandledLevelCorruption;
112 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextFilteringProcessor>> mTextFilteringProcessor;
113 ::ll::TypedStorage<8, 8, ::std::chrono::microseconds> mWakeupInterval;
114 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
115 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorldSessionEndPoint>> mWorldSessionEndPoint;
116 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Core::FileStorageArea>> mStorageAreaForLevel;
117 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ItemRegistry>> mServerItemRegistry;
118 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::BlockTypeRegistry>> mBlockRegistry;
119 ::ll::TypedStorage<1, 1, bool> mEnableItemStackNetManager;
120 ::ll::TypedStorage<1, 1, bool> mbInitialized;
121 ::ll::TypedStorage<1, 1, bool> mbFlaggedForEarlyDestruction;
122 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ServerInstance>> mServiceRegistrationToken;
123 ::ll::TypedStorage<1, 1, bool> mHasScheduledLeaveGame;
124 ::ll::TypedStorage<1, 1, bool> mCriticalDiskErrorTelemetrySent;
125 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorManager>> mEditorManager;
126 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::CDNConfig>> mCDNConfig;
127 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ServerTextSettings>> mServerTextSettings;
128 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCerealContext;
129 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LinkedAssetValidator>> mLinkedAssetValidator;
130 ::ll::TypedStorage<1, 1, ::ServerGraphicsSettings> mGraphicsSettings;
146 virtual void onLowMemory(::LowMemorySeverity) ;
149 virtual void onLevelCorrupt() ;
152 virtual void onCriticalScriptError(
char const* clientDisconnectMessage,
char const* logMessage) ;
155 virtual void onGameModeChanged() ;
158 virtual void onTick(
int nTick,
int maxTick) ;
161 virtual void onInternetUpdate() ;
164 virtual void onGameSessionReset() ;
167 virtual void onLevelExit() ;
170 virtual void onRequestResourceReload() ;
173 virtual void onLowDiskSpace(
bool const bSet) ;
176 virtual void onOutOfDiskSpace(
bool const bSet) ;
179 virtual void onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode) ;
182 virtual void onAppSuspended() ;
185 virtual void onAppResumed() ;
188 virtual void updateScreens() ;
196 ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>
const& coordinator
199 MCAPI
void _resetServerScriptManager();
203 MCAPI
void _update();
205 MCAPI
bool _useClientSideChunkGeneration(
::LevelData* levelData)
const;
207 MCAPI
void disconnectAllClientsWithMessage(::std::string msg);
209 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorManager> getEditorManager()
const;
211 MCAPI ::ItemRegistryRef getServerItemRegistry()
const;
213 MCAPI
bool initializeServer(
217 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>
const& pathManager,
218 ::std::chrono::seconds maxPlayerIdleTime,
219 ::std::string levelId,
220 ::std::string levelName,
221 ::std::string serverName,
229 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>
const& resourcePackRepository,
230 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const>
const& contentTierManager,
233 ::std::string
const& basePath,
234 ::Bedrock::NotNullNonOwnerPtr<::LevelData> levelData,
235 ::std::unique_ptr<::EducationOptions> educationOptions,
237 ::std::function<
void()> criticalSaveCallback,
238 ::std::function<
void()> compactionCallback,
241 bool enableWorldSessionEndPoint,
242 ::std::shared_ptr<::Core::FileStorageArea> storageAreaForLevel,
244 bool enableItemStackNetManager,
245 bool enableItemTransactionLogger,
246 ::std::optional<::PlayerMovementSettings> playerMovementSettings,
249 bool isServerVisibleToLanDiscovery,
250 bool enablePacketRateLimiting,
252 ::std::optional<bool> clientSideGenerationEnabled,
253 ::ForceBlockNetworkIdsAreHashes blockNetworkIdsAreHashes,
254 ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner> networkSessionOwner,
258 ::NetherNet::LogSeverity defaultLogSeverity,
260 ::std::optional<::NetherNet::NetworkID> netherNetId,
262 ::std::optional<bool> disableClientVibrantVisuals
265 MCAPI
void leaveGameSync();
267 MCAPI
void queueForServerThread(::std::function<
void()> command);
269 MCAPI
void setScriptWatchdogCriticalErrorCallback(::std::function<
void(
char const*)> criticalErrorCallback);
272 setUnrecoverableErrorCallback(::std::function<
void(
char const*,
char const*)> unrecoverableErrorCallback);
274 MCAPI
void setWakeupFrequency(
int hertz);
276 MCAPI
void startLeaveGame();
278 MCAPI
void startServerThread();
284 MCAPI
static bool forceOffClientChunkGeneration(
::LevelData& levelData);
290 MCAPI static ::std::chrono::nanoseconds
const& SERVER_MAX_DELAY_BEFORE_SLOWDOWN();
297 $ctor(
::IMinecraftApp& app, ::Bedrock::NotNullNonOwnerPtr<::ServerInstanceEventCoordinator>
const& coordinator);
309 MCAPI
void $onLowMemory(::LowMemorySeverity);
311 MCAPI
void $onLevelCorrupt();
313 MCAPI
void $onCriticalScriptError(
char const* clientDisconnectMessage,
char const* logMessage);
315 MCFOLD
void $onGameModeChanged();
317 MCFOLD
void $onTick(
int nTick,
int maxTick);
319 MCFOLD
void $onInternetUpdate();
321 MCFOLD
void $onGameSessionReset();
323 MCFOLD
void $onLevelExit();
325 MCAPI
void $onRequestResourceReload();
327 MCAPI
void $onLowDiskSpace(
bool const bSet);
329 MCAPI
void $onOutOfDiskSpace(
bool const bSet);
331 MCAPI
void $onCriticalDiskError(
bool const bSet, ::Core::LevelStorageState
const& errorCode);
333 MCAPI
void $onAppSuspended();
335 MCAPI
void $onAppResumed();
337 MCFOLD
void $updateScreens();