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;
21class EditorBootstrapper;
22class FileArchiver;
23class IEDUSystems;
24class IGameModuleShared;
25class IMinecraftEventing;
26class LevelDbEnv;
27class LevelSettings;
28class Minecraft;
29class PermissionsFile;
31class ServerInstanceEventCoordinator;
32class ServerTextSettings;
33class SignalingService;
34class SignalingServiceSignInJob;
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 };
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 virtual ~DedicatedServer() /*override*/;
97
98 virtual bool stop() /*override*/;
99
100 virtual ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> getFileArchiver() const /*override*/;
101
102 virtual ::Bedrock::NotNullNonOwnerPtr<::Minecraft> getPrimaryMinecraft() /*override*/;
103
104 virtual ::Bedrock::NotNullNonOwnerPtr<::Automation::AutomationClient> getAutomationClient() const /*override*/;
105
106 virtual bool isEduMode() const /*override*/;
107
108 virtual bool isDedicatedServer() const /*override*/;
109
110 virtual void onNetworkMaxPlayersChanged(uint newMaxPlayerCount) /*override*/;
111
112 virtual ::IGameModuleShared& getGameModuleShared() /*override*/;
113
114 virtual void requestServerShutdown(::std::string const&) /*override*/;
115
116 virtual bool requestInGamePause(::SubClientId const&, bool) /*override*/;
117 // NOLINTEND
118
119public:
120 // member functions
121 // NOLINTBEGIN
122 MCAPI DedicatedServer();
123
124 MCAPI void initializeAppConfigs();
125
126 MCAPI void initializeCodeBuilder();
127
128 MCAPI void initializeHttp(::PropertiesSettings const& properties);
129
130 MCAPI void initializeImguiProfiler();
131
132 MCAPI void initializeLogging(::TestConfig& testConfig);
133
134 MCAPI ::std::future<bool> initializeMultiplayerKeys(
135 ::Minecraft& minecraft,
136 ::Bedrock::NonOwnerPointer<::Bedrock::Services::DiscoveryHelper> discovery,
137 ::PropertiesSettings const& properties
138 );
139
140 MCAPI void initializeServices(
141 ::Bedrock::NotNullNonOwnerPtr<::IMinecraftEventing> minecraftEventing,
142 ::PropertiesSettings& properties
143 );
144
145 MCAPI ::DedicatedServer::StartResult runDedicatedServerLoop(
146 ::Core::FilePathManager& filePathManager,
147 ::PropertiesSettings& properties,
148 ::LevelSettings& settings,
149 ::AllowListFile& userAllowList,
150 ::std::unique_ptr<::PermissionsFile>& permissionsFile,
151 ::std::optional<::PacketGroupDefinition::PacketGroupBuilder> packetGroupBuilder,
152 ::Bedrock::ActivationArguments const& args,
153 ::TestConfig& testConfig
154 );
155
156 MCAPI void shutdownServices();
157
158 MCAPI ::DedicatedServer::StartResult
159 start(::std::string const& sessionID, ::Bedrock::ActivationArguments const& args);
160 // NOLINTEND
161
162public:
163 // constructor thunks
164 // NOLINTBEGIN
165 MCAPI void* $ctor();
166 // NOLINTEND
167
168public:
169 // destructor thunk
170 // NOLINTBEGIN
171 MCAPI void $dtor();
172 // NOLINTEND
173
174public:
175 // virtual function thunks
176 // NOLINTBEGIN
177 MCAPI bool $stop();
178
179 MCAPI ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> $getFileArchiver() const;
180
181 MCAPI ::Bedrock::NotNullNonOwnerPtr<::Minecraft> $getPrimaryMinecraft();
182
183 MCAPI ::Bedrock::NotNullNonOwnerPtr<::Automation::AutomationClient> $getAutomationClient() const;
184
185 MCAPI bool $isEduMode() const;
186
187 MCFOLD bool $isDedicatedServer() const;
188
189 MCFOLD void $onNetworkMaxPlayersChanged(uint newMaxPlayerCount);
190
191 MCFOLD ::IGameModuleShared& $getGameModuleShared();
192
193 MCAPI void $requestServerShutdown(::std::string const&);
194
195 MCFOLD bool $requestInGamePause(::SubClientId const&, bool);
196 // NOLINTEND
197
198public:
199 // vftables
200 // NOLINTBEGIN
201 MCNAPI static void** $vftableForAppIsland();
202
203 MCNAPI static void** $vftableForIMinecraftApp();
204 // NOLINTEND
205};
Definition ConsoleInputReader.h:5
Definition DedicatedServer.h:48
static MCAPI void ** $vftableForIMinecraftApp()
static MCAPI void ** $vftableForAppIsland()
Definition PropertiesSettings.h:29
Definition TestConfig.h:5