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