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