LeviLamina
Loading...
Searching...
No Matches
NetherNetConnector.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/nether_net/ESessionError.h"
7#include "mc/deps/nether_net/INetherNetTransportInterfaceCallbacks.h"
8#include "mc/deps/nether_net/NetworkID.h"
9#include "mc/network/Connector.h"
10#include "mc/network/RemoteConnector.h"
11#include "mc/network/TransportLayer.h"
12#include "mc/platform/threading/Mutex.h"
13#include "mc/platform/threading/UniqueLock.h"
14
15// auto generated forward declare list
16// clang-format off
21namespace Bedrock::Http { class LibHttpClientInstance; }
22namespace Json { class Value; }
23namespace NetherNet { class INetherNetTransportInterface; }
24namespace Social { class GameConnectionInfo; }
25// clang-format on
26
28public:
29 // NetherNetConnector inner types declare
30 // clang-format off
31 struct DisconnectEvent;
34 // clang-format on
35
36 // NetherNetConnector inner types define
37 using BroadcastRequestCallback = ::std::function<bool(void*, int*)>;
38
39 using BroadcastResponseCallback = ::std::function<void(::NetherNet::NetworkID const&, void const*, int)>;
40
42
44 public:
45 // member variables
46 // NOLINTBEGIN
48 // NOLINTEND
49
50 public:
51 // prevent constructor by default
55
56 public:
57 // member functions
58 // NOLINTBEGIN
60 // NOLINTEND
61
62 public:
63 // destructor thunk
64 // NOLINTBEGIN
65 MCNAPI void $dtor();
66 // NOLINTEND
67 };
68
70 public:
71 // member variables
72 // NOLINTBEGIN
74 // NOLINTEND
75
76 public:
77 // prevent constructor by default
81 };
82
84 public:
85 // member variables
86 // NOLINTBEGIN
91 // NOLINTEND
92
93 public:
94 // prevent constructor by default
95 DisconnectEvent& operator=(DisconnectEvent const&);
98
99 public:
100 // member functions
101 // NOLINTBEGIN
103 // NOLINTEND
104
105 public:
106 // destructor thunk
107 // NOLINTBEGIN
108 MCNAPI void $dtor();
109 // NOLINTEND
110 };
111
112 using Event = ::std::variant<
116
117public:
118 // member variables
119 // NOLINTBEGIN
120 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Http::LibHttpClientInstance> const> mHttpLibrary;
121 ::ll::TypedStorage<8, 24, ::NetherNet::NetworkID const> mNetworkID;
122 ::ll::TypedStorage<
123 8,
124 72,
125 ::std::unique_ptr<
127 ::std::function<void(::NetherNet::INetherNetTransportInterface*)>>>
128 mTransport;
129 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mBroadcastCallbackMutex;
130 ::ll::TypedStorage<8, 64, ::std::function<bool(void*, int*)>> mBroadcastRequestCallback;
131 ::ll::TypedStorage<8, 64, ::std::function<void(::NetherNet::NetworkID const&, void const*, int)>>
132 mBroadcastResponseCallback;
133 ::ll::TypedStorage<8, 80, ::std::recursive_mutex> mEventsMutex;
134 ::ll::TypedStorage<
135 8,
136 8,
137 ::std::unique_ptr<::std::vector<::std::variant<
141 mEvents;
142 ::ll::TypedStorage<8, 24, ::std::vector<::std::weak_ptr<::WebRTCNetworkPeer>>> mPeers;
143 // NOLINTEND
144
145public:
146 // prevent constructor by default
148
149public:
150 // virtual functions
151 // NOLINTBEGIN
152 // vIndex: 0
153 virtual ~NetherNetConnector() /*override*/;
154
155 // vIndex: 18
156 virtual void setDisableLanSignaling(bool disableLanSignaling) /*override*/;
157
158 // vIndex: 9
159 virtual bool host(::ConnectionDefinition const& definition) /*override*/;
160
161 // vIndex: 10
162 virtual bool connect(::Social::GameConnectionInfo const&, ::Social::GameConnectionInfo const&) /*override*/;
163
164 // vIndex: 12
165 virtual void tick() /*override*/;
166
167 // vIndex: 13
168 virtual void runEvents() /*override*/;
169
170 // vIndex: 16
171 virtual ::NetworkIdentifier getNetworkIdentifier() const /*override*/;
172
173 // vIndex: 15
174 virtual void closeNetworkConnection(::NetworkIdentifier const&) /*override*/;
175
176 // vIndex: 17
177 virtual bool setApplicationHandshakeCompleted(::NetworkIdentifier const&) /*override*/;
178
179 // vIndex: 8
180 virtual ::TransportLayer getNetworkType() const /*override*/;
181
182 // vIndex: 1
183 virtual void _onDisable() /*override*/;
184
185 // vIndex: 2
186 virtual void _onEnable() /*override*/;
187
188 // vIndex: 5
189 virtual void OnSpopViolation() /*override*/;
190
191 // vIndex: 4
192 virtual void OnSessionClose(
193 ::NetherNet::NetworkID networkID,
194 uint64 sessionId,
195 ::NetherNet::ESessionError sessionError,
196 ::Json::Value summary
197 ) /*override*/;
198
199 // vIndex: 6
200 virtual void
201 OnBroadcastResponseReceived(::NetherNet::NetworkID networkID, void const* pApplicationData, int size) /*override*/;
202
203 // vIndex: 7
204 virtual bool OnBroadcastDiscoveryRequestReceivedGetResponse(void* pApplicationData, int* pSize) /*override*/;
205
206 // vIndex: 1
207 virtual void OnSessionGetConnectionFlags(::NetherNet::NetworkID, uint* flags) /*override*/;
208 // NOLINTEND
209
210public:
211 // member functions
212 // NOLINTBEGIN
213 MCAPI NetherNetConnector(
214 ::NetherNetTransportFactory const& factory,
215 ::Connector::ConnectionCallbacks& callbacks,
216 ::std::optional<::NetherNet::NetworkID> networkId
217 );
218
219 MCAPI ::gsl::not_null<::std::shared_ptr<::WebRTCNetworkPeer>> _getOrCreatePeer(
220 ::NetherNet::NetworkID const& remoteId,
221 uint64 sessionId,
222 ::Bedrock::Threading::UniqueLock<::std::recursive_mutex> const&
223 );
224
225 MCAPI void _prepareForNewSession();
226
227 MCAPI void _queueIncomingConnectionEvent(::NetherNet::NetworkID peerId, uint64 sessionId);
228 // NOLINTEND
229
230public:
231 // constructor thunks
232 // NOLINTBEGIN
233 MCAPI void* $ctor(
234 ::NetherNetTransportFactory const& factory,
235 ::Connector::ConnectionCallbacks& callbacks,
236 ::std::optional<::NetherNet::NetworkID> networkId
237 );
238 // NOLINTEND
239
240public:
241 // destructor thunk
242 // NOLINTBEGIN
243 MCAPI void $dtor();
244 // NOLINTEND
245
246public:
247 // virtual function thunks
248 // NOLINTBEGIN
249 MCAPI void $setDisableLanSignaling(bool disableLanSignaling);
250
251 MCFOLD bool $host(::ConnectionDefinition const& definition);
252
253 MCFOLD bool $connect(::Social::GameConnectionInfo const&, ::Social::GameConnectionInfo const&);
254
255 MCFOLD void $tick();
256
257 MCAPI void $runEvents();
258
259 MCAPI ::NetworkIdentifier $getNetworkIdentifier() const;
260
261 MCFOLD void $closeNetworkConnection(::NetworkIdentifier const&);
262
263 MCFOLD bool $setApplicationHandshakeCompleted(::NetworkIdentifier const&);
264
265 MCFOLD void $_onDisable();
266
267 MCFOLD void $_onEnable();
268
269 MCFOLD void $OnSpopViolation();
270
271 MCAPI void $OnSessionClose(
272 ::NetherNet::NetworkID networkID,
273 uint64 sessionId,
274 ::NetherNet::ESessionError sessionError,
275 ::Json::Value summary
276 );
277
278 MCAPI void $OnBroadcastResponseReceived(::NetherNet::NetworkID networkID, void const* pApplicationData, int size);
279
280 MCAPI bool $OnBroadcastDiscoveryRequestReceivedGetResponse(void* pApplicationData, int* pSize);
281
282 MCAPI void $OnSessionGetConnectionFlags(::NetherNet::NetworkID, uint* flags);
283 // NOLINTEND
284
285public:
286 // vftables
287 // NOLINTBEGIN
289
291
292 MCNAPI static void** $vftable();
293
294 MCNAPI static void** $vftableForConnector();
295 // NOLINTEND
296};
Definition UniqueLock.h:8
Definition Connector.h:17
Definition NetherNetTransportFactory.h:17
Definition INetherNetTransportInterfaceCallbacks.h:16
Definition INetherNetTransportInterface.h:21
Definition NetworkIdentifier.h:10
Definition RemoteConnector.h:19
Definition GameConnectionInfo.h:7
Definition WebRTCNetworkPeer.h:16
STL namespace.
Definition ConnectionDefinition.h:5
Definition Connector.h:25
Definition NetherNetConnector.h:83
Definition NetherNetConnector.h:43
Definition NetherNetConnector.h:69
Definition NetherNetConnector.h:27
static MCAPI void ** $vftableForConnector()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForNetworkEnableDisableListener()
static MCAPI void ** $vftable()
Definition NetworkID.h:17
Definition Alias.h:14