Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
NetherNetServerLocator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/certificates/identity/ServerSupportedAuthenticationTypes.h"
7#include "mc/deps/cereal/ContextArea.h"
8#include "mc/deps/core/sem_ver/SemVersion.h"
9#include "mc/deps/core/threading/AsyncPromise.h"
10#include "mc/deps/core/threading/TaskGroup.h"
11#include "mc/deps/core/utility/NonOwnerPointer.h"
12#include "mc/deps/core/utility/pub_sub/Publisher.h"
13#include "mc/deps/core/utility/pub_sub/Subscription.h"
14#include "mc/network/ConnectionType.h"
15#include "mc/network/Nonce.h"
16#include "mc/network/PingedCompatibleServer.h"
17#include "mc/network/StubServerLocator.h"
18#include "mc/platform/brstd/flat_map.h"
19#include "mc/platform/threading/UniqueLock.h"
20#include "mc/server/AsynchronousIPResolver.h"
21#include "mc/world/level/GameType.h"
22
23// auto generated forward declare list
24// clang-format off
25class AppPlatform;
29struct PortPair;
30namespace Bedrock::Http { class DispatcherInterface; }
31namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
32namespace NetherNet { struct NetworkID; }
33namespace cereal { struct ReflectionCtx; }
34namespace cereal { struct SchemaWriter; }
35// clang-format on
36
37class NetherNetServerLocator : public ::StubServerLocator {
38public:
39 // NetherNetServerLocator inner types declare
40 // clang-format off
41 struct ExternalServerPing;
42 struct HttpProbeImpl;
43 struct ServerData;
44 // clang-format on
45
46 // NetherNetServerLocator inner types define
48 public:
49 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<8, 64, ::AsynchronousIPResolver> mFutureIP;
52 ::ll::TypedStorage<2, 2, ushort> mPort;
53 ::ll::TypedStorage<8, 40, ::std::deque<::std::string>> mUrls;
54 ::ll::TypedStorage<8, 40, ::std::deque<::std::string>> mFallbackUrls;
55 ::ll::TypedStorage<8, 424, ::Bedrock::Threading::AsyncPromise<::PingedCompatibleServer>> mPromise;
56 ::ll::TypedStorage<8, 8, uint64> mInFlightRequests;
57 // NOLINTEND
58 };
59
61 public:
62 // member variables
63 // NOLINTBEGIN
64 ::ll::TypedStorage<
65 8,
66 48,
68 ::std::string,
69 ::std::shared_ptr<::NetherNetServerLocator::ExternalServerPing>,
70 ::std::less<::std::string>,
71 ::std::vector<::std::string>,
72 ::std::vector<::std::shared_ptr<::NetherNetServerLocator::ExternalServerPing>>>>
73 mExternalServers;
74 ::ll::
76 mHttpProbePermissions;
77 ::ll::TypedStorage<8, 40, ::std::deque<::std::shared_ptr<::NetherNetServerLocator::ExternalServerPing>>>
78 mPendingExternalServerPings;
79 ::ll::TypedStorage<8, 8, uint64> mInFlightExternalServerRequests;
80 // NOLINTEND
81 };
82
83 struct ServerData {
84 public:
85 // member variables
86 // NOLINTBEGIN
87 ::ll::TypedStorage<1, 1, uchar> mVersion;
88 ::ll::TypedStorage<8, 32, ::std::string> mServerName;
89 ::ll::TypedStorage<4, 4, int> mProtocolVersion;
90 ::ll::TypedStorage<8, 24, ::SemVersion> mAppVersion;
91 ::ll::TypedStorage<8, 32, ::std::string> mLevelName;
92 ::ll::TypedStorage<4, 4, ::GameType> mGameType;
93 ::ll::TypedStorage<4, 4, int> mNumPlayers;
94 ::ll::TypedStorage<4, 4, int> mMaxNumPlayers;
95 ::ll::TypedStorage<1, 1, bool> mIsEditorWorld;
96 ::ll::TypedStorage<1, 1, bool> mIsHardcore;
97 ::ll::TypedStorage<1, 2, ::ServerSupportedAuthenticationTypes> mSupportedAuth;
98 ::ll::TypedStorage<8, 32, ::Social::Nonce> mNonce;
99 ::ll::TypedStorage<2, 2, ::Social::ConnectionType> mConnectionType;
100 // NOLINTEND
101
102 public:
103 // static functions
104 // NOLINTBEGIN
106 // NOLINTEND
107 };
108
109 using Mutex = ::std::mutex;
110
112
113public:
114 // member variables
115 // NOLINTBEGIN
116 ::ll::TypedStorage<8, 24, ::std::vector<::PingedCompatibleServer>> mLanServerList;
117 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::NetherNetServerLocator::HttpProbeImpl>> mHttpProbeImpl;
118 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::NetherNetConnector>> mNetherNetConnector;
119 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::Bedrock::Http::DispatcherInterface>> mHttpDispatcher;
120 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::TransportEndpointCache>> mTransportEndpointCache;
121 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::cereal::ReflectionCtx>> mReflectionCtx;
122 ::ll::TypedStorage<8, 168, ::std::optional<::NetherNetServerLocator::ServerData>> mCachedBroadcastDiscoveryResponse;
123 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mSignalingStatus;
124 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::AppPlatform>> mAppPlatform;
125 ::ll::TypedStorage<1, 1, bool> mAnnouncing;
126 ::ll::TypedStorage<1, 1, bool> mDiscovering;
127 ::ll::TypedStorage<8, 160, ::NetherNetServerLocator::ServerData> mServerToAnnounce;
128 ::ll::TypedStorage<8, 80, ::std::mutex> mLocatorLock;
129 ::ll::TypedStorage<8, 336, ::TaskGroup> mCustomServerTaskGroup;
130 // NOLINTEND
131
132public:
133 // prevent constructor by default
134 NetherNetServerLocator();
135
136public:
137 // virtual functions
138 // NOLINTBEGIN
139 virtual ~NetherNetServerLocator() /*override*/ = default;
140
141 virtual ::std::shared_ptr<::TransportEndpointCache> getTransportEndpointCache() const /*override*/;
142
143 virtual void startAnnouncingServer(
144 ::std::string const& playerName,
145 ::std::string const& worldName,
146 ::GameType gameType,
147 int numPlayers,
148 int maxNumPlayers,
149 bool isJoinableThroughServerScreen,
150 bool isEditorWorld,
151 bool isHardcore,
153 ::Social::Nonce const& nonce
154 ) /*override*/;
155
156 virtual void stopAnnouncingServer() /*override*/;
157
158 virtual void startServerDiscovery(::PortPair ports) /*override*/;
159
160 virtual void stopServerDiscovery() /*override*/;
161
162 virtual void addCustomServer(::AsynchronousIPResolver const& futureIP, int port) /*override*/;
163
164 virtual ::Bedrock::PubSub::Subscription acquireHttpProbePermission() /*override*/;
165
166 virtual ::std::vector<::PingedCompatibleServer> getServerList() const /*override*/;
167
168 virtual void update() /*override*/;
169 // NOLINTEND
170
171public:
172 // member functions
173 // NOLINTBEGIN
174 MCNAPI NetherNetServerLocator(
175 ::Bedrock::NotNullNonOwnerPtr<::NetherNetConnector>&& connector,
176 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
177 ::Bedrock::NonOwnerPointer<::Bedrock::Http::DispatcherInterface> dispatcher,
178 ::Bedrock::NonOwnerPointer<::SignalingService> signalingService
179 );
180
182
183 MCAPI bool _onDiscoveryRequest(::cereal::SchemaWriter& writer, ::cereal::ContextArea area);
184
185 MCNAPI void _setDiscoveryRequestCallback(bool enable);
186
187 MCNAPI void _setIsDiscovering(bool isDiscovering);
188
190 // NOLINTEND
191
192public:
193 // static functions
194 // NOLINTBEGIN
195 MCNAPI static ::PingedCompatibleServer
196 _transformFrom(::NetherNet::NetworkID const& networkID, ::NetherNetServerLocator::ServerData&& serverData);
197 // NOLINTEND
198
199public:
200 // constructor thunks
201 // NOLINTBEGIN
202 MCNAPI void* $ctor(
203 ::Bedrock::NotNullNonOwnerPtr<::NetherNetConnector>&& connector,
204 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
205 ::Bedrock::NonOwnerPointer<::Bedrock::Http::DispatcherInterface> dispatcher,
206 ::Bedrock::NonOwnerPointer<::SignalingService> signalingService
207 );
208 // NOLINTEND
209
210public:
211 // virtual function thunks
212 // NOLINTBEGIN
214
216 ::std::string const& playerName,
217 ::std::string const& worldName,
218 ::GameType gameType,
219 int numPlayers,
220 int maxNumPlayers,
221 bool isJoinableThroughServerScreen,
222 bool isEditorWorld,
223 bool isHardcore,
225 ::Social::Nonce const& nonce
226 );
227
229
230 MCNAPI void $startServerDiscovery(::PortPair ports);
231
232 MCNAPI void $stopServerDiscovery();
233
234 MCNAPI void $addCustomServer(::AsynchronousIPResolver const& futureIP, int port);
235
236 MCNAPI ::Bedrock::PubSub::Subscription $acquireHttpProbePermission();
237
238 MCNAPI ::std::vector<::PingedCompatibleServer> $getServerList() const;
239
240 MCNAPI void $update();
241
242
243 // NOLINTEND
244};
Definition AppPlatform.h:79
Definition AsynchronousIPResolver.h:5
Definition DispatcherInterface.h:17
Definition Publisher.h:25
Definition UniqueLock.h:8
MCAPI ::std::shared_ptr<::TransportEndpointCache > $getTransportEndpointCache() const
MCAPI void $startAnnouncingServer(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore, ::ServerSupportedAuthenticationTypes supportedAuth, ::Social::Nonce const &nonce)
MCAPI void $stopAnnouncingServer()
MCAPI void $startServerDiscovery(::PortPair ports)
MCAPI void _setIsDiscovering(bool isDiscovering)
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::NetherNetConnector > &&connector, ::Bedrock::NonOwnerPointer<::AppPlatform > const &appPlatform, ::Bedrock::NonOwnerPointer<::Bedrock::Http::DispatcherInterface > dispatcher, ::Bedrock::NonOwnerPointer<::SignalingService > signalingService)
MCAPI void _setDiscoveryRequestCallback(bool enable)
static MCAPI ::PingedCompatibleServer _transformFrom(::NetherNet::NetworkID const &networkID, ::NetherNetServerLocator::ServerData &&serverData)
MCAPI void _cacheDiscoveryResponseData()
MCAPI void $stopServerDiscovery()
MCAPI void $addCustomServer(::AsynchronousIPResolver const &futureIP, int port)
MCAPI::Bedrock::PubSub::Subscription $acquireHttpProbePermission()
MCAPI ::std::vector<::PingedCompatibleServer > $getServerList() const
MCAPI void _startPendingExternalServerRequests()
Definition SignalingService.h:37
Definition StubServerLocator.h:19
Definition TransportEndpointCache.h:8
Definition flat_map.h:15
STL namespace.
Definition NetherNetConnector.h:31
Definition NetherNetServerLocator.h:47
Definition NetherNetServerLocator.h:60
Definition NetherNetServerLocator.h:83
static MCAPI void bindType(::cereal::ReflectionCtx &ctx)
Definition NetworkID.h:17
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition ServerSupportedAuthenticationTypes.h:5
Definition ReflectionCtx.h:11
Definition SchemaWriter.h:16
Definition ctx.h:5