LeviLamina
Loading...
Searching...
No Matches
RakNetConnector.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/network/NetworkIdentifier.h"
5
6// auto generated inclusion list
7#include "mc/deps/core/threading/MPMCQueue.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/network/Compressibility.h"
10#include "mc/network/Connector.h"
11#include "mc/network/NetworkPeer.h"
12#include "mc/network/RakPeerHelper.h"
13#include "mc/network/RemoteConnector.h"
14#include "mc/network/TransportLayer.h"
15#include "mc/network/connection/DisconnectFailReason.h"
16
17// auto generated forward declare list
18// clang-format off
19class AppPlatform;
21class RakPeerHelper;
23namespace RakNet { class RakPeerInterface; }
24namespace RakNet { struct RakNetStatistics; }
25namespace RakNet { struct RakPeerConfiguration; }
26namespace RakNet { struct SystemAddress; }
27namespace Social { class GameConnectionInfo; }
28// clang-format on
29
31public:
32 // RakNetConnector inner types declare
33 // clang-format off
35 struct PingCallbackData;
37 // clang-format on
38
39 // RakNetConnector inner types define
41 public:
42 // virtual functions
43 // NOLINTBEGIN
44 // vIndex: 0
45 virtual ~ConnectionCallbacks() /*override*/ = default;
46
47 // vIndex: 4
48 virtual void onAllConnectionsClosed(::Connection::DisconnectFailReason, ::std::string const&, bool) = 0;
49
50 // vIndex: 5
51 virtual void onAllRemoteConnectionsClosed(::Connection::DisconnectFailReason, ::std::string const&, bool) = 0;
52
53 // vIndex: 6
54 virtual void onOutgoingConnectionFailed(::Connection::DisconnectFailReason, ::std::string const&) = 0;
55
56 // vIndex: 7
57 virtual void onWebsocketRequest(::std::string const&, ::std::string const&, ::std::function<void()>) = 0;
58 // NOLINTEND
59
60 public:
61 // destructor thunk
62 // NOLINTBEGIN
63
64 // NOLINTEND
65
66 public:
67 // virtual function thunks
68 // NOLINTBEGIN
69
70 // NOLINTEND
71
72 public:
73 // vftables
74 // NOLINTBEGIN
75 MCAPI static void** $vftable();
76 // NOLINTEND
77 };
78
80 public:
81 // RakNetNetworkPeer inner types declare
82 // clang-format off
83 struct ReadBufferData;
84 // clang-format on
85
86 // RakNetNetworkPeer inner types define
88 public:
89 // member variables
90 // NOLINTBEGIN
91 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mTimepoint;
92 ::ll::TypedStorage<8, 32, ::std::string> mReadBuffer;
93 // NOLINTEND
94
95 public:
96 // member functions
97 // NOLINTBEGIN
98 MCAPI ~ReadBufferData();
99 // NOLINTEND
100
101 public:
102 // destructor thunk
103 // NOLINTBEGIN
104 MCFOLD void $dtor();
105 // NOLINTEND
106 };
107
108 public:
109 // member variables
110 // NOLINTBEGIN
113 ::std::string mSendBuffer;
114 ::std::vector<ReadBufferData> mReadBufferDatas;
115 int mApproximateMaxBps;
116 int mLastPing;
117 int mAveragePing;
118 // NOLINTEND
119
120 public:
121 // virtual functions
122 // NOLINTBEGIN
123 // vIndex: 1
124 virtual void
125 sendPacket(::std::string const& data, ::NetworkPeer::Reliability reliability, ::Compressibility) /*override*/;
126
127 // vIndex: 2
128 virtual ::NetworkPeer::DataStatus receivePacket(
129 ::std::string& outData,
130 ::std::shared_ptr<::std::chrono::steady_clock::time_point> const& timepointPtr
131 ) /*override*/;
132
133 // vIndex: 3
134 virtual ::NetworkPeer::NetworkStatus getNetworkStatus() const /*override*/;
135
136 // vIndex: 4
137 virtual void update() /*override*/;
138
139 // vIndex: 6
140 virtual bool isLocal() const /*override*/;
141
142 // vIndex: 7
143 virtual bool isEncrypted() const /*override*/;
144
145 // vIndex: 0
146 virtual ~RakNetNetworkPeer() /*override*/ = default;
147 // NOLINTEND
148
149 public:
150 // member functions
151 // NOLINTBEGIN
152 MCAPI RakNetNetworkPeer(::RakNet::RakPeerInterface& rakPeer, ::NetworkIdentifier const& id);
153
154 MCAPI void newData(::std::string data);
155 // NOLINTEND
156
157 public:
158 // constructor thunks
159 // NOLINTBEGIN
160 MCAPI void* $ctor(::RakNet::RakPeerInterface& rakPeer, ::NetworkIdentifier const& id);
161 // NOLINTEND
162
163 public:
164 // destructor thunk
165 // NOLINTBEGIN
166
167 // NOLINTEND
168
169 public:
170 // virtual function thunks
171 // NOLINTBEGIN
172 MCAPI void $sendPacket(::std::string const& data, ::NetworkPeer::Reliability reliability, ::Compressibility);
173
174 MCAPI ::NetworkPeer::DataStatus $receivePacket(
175 ::std::string& outData,
176 ::std::shared_ptr<::std::chrono::steady_clock::time_point> const& timepointPtr
177 );
178
179 MCAPI ::NetworkPeer::NetworkStatus $getNetworkStatus() const;
180
181 MCAPI void $update();
182
183 MCFOLD bool $isLocal() const;
184
185 MCFOLD bool $isEncrypted() const;
186 // NOLINTEND
187
188 public:
189 // vftables
190 // NOLINTBEGIN
191 MCAPI static void** $vftable();
192 // NOLINTEND
193 };
194
196 public:
197 // member variables
198 // NOLINTBEGIN
199 ::ll::TypedStorage<8, 32, ::std::string> mAddress;
200 ::ll::TypedStorage<8, 64, ::std::function<void(uint)>> mAction;
201 // NOLINTEND
202 };
203
204public:
205 // member variables
206 // NOLINTBEGIN
207 ::ll::TypedStorage<8, 160, ::NetworkIdentifier> mNATPunchServerId;
208 ::ll::TypedStorage<8, 416, ::Social::GameConnectionInfo> mBackupGameConnection;
209 ::ll::TypedStorage<1, 1, bool> mTryBackupConnection;
210 ::ll::TypedStorage<8, 16, ::std::unique_ptr<::RakNet::RakPeerInterface, void (*)(::RakNet::RakPeerInterface*)>>
211 mRakPeer;
212 ::ll::TypedStorage<8, 160, ::NetworkIdentifier> mServerId;
213 ::ll::TypedStorage<8, 24, ::RakPeerHelper> mPeerHelper;
214 ::ll::TypedStorage<8, 8, ::RakPeerHelper::IPSupportInterface&> mIPSupportInterface;
215 ::ll::TypedStorage<1, 1, bool> mIsAwaitingNatClient;
216 ::ll::TypedStorage<1, 1, bool> mIsServer;
217 ::ll::TypedStorage<1, 1, bool> mIsDisconnecting;
218 ::ll::TypedStorage<1, 1, bool> mConnectingToClient;
219 ::ll::TypedStorage<8, 416, ::Social::GameConnectionInfo> mConnectedGameInfo;
220 ::ll::TypedStorage<
221 8,
222 64,
223 ::std::unordered_map<::NetworkIdentifier, ::std::weak_ptr<::RakNetConnector::RakNetNetworkPeer>>>
224 mPeers;
225 ::ll::TypedStorage<1, 1, bool> mWasHostWhenSuspended;
226 ::ll::TypedStorage<4, 20, ::ConnectionDefinition> mPreviousConnectionDefinition;
227 ::ll::TypedStorage<8, 32, ::std::string> mResolvedIP;
228 ::ll::TypedStorage<8, 24, ::std::vector<::RakNetConnector::PingCallbackData>> mPingTimeCallbacks;
229 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MPMCQueue<::std::function<void()>>>> mOwnedThreadWork;
230 // NOLINTEND
231
232public:
233 // virtual functions
234 // NOLINTBEGIN
235 // vIndex: 0
236 virtual ~RakNetConnector() /*override*/;
237
238 // vIndex: 9
239 virtual bool host(::ConnectionDefinition const& definition) /*override*/;
240
241 // vIndex: 10
242 virtual bool connect(
243 ::Social::GameConnectionInfo const& primaryConnection,
244 ::Social::GameConnectionInfo const& backupConnection
245 ) /*override*/;
246
247 // vIndex: 11
248 virtual void disconnect() /*override*/;
249
250 // vIndex: 12
251 virtual void tick() /*override*/;
252
253 // vIndex: 13
254 virtual void runEvents() /*override*/;
255
256 // vIndex: 15
257 virtual void closeNetworkConnection(::NetworkIdentifier const& id) /*override*/;
258
259 // vIndex: 17
260 virtual bool setApplicationHandshakeCompleted(::NetworkIdentifier const& id) /*override*/;
261
262 // vIndex: 14
263 virtual bool isServer() const /*override*/;
264
265 // vIndex: 1
266 virtual ::std::string getLocalIp() /*override*/;
267
268 // vIndex: 2
269 virtual ushort getPort() const /*override*/;
270
271 // vIndex: 3
272 virtual ::Social::GameConnectionInfo const& getConnectedGameInfo() const /*override*/;
273
274 // vIndex: 4
275 virtual bool isIPv4Supported() const /*override*/;
276
277 // vIndex: 5
278 virtual bool isIPv6Supported() const /*override*/;
279
280 // vIndex: 6
281 virtual ushort getIPv4Port() const /*override*/;
282
283 // vIndex: 7
284 virtual ushort getIPv6Port() const /*override*/;
285
286 // vIndex: 16
287 virtual ::NetworkIdentifier getNetworkIdentifier() const /*override*/;
288
289 // vIndex: 19
290 virtual ::RakNet::RakPeerInterface* getPeer();
291
292 // vIndex: 18
293 virtual ::RakNet::RakPeerInterface const* getPeer() const;
294
295 // vIndex: 8
296 virtual ::TransportLayer getNetworkType() const /*override*/;
297
298 // vIndex: 1
299 virtual void _onDisable() /*override*/;
300
301 // vIndex: 2
302 virtual void _onEnable() /*override*/;
303 // NOLINTEND
304
305public:
306 // member functions
307 // NOLINTBEGIN
308 MCAPI RakNetConnector(
310 ::RakPeerHelper::IPSupportInterface& ipInterface,
311 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
312 ::RakNet::RakPeerConfiguration const& rakPeerConfig
313 );
314
315 MCAPI ::std::vector<::std::string> _getLocalIps() const;
316
317 MCAPI ::std::vector<::RakNet::SystemAddress> _getRefinedLocalIps() const;
318
319 MCAPI void _storeLocalIP();
320
321 MCAPI bool getStatistics(::RakNet::RakNetStatistics& rns);
322 // NOLINTEND
323
324public:
325 // constructor thunks
326 // NOLINTBEGIN
327 MCAPI void* $ctor(
329 ::RakPeerHelper::IPSupportInterface& ipInterface,
330 ::Bedrock::NonOwnerPointer<::AppPlatform> const& appPlatform,
331 ::RakNet::RakPeerConfiguration const& rakPeerConfig
332 );
333 // NOLINTEND
334
335public:
336 // destructor thunk
337 // NOLINTBEGIN
338 MCAPI void $dtor();
339 // NOLINTEND
340
341public:
342 // virtual function thunks
343 // NOLINTBEGIN
344 MCAPI bool $host(::ConnectionDefinition const& definition);
345
346 MCAPI bool $connect(
347 ::Social::GameConnectionInfo const& primaryConnection,
348 ::Social::GameConnectionInfo const& backupConnection
349 );
350
351 MCAPI void $disconnect();
352
353 MCAPI void $tick();
354
355 MCAPI void $runEvents();
356
357 MCAPI void $closeNetworkConnection(::NetworkIdentifier const& id);
358
359 MCAPI bool $setApplicationHandshakeCompleted(::NetworkIdentifier const& id);
360
361 MCAPI bool $isServer() const;
362
363 MCAPI ::std::string $getLocalIp();
364
365 MCAPI ushort $getPort() const;
366
367 MCFOLD ::Social::GameConnectionInfo const& $getConnectedGameInfo() const;
368
369 MCAPI bool $isIPv4Supported() const;
370
371 MCAPI bool $isIPv6Supported() const;
372
373 MCAPI ushort $getIPv4Port() const;
374
375 MCAPI ushort $getIPv6Port() const;
376
377 MCAPI ::NetworkIdentifier $getNetworkIdentifier() const;
378
379 MCFOLD ::RakNet::RakPeerInterface* $getPeer();
380
381 MCFOLD ::RakNet::RakPeerInterface const* $getPeer() const;
382
383 MCFOLD ::TransportLayer $getNetworkType() const;
384
385 MCAPI void $_onDisable();
386
387 MCAPI void $_onEnable();
388 // NOLINTEND
389
390public:
391 // vftables
392 // NOLINTBEGIN
393 MCAPI static void** $vftableForConnector();
394
395 MCAPI static void** $vftableForNetworkEnableDisableListener();
396
397 MCAPI static void** $vftableForEnableNonOwnerReferences();
398 // NOLINTEND
399};
Definition AppPlatform.h:49
Definition MPMCQueue.h:6
Definition NetworkIdentifier.h:11
Definition NetworkPeer.h:8
Definition RakNetConnector.h:79
Definition RakNetConnector.h:30
Definition RakPeerInterface.h:32
Definition RakPeerHelper.h:15
Definition RemoteConnector.h:19
Definition GameConnectionInfo.h:7
STL namespace.
Definition ConnectionDefinition.h:5
Definition Connector.h:24
Definition NetworkPeer.h:40
Definition RakNetConnector.h:40
Definition RakNetConnector.h:195