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 NetherNet { class INetherNetTransportInterface; }
23namespace Social { class GameConnectionInfo; }
24// clang-format on
25
27public:
28 // NetherNetConnector inner types declare
29 // clang-format off
30 struct DisconnectEvent;
33 // clang-format on
34
35 // NetherNetConnector inner types define
36 using BroadcastRequestCallback = ::std::function<bool(void*, int*)>;
37
38 using BroadcastResponseCallback = ::std::function<void(::NetherNet::NetworkID const&, void const*, int)>;
39
41
43 public:
44 // member variables
45 // NOLINTBEGIN
47 // NOLINTEND
48
49 public:
50 // prevent constructor by default
54
55 public:
56 // member functions
57 // NOLINTBEGIN
59 // NOLINTEND
60
61 public:
62 // destructor thunk
63 // NOLINTBEGIN
64 MCNAPI void $dtor();
65 // NOLINTEND
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
89 // NOLINTEND
90
91 public:
92 // prevent constructor by default
93 DisconnectEvent& operator=(DisconnectEvent const&);
96 };
97
98 using Event = ::std::variant<
102
103public:
104 // member variables
105 // NOLINTBEGIN
106 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Bedrock::Http::LibHttpClientInstance> const> mHttpLibrary;
107 ::ll::TypedStorage<8, 24, ::NetherNet::NetworkID const> mNetworkID;
108 ::ll::TypedStorage<
109 8,
110 72,
111 ::std::unique_ptr<
113 ::std::function<void(::NetherNet::INetherNetTransportInterface*)>>>
114 mTransport;
115 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mBroadcastCallbackMutex;
116 ::ll::TypedStorage<8, 64, ::std::function<bool(void*, int*)>> mBroadcastRequestCallback;
117 ::ll::TypedStorage<8, 64, ::std::function<void(::NetherNet::NetworkID const&, void const*, int)>>
118 mBroadcastResponseCallback;
119 ::ll::TypedStorage<8, 80, ::std::recursive_mutex> mEventsMutex;
120 ::ll::TypedStorage<
121 8,
122 8,
123 ::std::unique_ptr<::std::vector<::std::variant<
127 mEvents;
128 ::ll::TypedStorage<8, 24, ::std::vector<::std::weak_ptr<::WebRTCNetworkPeer>>> mPeers;
129 // NOLINTEND
130
131public:
132 // prevent constructor by default
134
135public:
136 // virtual functions
137 // NOLINTBEGIN
138 // vIndex: 0
139 virtual ~NetherNetConnector() /*override*/;
140
141 // vIndex: 18
142 virtual void setDisableLanSignaling(bool disableLanSignaling) /*override*/;
143
144 // vIndex: 19
145 virtual void setInactivityTimeout(
146 ::NetworkIdentifier const& id,
147 ::std::optional<::std::chrono::seconds> inactivityTimeout
148 ) /*override*/;
149
150 // vIndex: 9
151 virtual bool host(::ConnectionDefinition const& definition) /*override*/;
152
153 // vIndex: 10
154 virtual bool connect(::Social::GameConnectionInfo const&, ::Social::GameConnectionInfo const&) /*override*/;
155
156 // vIndex: 12
157 virtual void tick() /*override*/;
158
159 // vIndex: 13
160 virtual void runEvents() /*override*/;
161
162 // vIndex: 16
163 virtual ::NetworkIdentifier getNetworkIdentifier() const /*override*/;
164
165 // vIndex: 15
166 virtual void closeNetworkConnection(::NetworkIdentifier const&) /*override*/;
167
168 // vIndex: 17
169 virtual bool setApplicationHandshakeCompleted(::NetworkIdentifier const&) /*override*/;
170
171 // vIndex: 8
172 virtual ::TransportLayer getNetworkType() const /*override*/;
173
174 // vIndex: 1
175 virtual void _onDisable() /*override*/;
176
177 // vIndex: 2
178 virtual void _onEnable() /*override*/;
179
180 // vIndex: 5
181 virtual void OnSpopViolation() /*override*/;
182
183 // vIndex: 4
184 virtual void OnSessionClose(
185 ::NetherNet::NetworkID networkID,
186 uint64 sessionId,
187 ::NetherNet::ESessionError sessionError
188 ) /*override*/;
189
190 // vIndex: 6
191 virtual void
192 OnBroadcastResponseReceived(::NetherNet::NetworkID networkID, void const* pApplicationData, int size) /*override*/;
193
194 // vIndex: 7
195 virtual bool OnBroadcastDiscoveryRequestReceivedGetResponse(void* pApplicationData, int* pSize) /*override*/;
196
197 // vIndex: 1
198 virtual void OnSessionGetConnectionFlags(::NetherNet::NetworkID, uint* flags) /*override*/;
199 // NOLINTEND
200
201public:
202 // member functions
203 // NOLINTBEGIN
204 MCAPI NetherNetConnector(
205 ::NetherNetTransportFactory const& factory,
206 ::Connector::ConnectionCallbacks& callbacks,
207 ::std::optional<::NetherNet::NetworkID> networkId
208 );
209
210 MCAPI ::gsl::not_null<::std::shared_ptr<::WebRTCNetworkPeer>> _getOrCreatePeer(
211 ::NetherNet::NetworkID const& remoteId,
212 uint64 sessionId,
213 ::Bedrock::Threading::UniqueLock<::std::recursive_mutex> const&
214 );
215
216 MCAPI void _prepareForNewSession();
217
218 MCAPI void _queueIncomingConnectionEvent(::NetherNet::NetworkID peerId, uint64 sessionId);
219 // NOLINTEND
220
221public:
222 // constructor thunks
223 // NOLINTBEGIN
224 MCAPI void* $ctor(
225 ::NetherNetTransportFactory const& factory,
226 ::Connector::ConnectionCallbacks& callbacks,
227 ::std::optional<::NetherNet::NetworkID> networkId
228 );
229 // NOLINTEND
230
231public:
232 // destructor thunk
233 // NOLINTBEGIN
234 MCAPI void $dtor();
235 // NOLINTEND
236
237public:
238 // virtual function thunks
239 // NOLINTBEGIN
240 MCAPI void $setDisableLanSignaling(bool disableLanSignaling);
241
242 MCAPI void
243 $setInactivityTimeout(::NetworkIdentifier const& id, ::std::optional<::std::chrono::seconds> inactivityTimeout);
244
245 MCFOLD bool $host(::ConnectionDefinition const& definition);
246
247 MCFOLD bool $connect(::Social::GameConnectionInfo const&, ::Social::GameConnectionInfo const&);
248
249 MCFOLD void $tick();
250
251 MCAPI void $runEvents();
252
253 MCAPI ::NetworkIdentifier $getNetworkIdentifier() const;
254
255 MCFOLD void $closeNetworkConnection(::NetworkIdentifier const&);
256
257 MCFOLD bool $setApplicationHandshakeCompleted(::NetworkIdentifier const&);
258
259 MCFOLD ::TransportLayer $getNetworkType() const;
260
261 MCFOLD void $_onDisable();
262
263 MCFOLD void $_onEnable();
264
265 MCFOLD void $OnSpopViolation();
266
267 MCAPI void
268 $OnSessionClose(::NetherNet::NetworkID networkID, uint64 sessionId, ::NetherNet::ESessionError sessionError);
269
270 MCAPI void $OnBroadcastResponseReceived(::NetherNet::NetworkID networkID, void const* pApplicationData, int size);
271
272 MCAPI bool $OnBroadcastDiscoveryRequestReceivedGetResponse(void* pApplicationData, int* pSize);
273
274 MCAPI void $OnSessionGetConnectionFlags(::NetherNet::NetworkID, uint* flags);
275 // NOLINTEND
276
277public:
278 // vftables
279 // NOLINTBEGIN
281
283
284 MCNAPI static void** $vftable();
285
286 MCNAPI static void** $vftableForConnector();
287 // NOLINTEND
288};
Definition UniqueLock.h:8
Definition Connector.h:16
Definition NetherNetTransportFactory.h:17
Definition INetherNetTransportInterfaceCallbacks.h:15
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:24
Definition NetherNetConnector.h:82
Definition NetherNetConnector.h:42
Definition NetherNetConnector.h:68
Definition NetherNetConnector.h:26
static MCAPI void ** $vftableForConnector()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForNetworkEnableDisableListener()
static MCAPI void ** $vftable()
Definition NetworkID.h:21
Definition Alias.h:14