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
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
47 public:
48 // member variables
49 // NOLINTBEGIN
59 // NOLINTEND
60
61 public:
62 // prevent constructor by default
63 PingRateRecorder& operator=(PingRateRecorder const&);
66 };
67
69 public:
70 // member variables
71 // NOLINTBEGIN
73 // NOLINTEND
74
75 public:
76 // prevent constructor by default
80 };
81
83 public:
84 // member variables
85 // NOLINTBEGIN
94 // NOLINTEND
95
96 public:
97 // prevent constructor by default
99
100 public:
101 // member functions
102 // NOLINTBEGIN
104
106 ::std::string const& playerName,
107 ::std::string const& worldName,
108 ::GameType gameType,
109 int numPlayers,
110 int maxNumPlayers,
111 bool isJoinableThroughServerScreen,
112 bool isEditorWorld,
113 bool isHardcore
114 );
115
116 MCNAPI ::RakNetServerLocator::AnnounceServerData& operator=(::RakNetServerLocator::AnnounceServerData const&);
117
119 // NOLINTEND
120
121 public:
122 // constructor thunks
123 // NOLINTBEGIN
124 MCNAPI void* $ctor(::RakNetServerLocator::AnnounceServerData const& announceData);
125
126 MCNAPI void* $ctor(
127 ::std::string const& playerName,
128 ::std::string const& worldName,
129 ::GameType gameType,
130 int numPlayers,
131 int maxNumPlayers,
132 bool isJoinableThroughServerScreen,
133 bool isEditorWorld,
134 bool isHardcore
135 );
136 // NOLINTEND
137
138 public:
139 // destructor thunk
140 // NOLINTBEGIN
141 MCNAPI void $dtor();
142 // NOLINTEND
143 };
144
146 public:
147 // member variables
148 // NOLINTBEGIN
152 // NOLINTEND
153
154 public:
155 // prevent constructor by default
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
174 public:
175 // member variables
176 // NOLINTBEGIN
180 // NOLINTEND
181
182 public:
183 // prevent constructor by default
184 SuspendStateData& operator=(SuspendStateData const&);
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&);
238
239public:
240 // virtual functions
241 // NOLINTBEGIN
242 // vIndex: 0
243 virtual ~RakNetServerLocator() /*override*/;
244
245 // vIndex: 3
246 virtual void startAnnouncingServer(
247 ::std::string const& playerName,
248 ::std::string const& worldName,
250 ::GameType gameType,
251 int numPlayers,
252 int maxNumPlayers,
253 bool isJoinableThroughServerScreen,
254 bool isEditorWorld,
255 bool isHardcore
256 ) /*override*/;
257
258 // vIndex: 4
259 virtual void stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform) /*override*/;
260
261 // vIndex: 5
262 virtual void startServerDiscovery(::PortPair ports) /*override*/;
263
264 // vIndex: 6
265 virtual void stopServerDiscovery() /*override*/;
266
267 // vIndex: 8
268 virtual void addCustomServer(::AsynchronousIPResolver const& futureIP, int port) /*override*/;
269
270 // vIndex: 7
271 virtual void addCustomServer(::std::string const& address, int port) /*override*/;
272
273 // vIndex: 9
274 virtual ::std::vector<::PingedCompatibleServer> getServerList() const /*override*/;
275
276 // vIndex: 10
277 virtual void clearServerList() /*override*/;
278
279 // vIndex: 11
280 virtual void update() /*override*/;
281
282 // vIndex: 12
283 virtual float getPingTimeForGUID(::std::string const& guid) /*override*/;
284
285 // vIndex: 13
286 virtual void checkCanConnectToCustomServerAsync(
287 ::std::string hostIpAddress,
288 int port,
289 ::std::function<void(::ServerConnectivityTestResult)> callback
290 ) /*override*/;
291
292 // vIndex: 1
293 virtual void _onDisable() /*override*/;
294
295 // vIndex: 2
296 virtual void _onEnable() /*override*/;
297 // NOLINTEND
298
299public:
300 // member functions
301 // NOLINTBEGIN
303 ::RakNetConnector& rakNetConnector,
304 ::RakPeerHelper::IPSupportInterface& ipInterface,
305 ::std::vector<::std::string> overrideBroadcastAddresses,
306 bool isServer,
307 ::RakNetServerLANVisibility serverLanVisibility,
308 ::PermissionLAN permissionLAN,
309 ::PermissionIPv6 permissionIPv6,
310 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
311 ::std::function<::std::unique_ptr<::RakNet::RakPeerInterface, void (*)(::RakNet::RakPeerInterface*)>()>
312 createUniqueRakPeerFunc
313 );
314
315 MCNAPI void _activate();
316
317 MCNAPI void _addCustomServerFromIpResolver(::AsynchronousIPResolver const& futureIP, int port);
318
319 MCNAPI bool _addCustomServerV4(::AsynchronousIPResolver const& futureIP, int port);
320
321 MCNAPI bool _addCustomServerV6(::AsynchronousIPResolver const& futureIP, int port);
322
324 ::LocatorStateChangeRequest newState,
325 ::RakNetServerLocator::AnnounceServerData newAnnounceData,
326 ::PortPair newPorts
327 );
328
329 MCNAPI ::std::string _getHostGuid(::std::string const& address, int port);
330
331 MCNAPI void _getServerOriginalAddress(::std::string& originalAddressToSet, ::std::string const& ip);
332
334 ::std::string const& data,
335 ::RakNet::Packet const* p,
336 bool insertAtBeginning,
337 uint64 readTime
338 );
339
341
342 MCNAPI void _onPingSend(::std::string const& guid, ::std::string const& addr, int ipVersion);
343
344 MCNAPI bool
345 _onPongReceive(float& latencyToSet, ::RakNet::RakNetGUID const& guid, uint const& receivedTime, int ipVersion);
346
348
350
351 MCNAPI void _startServerDiscovery(::PortPair const& ports);
352
354
355 MCNAPI void _stopServerDiscovery();
356
357 MCNAPI void _updateNetwork();
358
359 MCNAPI bool _updateQueuedPings();
360
361 MCNAPI void _updateState();
362 // NOLINTEND
363
364public:
365 // static functions
366 // NOLINTBEGIN
367 MCNAPI static bool
368 parseUnconnectedPongPacketData(::std::string const& data, ::std::vector<::std::string>& extraData);
369 // NOLINTEND
370
371public:
372 // constructor thunks
373 // NOLINTBEGIN
374 MCNAPI void* $ctor(
375 ::RakNetConnector& rakNetConnector,
376 ::RakPeerHelper::IPSupportInterface& ipInterface,
377 ::std::vector<::std::string> overrideBroadcastAddresses,
378 bool isServer,
379 ::RakNetServerLANVisibility serverLanVisibility,
380 ::PermissionLAN permissionLAN,
381 ::PermissionIPv6 permissionIPv6,
382 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
383 ::std::function<::std::unique_ptr<::RakNet::RakPeerInterface, void (*)(::RakNet::RakPeerInterface*)>()>
384 createUniqueRakPeerFunc
385 );
386 // NOLINTEND
387
388public:
389 // destructor thunk
390 // NOLINTBEGIN
391 MCNAPI void $dtor();
392 // NOLINTEND
393
394public:
395 // virtual function thunks
396 // NOLINTBEGIN
398 ::std::string const& playerName,
399 ::std::string const& worldName,
400 ::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform,
401 ::GameType gameType,
402 int numPlayers,
403 int maxNumPlayers,
404 bool isJoinableThroughServerScreen,
405 bool isEditorWorld,
406 bool isHardcore
407 );
408
409 MCNAPI void $stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform);
410
411 MCNAPI void $startServerDiscovery(::PortPair ports);
412
413 MCNAPI void $stopServerDiscovery();
414
415 MCNAPI void $addCustomServer(::AsynchronousIPResolver const& futureIP, int port);
416
417 MCNAPI void $addCustomServer(::std::string const& address, int port);
418
419 MCNAPI ::std::vector<::PingedCompatibleServer> $getServerList() const;
420
421 MCNAPI void $clearServerList();
422
423 MCNAPI void $update();
424
425 MCNAPI float $getPingTimeForGUID(::std::string const& guid);
426
428 ::std::string hostIpAddress,
429 int port,
430 ::std::function<void(::ServerConnectivityTestResult)> callback
431 );
432
433 MCNAPI void $_onDisable();
434
435 MCNAPI void $_onEnable();
436 // NOLINTEND
437
438public:
439 // vftables
440 // NOLINTBEGIN
441 MCNAPI static void** $vftable();
442 // NOLINTEND
443};
Definition AppPlatform.h:50
Definition AsynchronousIPResolver.h:5
Definition NonOwnerPointer.h:9
Definition Packet.h:26
Definition RakNetConnector.h:29
Definition RakNetServerLocator.h:68
Definition RakNetServerLocator.h:46
Definition RakNetServerLocator.h:29
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::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 RakPeerHelper.h:15
Definition ServerLocator.h:19
STL namespace.
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition RakNetServerLocator.h:82
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 Alias.h:14