LeviLamina
Loading...
Searching...
No Matches
SimpleNetworkInterfaceImpl.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/nether_net/ContextProxy.h"
7#include "mc/deps/nether_net/ESendType.h"
8#include "mc/deps/nether_net/ESessionError.h"
9#include "mc/deps/nether_net/ILanEventHandler.h"
10#include "mc/deps/nether_net/INetherNetTransportInterface.h"
11#include "mc/deps/nether_net/ISignalingEventHandler.h"
12#include "mc/deps/nether_net/SignalingChannelId.h"
13#include "mc/deps/nether_net/utils/ErrorOr.h"
14#include "mc/external/webrtc/PeerConnectionInterface.h"
15
16// auto generated forward declare list
17// clang-format off
18namespace Bedrock::PubSub { class Subscription; }
19namespace NetherNet { class CandidateAdd; }
20namespace NetherNet { class ConnectError; }
21namespace NetherNet { class ConnectRequest; }
22namespace NetherNet { class ConnectResponse; }
23namespace NetherNet { class INetherNetTransportInterfaceCallbacks; }
24namespace NetherNet { class ISignalingInterface; }
25namespace NetherNet { struct NetherNetTransportServerConfiguration; }
26namespace NetherNet { struct NetworkID; }
27namespace NetherNet { struct SessionState; }
28namespace NetherNet { struct StunRelayServer; }
29namespace NetherNet::LanEvents { struct DiscoveryRequest; }
30namespace NetherNet::LanEvents { struct DiscoveryResponse; }
31namespace NetherNet::LanEvents { struct MessageReceived; }
32namespace NetherNet::SignalingEvents { struct MessageReceived; }
33// clang-format on
34
35namespace NetherNet {
36
41public:
42 // member variables
43 // NOLINTBEGIN
56 // NOLINTEND
57
58public:
59 // prevent constructor by default
63
64public:
65 // virtual functions
66 // NOLINTBEGIN
67 // vIndex: 0
68 virtual ~SimpleNetworkInterfaceImpl() /*override*/;
69
70 // vIndex: 1
71 virtual bool SendPacket(
73 uint64 connectionId,
74 ::std::string const& data,
75 ::NetherNet::ESendType eSendType
76 ) /*override*/;
77
78 // vIndex: 2
79 virtual bool
80 IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint* pcbMessageSize) /*override*/;
81
82 // vIndex: 3
83 virtual void ClearPacketData(::NetherNet::NetworkID remoteId, uint64 connectionId) /*override*/;
84
85 // vIndex: 4
86 virtual bool ReadPacket(
88 uint64 connectionId,
89 void* pubDest,
90 uint cbDest,
91 uint* pcbMessageSize
92 ) /*override*/;
93
94 // vIndex: 5
95 virtual bool OpenSessionWithUser(::NetherNet::NetworkID networkIDRemote) /*override*/;
96
97 // vIndex: 6
98 virtual bool CloseSessionWithUser(::NetherNet::NetworkID networkIDRemote, uint64 connectionId) /*override*/;
99
100 // vIndex: 7
101 virtual bool GetSessionState(
103 uint64 connectionId,
104 ::NetherNet::SessionState* pConnectionState
105 ) /*override*/;
106
107 // vIndex: 8
108 virtual void
109 SetSignalingInterface(::std::shared_ptr<::NetherNet::ISignalingInterface> const& pWebRTCSignalingInterface
110 ) /*override*/;
111
112 // vIndex: 9
113 virtual void SetRelayConfig(::std::vector<::NetherNet::StunRelayServer> const& config) /*override*/;
114
115 // vIndex: 14
116 virtual ::Bedrock::PubSub::Subscription RegisterEventHandler(::NetherNet::ISignalingEventHandler* handler
117 ) /*override*/;
118
119 // vIndex: 13
120 virtual ::Bedrock::PubSub::Subscription RegisterEventHandler(::NetherNet::ILanEventHandler* handler) /*override*/;
121
122 // vIndex: 10
123 virtual bool IsBroadcastDiscoveryEnabled() /*override*/;
124
125 // vIndex: 11
126 virtual void EnableBroadcastDiscovery() /*override*/;
127
128 // vIndex: 12
129 virtual void DisableBroadcastDiscovery() /*override*/;
130
131 // vIndex: 1
132 virtual void OnSignalingEvent(::NetherNet::SignalingEvents::MessageReceived const& event) /*override*/;
133
134 // vIndex: 3
135 virtual void OnLanEvent(::NetherNet::LanEvents::MessageReceived const& event) /*override*/;
136
137 // vIndex: 2
138 virtual void OnLanEvent(::NetherNet::LanEvents::DiscoveryRequest const& event) /*override*/;
139
140 // vIndex: 1
141 virtual void OnLanEvent(::NetherNet::LanEvents::DiscoveryResponse const& event) /*override*/;
142 // NOLINTEND
143
144public:
145 // member functions
146 // NOLINTBEGIN
147 MCAPI void Initialize(::NetherNet::INetherNetTransportInterfaceCallbacks* pCallbacks);
148
149 MCAPI void InitializeConfiguration(
152 );
153
154 MCAPI void ReceiveFromSignalingChannel(
156 ::std::string const& message,
157 ::NetherNet::SignalingChannelId sourceChannel
158 );
159
160 MCAPI ::NetherNet::ErrorOr<void, ::NetherNet::ESessionError> SendToSignalingChannel(
161 ::NetherNet::NetworkID networkIDTo,
162 ::std::variant<
166 ::NetherNet::CandidateAdd> const& signal,
167 ::std::optional<::NetherNet::SignalingChannelId> preference
168 );
169 // NOLINTEND
170
171public:
172 // destructor thunk
173 // NOLINTBEGIN
174 MCAPI void $dtor();
175 // NOLINTEND
176
177public:
178 // virtual function thunks
179 // NOLINTBEGIN
180 MCAPI bool $SendPacket(
181 ::NetherNet::NetworkID remoteId,
182 uint64 connectionId,
183 ::std::string const& data,
184 ::NetherNet::ESendType eSendType
185 );
186
187 MCAPI bool $IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint* pcbMessageSize);
188
189 MCAPI void $ClearPacketData(::NetherNet::NetworkID remoteId, uint64 connectionId);
190
191 MCAPI bool
192 $ReadPacket(::NetherNet::NetworkID remoteId, uint64 connectionId, void* pubDest, uint cbDest, uint* pcbMessageSize);
193
194 MCAPI bool $OpenSessionWithUser(::NetherNet::NetworkID networkIDRemote);
195
196 MCAPI bool $CloseSessionWithUser(::NetherNet::NetworkID networkIDRemote, uint64 connectionId);
197
198 MCAPI bool
199 $GetSessionState(::NetherNet::NetworkID peerId, uint64 connectionId, ::NetherNet::SessionState* pConnectionState);
200
201 MCAPI void
202 $SetSignalingInterface(::std::shared_ptr<::NetherNet::ISignalingInterface> const& pWebRTCSignalingInterface);
203
204 MCAPI void $SetRelayConfig(::std::vector<::NetherNet::StunRelayServer> const& config);
205
206 MCAPI ::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ISignalingEventHandler* handler);
207
208 MCAPI ::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ILanEventHandler* handler);
209
210 MCAPI bool $IsBroadcastDiscoveryEnabled();
211
212 MCAPI void $EnableBroadcastDiscovery();
213
214 MCAPI void $DisableBroadcastDiscovery();
215
216 MCAPI void $OnSignalingEvent(::NetherNet::SignalingEvents::MessageReceived const& event);
217
218 MCAPI void $OnLanEvent(::NetherNet::LanEvents::MessageReceived const& event);
219
220 MCAPI void $OnLanEvent(::NetherNet::LanEvents::DiscoveryRequest const& event);
221
222 MCAPI void $OnLanEvent(::NetherNet::LanEvents::DiscoveryResponse const& event);
223 // NOLINTEND
224
225public:
226 // vftables
227 // NOLINTBEGIN
228 MCAPI static void** $vftableForISignalingEventHandler();
229
230 MCAPI static void** $vftableForILanEventHandler();
231
232 MCAPI static void** $vftableForContextProxy();
233
234 MCAPI static void** $vftableForINetherNetTransportInterface();
235 // NOLINTEND
236};
237
238} // namespace NetherNet
Definition CandidateAdd.h:7
Definition ConnectError.h:7
Definition ConnectRequest.h:7
Definition ConnectResponse.h:7
Definition ContextProxy.h:18
Definition INetherNetTransportInterfaceCallbacks.h:15
Definition INetherNetTransportInterface.h:21
Definition SimpleNetworkInterfaceImpl.h:40
Definition ILanEventHandler.h:15
Definition ISignalingEventHandler.h:12
Definition DiscoveryRequest.h:7
Definition DiscoveryResponse.h:7
Definition MessageReceived.h:7
Definition NetherNetTransportServerConfiguration.h:7
Definition NetworkID.h:7
Definition SessionState.h:7
Definition MessageReceived.h:7
Definition Alias.h:14
Definition PeerConnectionInterface.h:193