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
105 MCAPI AnnounceServerData(
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 MCAPI ::RakNetServerLocator::AnnounceServerData& operator=(::RakNetServerLocator::AnnounceServerData const&);
117
118 MCAPI ~AnnounceServerData();
119 // NOLINTEND
120
121 public:
122 // constructor thunks
123 // NOLINTBEGIN
124 MCAPI void* $ctor(::RakNetServerLocator::AnnounceServerData const& announceData);
125
126 MCAPI 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 MCFOLD 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 MCFOLD 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
191 MCAPI ~SuspendStateData();
192 // NOLINTEND
193
194 public:
195 // destructor thunk
196 // NOLINTBEGIN
197 MCFOLD 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 MCAPI void _activate();
316
317 MCAPI void _addCustomServerFromIpResolver(::AsynchronousIPResolver const& futureIP, int port);
318
319 MCAPI bool _addCustomServerV4(::AsynchronousIPResolver const& futureIP, int port);
320
321 MCAPI bool _addCustomServerV6(::AsynchronousIPResolver const& futureIP, int port);
322
323 MCAPI void _enqueueStateChangeRequest(
324 ::LocatorStateChangeRequest newState,
325 ::RakNetServerLocator::AnnounceServerData newAnnounceData,
326 ::PortPair newPorts
327 );
328
329 MCAPI ::std::string _getHostGuid(::std::string const& address, int port);
330
331 MCAPI void _getServerOriginalAddress(::std::string& originalAddressToSet, ::std::string const& ip);
332
333 MCAPI bool _handleUnconnectedPong(
334 ::std::string const& data,
335 ::RakNet::Packet const* p,
336 bool readTime,
337 uint64 insertAtBeginning
338 );
339
340 MCAPI void _initializeBroadcastAddresses();
341
342 MCAPI void _onPingSend(::std::string const& guid, ::std::string const& ipVersion, int addr);
343
344 MCAPI bool
345 _onPongReceive(float& latencyToSet, ::RakNet::RakNetGUID const& guid, uint const& receivedTime, int ipVersion);
346
347 MCAPI void _setPingResponder(::RakNetServerLocator::AnnounceServerData const& serverData);
348
349 MCAPI void _startAnnouncingServer(::RakNetServerLocator::AnnounceServerData const& announceData);
350
351 MCAPI void _startServerDiscovery(::PortPair const& ports);
352
353 MCAPI void _stopAnnouncingServer();
354
355 MCAPI void _stopServerDiscovery();
356
357 MCAPI void _updateNetwork();
358
359 MCAPI bool _updateQueuedPings();
360
361 MCAPI void _updateState();
362 // NOLINTEND
363
364public:
365 // static functions
366 // NOLINTBEGIN
367 MCAPI static bool
368 parseUnconnectedPongPacketData(::std::string const& data, ::std::vector<::std::string>& extraData);
369 // NOLINTEND
370
371public:
372 // constructor thunks
373 // NOLINTBEGIN
374 MCAPI 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 MCAPI void $dtor();
392 // NOLINTEND
393
394public:
395 // virtual function thunks
396 // NOLINTBEGIN
397 MCAPI void $startAnnouncingServer(
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 MCAPI void $stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform> appPlatform);
410
411 MCAPI void $startServerDiscovery(::PortPair ports);
412
413 MCAPI void $stopServerDiscovery();
414
415 MCAPI void $addCustomServer(::AsynchronousIPResolver const& futureIP, int port);
416
417 MCAPI void $addCustomServer(::std::string const& address, int port);
418
419 MCAPI ::std::vector<::PingedCompatibleServer> $getServerList() const;
420
421 MCAPI void $clearServerList();
422
423 MCAPI void $update();
424
425 MCAPI float $getPingTimeForGUID(::std::string const& guid);
426
427 MCAPI void $checkCanConnectToCustomServerAsync(
428 ::std::string hostIpAddress,
429 int port,
430 ::std::function<void(::ServerConnectivityTestResult)> callback
431 );
432
433 MCAPI void $_onDisable();
434
435 MCAPI void $_onEnable();
436 // NOLINTEND
437
438public:
439 // vftables
440 // NOLINTBEGIN
441 MCAPI static void** $vftable();
442 // NOLINTEND
443};
Definition AppPlatform.h:49
Definition AsynchronousIPResolver.h:5
Definition NonOwnerPointer.h:9
Definition Packet.h:26
Definition RakNetConnector.h:30
Definition RakNetServerLocator.h:68
Definition RakNetServerLocator.h:46
Definition RakNetServerLocator.h:29
Definition RakPeerHelper.h:15
Definition ServerLocator.h:19
STL namespace.
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition RakNetServerLocator.h:82
Definition RakNetServerLocator.h:145
Definition RakNetServerLocator.h:173
Definition Alias.h:14