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