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