LeviLamina
Loading...
Searching...
No Matches
RakNetServerLocator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/network/LocatorStateChangeRequest.h"
8#include "mc/network/PermissionIPv6.h"
9#include "mc/network/PermissionLAN.h"
10#include "mc/network/RakNetServerLANVisibility.h"
11#include "mc/network/RakPeerHelper.h"
12#include "mc/network/ServerConnectivityTestResult.h"
13#include "mc/network/ServerLocator.h"
14#include "mc/platform/threading/LockGuard.h"
15#include "mc/world/level/GameType.h"
16
17// auto generated forward declare list
18// clang-format off
19class AppPlatform;
21class RakNetConnector;
23struct PortPair;
24namespace RakNet { class RakPeerInterface; }
25namespace RakNet { struct Packet; }
26namespace RakNet { struct RakNetGUID; }
27// clang-format on
28
29class RakNetServerLocator : public ::ServerLocator {
30public:
31 // RakNetServerLocator inner types declare
32 // clang-format off
33 struct AnnounceServerData;
35 class PingRateRecorder;
37 struct SuspendStateData;
38 // clang-format on
39
40 // RakNetServerLocator inner types define
41 enum class protocolVersion : int {
42 Ipv4 = 4,
43 Ipv6 = 6,
44 };
45
46 struct AnnounceServerData {
47 public:
48 // member variables
49 // NOLINTBEGIN
58 // NOLINTEND
59
60 public:
61 // prevent constructor by default
62 AnnounceServerData();
63
64 public:
65 // member functions
66 // NOLINTBEGIN
68
70 ::std::string const& playerName,
71 ::std::string const& worldName,
72 ::GameType gameType,
73 int numPlayers,
74 int maxNumPlayers,
75 bool isJoinableThroughServerScreen,
76 bool isEditorWorld,
77 bool isHardcore
78 );
79
80 MCNAPI ::RakNetServerLocator::AnnounceServerData& operator=(::RakNetServerLocator::AnnounceServerData const&);
81
83 // NOLINTEND
84
85 public:
86 // constructor thunks
87 // NOLINTBEGIN
88 MCNAPI void* $ctor(::RakNetServerLocator::AnnounceServerData const& announceData);
89
90 MCNAPI void* $ctor(
91 ::std::string const& playerName,
92 ::std::string const& worldName,
93 ::GameType gameType,
94 int numPlayers,
95 int maxNumPlayers,
96 bool isJoinableThroughServerScreen,
97 bool isEditorWorld,
98 bool isHardcore
99 );
100 // NOLINTEND
101
102 public:
103 // destructor thunk
104 // NOLINTBEGIN
105 MCNAPI void $dtor();
106 // NOLINTEND
107 };
108
109 class NatHolePuncherFunctor {
110 public:
111 // member variables
112 // NOLINTBEGIN
114 // NOLINTEND
115
116 public:
117 // prevent constructor by default
118 NatHolePuncherFunctor& operator=(NatHolePuncherFunctor const&);
119 NatHolePuncherFunctor(NatHolePuncherFunctor const&);
120 NatHolePuncherFunctor();
121 };
122
123 class PingRateRecorder {
124 public:
125 // member variables
126 // NOLINTBEGIN
136 // NOLINTEND
137
138 public:
139 // prevent constructor by default
140 PingRateRecorder& operator=(PingRateRecorder const&);
141 PingRateRecorder(PingRateRecorder const&);
142 PingRateRecorder();
143 };
144
145 struct StateChangeRequestData {
146 public:
147 // member variables
148 // NOLINTBEGIN
152 // NOLINTEND
153
154 public:
155 // prevent constructor by default
156 StateChangeRequestData& operator=(StateChangeRequestData const&);
157 StateChangeRequestData(StateChangeRequestData const&);
158 StateChangeRequestData();
159
160 public:
161 // member functions
162 // NOLINTBEGIN
164 // NOLINTEND
165
166 public:
167 // destructor thunk
168 // NOLINTBEGIN
169 MCNAPI void $dtor();
170 // NOLINTEND
171 };
172
173 struct SuspendStateData {
174 public:
175 // member variables
176 // NOLINTBEGIN
180 // NOLINTEND
181
182 public:
183 // prevent constructor by default
184 SuspendStateData& operator=(SuspendStateData const&);
185 SuspendStateData(SuspendStateData const&);
186 SuspendStateData();
187
188 public:
189 // member functions
190 // NOLINTBEGIN
192 // NOLINTEND
193
194 public:
195 // destructor thunk
196 // NOLINTBEGIN
197 MCNAPI void $dtor();
198 // NOLINTEND
199 };
200
201public:
202 // member variables
203 // NOLINTBEGIN
231 // NOLINTEND
232
233public:
234 // prevent constructor by default
235 RakNetServerLocator& operator=(RakNetServerLocator const&);
236 RakNetServerLocator(RakNetServerLocator const&);
237 RakNetServerLocator();
238
239public:
240 // virtual functions
241 // NOLINTBEGIN
242 virtual ~RakNetServerLocator() /*override*/;
243
244 virtual void startAnnouncingServer(
245 ::std::string const& playerName,
246 ::std::string const& worldName,
248 ::GameType gameType,
249 int numPlayers,
250 int maxNumPlayers,
251 bool isJoinableThroughServerScreen,
252 bool isEditorWorld,
253 bool isHardcore
254 ) /*override*/;
255
256 virtual void stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform) /*override*/;
257
258 virtual void startServerDiscovery(::PortPair ports) /*override*/;
259
260 virtual void stopServerDiscovery() /*override*/;
261
262 virtual void addCustomServer(::AsynchronousIPResolver const& futureIP, int port) /*override*/;
263
264 virtual void addCustomServer(::std::string const& address, int port) /*override*/;
265
266 virtual ::std::vector<::PingedCompatibleServer> getServerList() const /*override*/;
267
268 virtual void clearServerList() /*override*/;
269
270 virtual void update() /*override*/;
271
272 virtual float getPingTimeForGUID(::std::string const& guid) /*override*/;
273
274 virtual void checkCanConnectToCustomServerAsync(
275 ::std::string hostIpAddress,
276 int port,
277 ::std::function<void(::ServerConnectivityTestResult)> callback
278 ) /*override*/;
279
280 virtual void _onDisable() /*override*/;
281
282 virtual void _onEnable() /*override*/;
283 // NOLINTEND
284
285public:
286 // member functions
287 // NOLINTBEGIN
288 MCNAPI RakNetServerLocator(
289 ::RakNetConnector& rakNetConnector,
290 ::RakPeerHelper::IPSupportInterface& ipInterface,
291 ::std::vector<::std::string> overrideBroadcastAddresses,
292 bool isServer,
293 ::RakNetServerLANVisibility serverLanVisibility,
294 ::PermissionLAN permissionLAN,
295 ::PermissionIPv6 permissionIPv6,
296 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
297 ::std::function<::std::unique_ptr<::RakNet::RakPeerInterface, void (*)(::RakNet::RakPeerInterface*)>()>
298 createUniqueRakPeerFunc
299 );
300
301 MCNAPI void _activate();
302
303 MCNAPI void _addCustomServerFromIpResolver(::AsynchronousIPResolver const& futureIP, int port);
304
305 MCNAPI bool _addCustomServerV4(::AsynchronousIPResolver const& futureIP, int port);
306
307 MCNAPI bool _addCustomServerV6(::AsynchronousIPResolver const& futureIP, int port);
308
309 MCNAPI void _announceServer(::RakNetServerLocator::AnnounceServerData const& serverData);
310
312 ::LocatorStateChangeRequest newState,
313 ::RakNetServerLocator::AnnounceServerData newAnnounceData,
314 ::PortPair newPorts
315 );
316
317 MCNAPI ::std::string _getHostGuid(::std::string const& address, int port);
318
319 MCNAPI void _getServerOriginalAddress(::std::string& originalAddressToSet, ::std::string const& ip);
320
322 ::std::string const& data,
323 ::RakNet::Packet const* p,
324 bool insertAtBeginning,
325 uint64 readTime
326 );
327
329
330 MCNAPI void _onPingSend(::std::string const& guid, ::std::string const& addr, int ipVersion);
331
332 MCNAPI bool
333 _onPongReceive(float& latencyToSet, ::RakNet::RakNetGUID const& guid, uint const& receivedTime, int ipVersion);
334
335 MCNAPI_C void _punchHoles();
336
337 MCNAPI void _setPingResponder(::RakNetServerLocator::AnnounceServerData const& serverData);
338
339 MCNAPI void _startAnnouncingServer(::RakNetServerLocator::AnnounceServerData const& announceData);
340
341 MCNAPI void _startServerDiscovery(::PortPair const& ports);
342
344
345 MCNAPI void _stopServerDiscovery();
346
347 MCNAPI void _updateNetwork();
348
349 MCNAPI bool _updateQueuedPings();
350
351 MCNAPI void _updateState();
352 // NOLINTEND
353
354public:
355 // static functions
356 // NOLINTBEGIN
357 MCNAPI static bool
358 parseUnconnectedPongPacketData(::std::string const& data, ::std::vector<::std::string>& extraData);
359 // NOLINTEND
360
361public:
362 // constructor thunks
363 // NOLINTBEGIN
364 MCNAPI void* $ctor(
365 ::RakNetConnector& rakNetConnector,
366 ::RakPeerHelper::IPSupportInterface& ipInterface,
367 ::std::vector<::std::string> overrideBroadcastAddresses,
368 bool isServer,
369 ::RakNetServerLANVisibility serverLanVisibility,
370 ::PermissionLAN permissionLAN,
371 ::PermissionIPv6 permissionIPv6,
372 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
373 ::std::function<::std::unique_ptr<::RakNet::RakPeerInterface, void (*)(::RakNet::RakPeerInterface*)>()>
374 createUniqueRakPeerFunc
375 );
376 // NOLINTEND
377
378public:
379 // destructor thunk
380 // NOLINTBEGIN
381 MCNAPI void $dtor();
382 // NOLINTEND
383
384public:
385 // virtual function thunks
386 // NOLINTBEGIN
388 ::std::string const& playerName,
389 ::std::string const& worldName,
390 ::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform,
391 ::GameType gameType,
392 int numPlayers,
393 int maxNumPlayers,
394 bool isJoinableThroughServerScreen,
395 bool isEditorWorld,
396 bool isHardcore
397 );
398
399 MCNAPI void $stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform);
400
401 MCNAPI void $startServerDiscovery(::PortPair ports);
402
403 MCNAPI void $stopServerDiscovery();
404
405 MCNAPI void $addCustomServer(::AsynchronousIPResolver const& futureIP, int port);
406
407 MCNAPI void $addCustomServer(::std::string const& address, int port);
408
409 MCNAPI ::std::vector<::PingedCompatibleServer> $getServerList() const;
410
411 MCNAPI void $clearServerList();
412
413 MCNAPI void $update();
414
415 MCNAPI float $getPingTimeForGUID(::std::string const& guid);
416
418 ::std::string hostIpAddress,
419 int port,
420 ::std::function<void(::ServerConnectivityTestResult)> callback
421 );
422
423 MCNAPI void $_onDisable();
424
425 MCNAPI void $_onEnable();
426
427
428 // NOLINTEND
429
430public:
431 // vftables
432 // NOLINTBEGIN
433 MCNAPI static void** $vftable();
434 // NOLINTEND
435};
Definition AppPlatform.h:76
Definition AsynchronousIPResolver.h:5
Definition NonOwnerPointer.h:9
Definition Packet.h:28
Definition RakNetConnector.h:29
Definition RakNetServerLocator.h:109
Definition RakNetServerLocator.h:123
MCAPI void _onPingSend(::std::string const &guid, ::std::string const &addr, int ipVersion)
MCAPI void $clearServerList()
MCAPI bool _onPongReceive(float &latencyToSet, ::RakNet::RakNetGUID const &guid, uint const &receivedTime, int ipVersion)
MCAPI void _addCustomServerFromIpResolver(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void _startServerDiscovery(::PortPair const &ports)
MCAPI void _setPingResponder(::RakNetServerLocator::AnnounceServerData const &serverData)
MCAPI void _stopAnnouncingServer()
MCAPI ::std::vector<::PingedCompatibleServer > $getServerList() const
MCAPI bool _handleUnconnectedPong(::std::string const &data, ::RakNet::Packet const *p, bool insertAtBeginning, uint64 readTime)
MCAPI void _updateState()
MCAPI float $getPingTimeForGUID(::std::string const &guid)
MCAPI void $stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform > appPlatform)
MCAPI void * $ctor(::RakNetConnector &rakNetConnector, ::RakPeerHelper::IPSupportInterface &ipInterface, ::std::vector<::std::string > overrideBroadcastAddresses, bool isServer, ::RakNetServerLANVisibility serverLanVisibility, ::PermissionLAN permissionLAN, ::PermissionIPv6 permissionIPv6, ::Bedrock::NonOwnerPointer<::AppPlatform > const &appPlatform, ::std::function<::std::unique_ptr<::RakNet::RakPeerInterface, void(*)(::RakNet::RakPeerInterface *)>()> createUniqueRakPeerFunc)
static MCAPI void ** $vftable()
MCAPI void $dtor()
MCAPI void _enqueueStateChangeRequest(::LocatorStateChangeRequest newState, ::RakNetServerLocator::AnnounceServerData newAnnounceData, ::PortPair newPorts)
MCAPI void $startServerDiscovery(::PortPair ports)
MCAPI void _announceServer(::RakNetServerLocator::AnnounceServerData const &serverData)
MCAPI::std::string _getHostGuid(::std::string const &address, int port)
MCAPI void $addCustomServer(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void $startAnnouncingServer(::std::string const &playerName, ::std::string const &worldName, ::Bedrock::NonOwnerPointer<::AppPlatform > appPlatform, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore)
MCAPI bool _addCustomServerV6(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void _getServerOriginalAddress(::std::string &originalAddressToSet, ::std::string const &ip)
MCAPI void _startAnnouncingServer(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI void $update()
MCAPI bool _updateQueuedPings()
MCAPI void _updateNetwork()
MCAPI void $stopServerDiscovery()
MCAPI void $_onEnable()
MCAPI bool _addCustomServerV4(::AsynchronousIPResolver const &futureIP, int port)
static MCAPI bool parseUnconnectedPongPacketData(::std::string const &data, ::std::vector<::std::string > &extraData)
MCAPI void _initializeBroadcastAddresses()
MCAPI void _stopServerDiscovery()
MCAPI void $checkCanConnectToCustomServerAsync(::std::string hostIpAddress, int port, ::std::function< void(::ServerConnectivityTestResult)> callback)
MCAPI void $_onDisable()
MCAPI void _activate()
Definition RakPeerInterface.h:32
Definition RakPeerHelper.h:15
Definition ServerLocator.h:19
STL namespace.
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition RakNetServerLocator.h:46
MCAPI AnnounceServerData(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore)
MCAPI::RakNetServerLocator::AnnounceServerData & operator=(::RakNetServerLocator::AnnounceServerData const &)
MCAPI void * $ctor(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore)
MCAPI void * $ctor(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI AnnounceServerData(::RakNetServerLocator::AnnounceServerData const &announceData)
Definition RakNetServerLocator.h:145
Definition RakNetServerLocator.h:173
Definition Packet.h:7
Definition RakNetGUID.h:7
Definition Alias.h:14