LeviLamina
Loading...
Searching...
No Matches
DedicatedServer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/IMinecraftApp.h"
7#include "mc/common/SubClientId.h"
8#include "mc/deps/core/islands/AppIsland.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/deps/core/utility/ScopeExit.h"
11#include "mc/deps/core/utility/ServiceRegistrationToken.h"
12#include "mc/deps/core/utility/UniqueOwnerPointer.h"
13#include "mc/network/PacketGroupDefinition.h"
14#include "mc/platform/brstd/future.h"
15
16// auto generated forward declare list
17// clang-format off
18class AllowListFile;
19class AppConfigs;
20class CDNConfig;
23class FileArchiver;
24class IEDUSystems;
27class LevelDbEnv;
28class LevelSettings;
29class Minecraft;
30class PermissionsFile;
37class TestConfig;
38struct ImguiProfiler;
41namespace Automation { class AutomationClient; }
42namespace Bedrock { class ActivationArguments; }
43namespace Bedrock::Http { class DispatcherInterface; }
44namespace Bedrock::Http { class DispatcherProcess; }
45namespace Bedrock::Services { class AuthHelper; }
46namespace Bedrock::Services { class DiscoveryHelper; }
47namespace CodeBuilder { class IManager; }
48namespace Core { class FilePathManager; }
49namespace Core { class FileSystem; }
50// clang-format on
51
52class DedicatedServer : public ::IMinecraftApp, public ::Bedrock::AppIsland {
53public:
54 // DedicatedServer inner types define
55 enum class ServerExitCode : int {
56 Success = 0,
57 PortOccupied = 1,
58 InvalidSettings = 2,
59 MissingDependency = 3,
60 RuntimeError = 4,
61 DocumentationGenerationError = 5,
62 ScriptWatchdogTermination = 6,
63 };
64
65public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::Minecraft>> mMinecraft;
69 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::Core::FileSystem>> mFileSystem;
70 ::ll::TypedStorage<8, 16, ::Bedrock::UniqueOwnerPointer<::ServerInstanceEventCoordinator>>
71 mServerInstanceEventCoordinator;
72 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mWantsToQuit;
73 ::ll::TypedStorage<4, 4, ::std::atomic<::DedicatedServer::ServerExitCode>> mResult;
74 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ConsoleInputReader>> mConsoleInputReader;
75 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModuleShared>> mGameModule;
76 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::AppConfigs>> mAppConfig;
77 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::AppConfigs>> mAppConfigServiceRegistrationToken;
78 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Http::DispatcherProcess>> mHttpDispatcher;
79 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::Bedrock::Http::DispatcherInterface>>
80 mHttpDispatcherServiceRegistrationToken;
81 ::ll::TypedStorage<8, 32, ::std::string> mSessionID;
82 ::ll::TypedStorage<8, 64, ::Bedrock::ScopeExit> mOnDestructioncloseAndResetAllLogs;
83 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelDbEnv>> mLevelDbEnv;
84 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CodeBuilder::IManager>> mCodeBuilder;
85 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::CodeBuilder::IManager>> mCodeBuilderRegistrationToken;
86 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ImguiProfiler>> mImguiProfiler;
87 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ImguiProfiler>> mImguiProfilerRegistrationToken;
88 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ProfilingConfigManager>> mProfilingConfigManager;
89 ::ll::TypedStorage<8, 8, ::ServiceRegistrationToken<::ProfilingConfigManager>>
90 mProfilingConfigManagerServiceRegistrationToken;
91 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::FileArchiver>> mFileArchiver;
92 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EditorBootstrapper>> mEditorBootstrapper;
93 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CDNConfig>> mCDNConfig;
94 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerTextSettings>> mServerTextSettings;
95 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SignalingService>> mSignalingService;
96 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SignalingServiceSignInJob>> mSignalingServiceSignInJob;
97 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Services::DiscoveryHelper>> mDiscoveryServiceHelper;
98 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Services::AuthHelper>> mAuthServiceHelper;
99 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IEDUSystems>> mEduSystems;
100 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScriptDedicatedServerUtils>> mScriptDedicatedServerUtils;
101 // NOLINTEND
102
103public:
104 // virtual functions
105 // NOLINTBEGIN
106 virtual ~DedicatedServer() /*override*/;
107
108 virtual bool stop() /*override*/;
109
110 virtual ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> getFileArchiver() const /*override*/;
111
112 virtual ::Bedrock::NotNullNonOwnerPtr<::Minecraft> getPrimaryMinecraft() /*override*/;
113
114 virtual ::Bedrock::NotNullNonOwnerPtr<::Automation::AutomationClient> getAutomationClient() const /*override*/;
115
116 virtual bool isEduMode() const /*override*/;
117
118 virtual bool isDedicatedServer() const /*override*/;
119
120 virtual void onNetworkMaxPlayersChanged(uint) /*override*/;
121
122 virtual ::IGameModuleShared& getGameModuleShared() /*override*/;
123
124 virtual void requestServerShutdown() /*override*/;
125
126 virtual bool requestInGamePause(::SubClientId const&, bool) /*override*/;
127 // NOLINTEND
128
129public:
130 // member functions
131 // NOLINTBEGIN
132 MCAPI DedicatedServer();
133
134 MCAPI ::TextProcessorInitParams createTextProcessorInitParams(::PropertiesSettings const& properties) const;
135
136 MCAPI void initializeAppConfigs();
137
138 MCAPI void initializeCodeBuilder();
139
140 MCAPI void initializeHttp(::PropertiesSettings const& properties);
141
142 MCAPI void initializeImguiProfiler();
143
144 MCAPI void initializeLogging(::TestConfig& testConfig);
145
146 MCAPI ::brstd::future<bool>
147 initializeMultiplayerKeys(::Minecraft& minecraft, ::PropertiesSettings const& properties);
148
149 MCAPI void initializeServices(
150 ::Bedrock::NotNullNonOwnerPtr<::IMinecraftEventing> minecraftEventing,
151 ::PropertiesSettings const& properties
152 );
153
154 MCAPI ::DedicatedServer::ServerExitCode runDedicatedServerLoop(
155 ::Core::FilePathManager& filePathManager,
156 ::PropertiesSettings const& properties,
157 ::LevelSettings& settings,
158 ::AllowListFile& userAllowList,
159 ::std::unique_ptr<::PermissionsFile>& permissionsFile,
160 ::std::optional<::PacketGroupDefinition::PacketGroupBuilder> packetGroupBuilder,
162 ::TestConfig& testConfig
163 );
164
165 MCAPI void shutdownServices();
166
167 MCAPI ::DedicatedServer::ServerExitCode
168 start(::std::string const& sessionID, ::Bedrock::ActivationArguments const& args);
169 // NOLINTEND
170
171public:
172 // constructor thunks
173 // NOLINTBEGIN
174 MCAPI void* $ctor();
175 // NOLINTEND
176
177public:
178 // destructor thunk
179 // NOLINTBEGIN
180 MCAPI void $dtor();
181 // NOLINTEND
182
183public:
184 // virtual function thunks
185 // NOLINTBEGIN
186 MCAPI bool $stop();
187
188 MCAPI ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> $getFileArchiver() const;
189
190 MCAPI ::Bedrock::NotNullNonOwnerPtr<::Minecraft> $getPrimaryMinecraft();
191
192 MCAPI ::Bedrock::NotNullNonOwnerPtr<::Automation::AutomationClient> $getAutomationClient() const;
193
194 MCAPI bool $isEduMode() const;
195
196 MCFOLD bool $isDedicatedServer() const;
197
198 MCFOLD void $onNetworkMaxPlayersChanged(uint);
199
200 MCFOLD ::IGameModuleShared& $getGameModuleShared();
201
202 MCAPI void $requestServerShutdown();
203
204 MCFOLD bool $requestInGamePause(::SubClientId const&, bool);
205 // NOLINTEND
206
207public:
208 // vftables
209 // NOLINTBEGIN
210 MCNAPI static void** $vftableForAppIsland();
211
212 MCNAPI static void** $vftableForIMinecraftApp();
213 // NOLINTEND
214};
Definition AllowListFile.h:14
Definition AppConfigs.h:25
Definition AutomationClient.h:27
Definition ActivationArguments.h:7
Definition AppIsland.h:15
MCAPI void $dtor()
MCAPI void * $ctor()
MCAPI bool $stop()
Definition DispatcherInterface.h:17
Definition DispatcherProcess.h:11
Definition CDNConfig.h:9
Definition IManager.h:17
Definition ConsoleInputReader.h:8
Definition FilePathManager.h:18
Definition FileSystem.h:28
static MCAPI void ** $vftableForIMinecraftApp()
static MCAPI void ** $vftableForAppIsland()
Definition EditorBootstrapper.h:15
Definition FileArchiver.h:36
Definition IEDUSystems.h:14
Definition IGameModuleShared.h:15
Definition IMinecraftApp.h:19
Definition IMinecraftEventing.h:138
Definition LevelDbEnv.h:8
Definition LevelSettings.h:40
Definition Minecraft.h:61
Definition PermissionsFile.h:20
Definition ProfilingConfigManager.h:16
Definition ScriptDedicatedServerUtils.h:13
Definition ServerInstanceEventCoordinator.h:20
Definition ServerTextSettings.h:8
Definition SignalingServiceSignInJob.h:23
Definition SignalingService.h:41
Definition TestConfig.h:5
Definition ImguiProfiler.h:11
Definition PropertiesSettings.h:32
Definition TextProcessorInitParams.h:5