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 NetworkID; }
26namespace NetherNet { struct SessionState; }
27namespace NetherNet { struct StunRelayServer; }
28namespace NetherNet { struct TransportConfiguration; }
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
37class SimpleNetworkInterfaceImpl : public ::NetherNet::ContextProxy,
41public:
42 // member variables
43 // NOLINTBEGIN
58 // NOLINTEND
59
60public:
61 // prevent constructor by default
62 SimpleNetworkInterfaceImpl& operator=(SimpleNetworkInterfaceImpl const&);
63 SimpleNetworkInterfaceImpl(SimpleNetworkInterfaceImpl const&);
64 SimpleNetworkInterfaceImpl();
65
66public:
67 // virtual functions
68 // NOLINTBEGIN
69 virtual ~SimpleNetworkInterfaceImpl() /*override*/ = default;
70
71 virtual bool SendPacket(
73 uint64 connectionId,
74 ::std::string const& data,
75 ::NetherNet::ESendType eSendType
76 ) /*override*/;
77
78 virtual bool
79 IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint* pcbMessageSize) /*override*/;
80
81 virtual bool ReadPacket(
83 uint64 connectionId,
84 void* pubDest,
85 uint cbDest,
86 uint* pcbMessageSize
87 ) /*override*/;
88
89 virtual bool OpenSessionWithUser(::NetherNet::NetworkID networkIDRemote) /*override*/;
90
91 virtual bool CloseSessionWithUser(::NetherNet::NetworkID networkIDRemote, uint64 connectionId) /*override*/;
92
93 virtual bool GetSessionState(
95 uint64 connectionId,
96 ::NetherNet::SessionState* pConnectionState
97 ) /*override*/;
98
99 virtual void SetSignalingInterface(
100 ::std::shared_ptr<::NetherNet::ISignalingInterface> const& pWebRTCSignalingInterface
101 ) /*override*/;
102
103 virtual void SetRelayConfig(::std::vector<::NetherNet::StunRelayServer> const& config) /*override*/;
104
105 virtual ::Bedrock::PubSub::Subscription
106 RegisterEventHandler(::NetherNet::ISignalingEventHandler* handler) /*override*/;
107
108 virtual ::Bedrock::PubSub::Subscription RegisterEventHandler(::NetherNet::ILanEventHandler* handler) /*override*/;
109
110 virtual bool IsBroadcastDiscoveryEnabled() /*override*/;
111
112 virtual void EnableBroadcastDiscovery() /*override*/;
113
114 virtual void DisableBroadcastDiscovery() /*override*/;
115
116 virtual void EnableLANSignaling() /*override*/;
117
118 virtual void DisableLANSignaling() /*override*/;
119
120 virtual void EnableTrickleIce() /*override*/;
121
122 virtual void DisableTrickleIce() /*override*/;
123
124 virtual void OnSignalingEvent(::NetherNet::SignalingEvents::MessageReceived const& event) /*override*/;
125
126 virtual void OnLanEvent(::NetherNet::LanEvents::MessageReceived const& event) /*override*/;
127
128 virtual void OnLanEvent(::NetherNet::LanEvents::DiscoveryRequest const& event) /*override*/;
129
130 virtual void OnLanEvent(::NetherNet::LanEvents::DiscoveryResponse const& event) /*override*/;
131 // NOLINTEND
132
133public:
134 // member functions
135 // NOLINTBEGIN
136 MCNAPI ::webrtc::PeerConnectionInterface::RTCConfiguration GetRTCConfig(::NetherNet::NetworkID peerId) const;
137
139
141 ::NetherNet::TransportConfiguration const* pConfiguration,
143 );
144
147 ::std::string const& message,
148 ::NetherNet::SignalingChannelId sourceChannel
149 );
150
151 MCNAPI ::NetherNet::ErrorOr<void, ::NetherNet::ESessionError> SendToSignalingChannel(
152 ::NetherNet::NetworkID networkIDTo,
153 ::std::variant<
157 ::NetherNet::CandidateAdd> const& signal,
158 ::std::optional<::NetherNet::SignalingChannelId> preference
159 );
160 // NOLINTEND
161
162public:
163 // virtual function thunks
164 // NOLINTBEGIN
165 MCNAPI bool $SendPacket(
166 ::NetherNet::NetworkID remoteId,
167 uint64 connectionId,
168 ::std::string const& data,
169 ::NetherNet::ESendType eSendType
170 );
171
172 MCNAPI bool $IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint* pcbMessageSize);
173
174 MCNAPI bool
175 $ReadPacket(::NetherNet::NetworkID remoteId, uint64 connectionId, void* pubDest, uint cbDest, uint* pcbMessageSize);
176
177 MCNAPI bool $OpenSessionWithUser(::NetherNet::NetworkID networkIDRemote);
178
179 MCNAPI bool $CloseSessionWithUser(::NetherNet::NetworkID networkIDRemote, uint64 connectionId);
180
181 MCNAPI bool
182 $GetSessionState(::NetherNet::NetworkID peerId, uint64 connectionId, ::NetherNet::SessionState* pConnectionState);
183
184 MCNAPI void
185 $SetSignalingInterface(::std::shared_ptr<::NetherNet::ISignalingInterface> const& pWebRTCSignalingInterface);
186
187 MCNAPI void $SetRelayConfig(::std::vector<::NetherNet::StunRelayServer> const& config);
188
189 MCNAPI ::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ISignalingEventHandler* handler);
190
191 MCNAPI ::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ILanEventHandler* handler);
192
194
196
198
199 MCNAPI void $EnableLANSignaling();
200
201 MCNAPI void $DisableLANSignaling();
202
203 MCNAPI void $EnableTrickleIce();
204
205 MCNAPI void $DisableTrickleIce();
206
208
210
212
214
215
216 // NOLINTEND
217
218public:
219 // vftables
220 // NOLINTBEGIN
221 MCNAPI static void** $vftableForISignalingEventHandler();
222
223 MCNAPI static void** $vftableForILanEventHandler();
224
225 MCNAPI static void** $vftableForContextProxy();
226
228 // NOLINTEND
229};
230
231} // namespace NetherNet
Definition Subscription.h:10
Definition CandidateAdd.h:7
Definition ConnectError.h:7
Definition ConnectRequest.h:12
Definition ConnectResponse.h:12
Definition ContextProxy.h:18
Definition INetherNetTransportInterfaceCallbacks.h:16
Definition INetherNetTransportInterface.h:21
Definition ISignalingInterface.h:17
MCAPI bool $OpenSessionWithUser(::NetherNet::NetworkID networkIDRemote)
MCAPI ::NetherNet::ErrorOr< void, ::NetherNet::ESessionError > SendToSignalingChannel(::NetherNet::NetworkID networkIDTo, ::std::variant< ::NetherNet::ConnectRequest, ::NetherNet::ConnectResponse, ::NetherNet::ConnectError, ::NetherNet::CandidateAdd > const &signal, ::std::optional<::NetherNet::SignalingChannelId > preference)
MCAPI void $OnSignalingEvent(::NetherNet::SignalingEvents::MessageReceived const &event)
static MCAPI void ** $vftableForISignalingEventHandler()
static MCAPI void ** $vftableForContextProxy()
MCAPI void InitializeConfiguration(::NetherNet::TransportConfiguration const *pConfiguration, ::webrtc::PeerConnectionInterface::RTCConfiguration *pRtcConfigOut)
MCAPI void $OnLanEvent(::NetherNet::LanEvents::DiscoveryRequest const &event)
MCAPI void ReceiveFromSignalingChannel(::NetherNet::NetworkID from, ::std::string const &message, ::NetherNet::SignalingChannelId sourceChannel)
MCAPI bool $IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint *pcbMessageSize)
MCAPI void $SetSignalingInterface(::std::shared_ptr<::NetherNet::ISignalingInterface > const &pWebRTCSignalingInterface)
MCAPI bool $ReadPacket(::NetherNet::NetworkID remoteId, uint64 connectionId, void *pubDest, uint cbDest, uint *pcbMessageSize)
static MCAPI void ** $vftableForINetherNetTransportInterface()
MCAPI void $SetRelayConfig(::std::vector<::NetherNet::StunRelayServer > const &config)
MCAPI void $OnLanEvent(::NetherNet::LanEvents::DiscoveryResponse const &event)
MCAPI::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ILanEventHandler *handler)
MCAPI::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ISignalingEventHandler *handler)
MCAPI void Initialize(::NetherNet::INetherNetTransportInterfaceCallbacks *pCallbacks)
MCAPI bool $SendPacket(::NetherNet::NetworkID remoteId, uint64 connectionId, ::std::string const &data, ::NetherNet::ESendType eSendType)
static MCAPI void ** $vftableForILanEventHandler()
MCAPI void $OnLanEvent(::NetherNet::LanEvents::MessageReceived const &event)
MCAPI bool $CloseSessionWithUser(::NetherNet::NetworkID networkIDRemote, uint64 connectionId)
MCAPI bool $GetSessionState(::NetherNet::NetworkID peerId, uint64 connectionId, ::NetherNet::SessionState *pConnectionState)
MCAPI::webrtc::PeerConnectionInterface::RTCConfiguration GetRTCConfig(::NetherNet::NetworkID peerId) const
Definition ILanEventHandler.h:15
Definition ISignalingEventHandler.h:12
Definition DiscoveryRequest.h:7
Definition DiscoveryResponse.h:7
Definition MessageReceived.h:7
Definition NetworkID.h:17
Definition SessionState.h:7
Definition MessageReceived.h:7
Definition StunRelayServer.h:7
Definition TransportConfiguration.h:7
Definition Alias.h:14
Definition PeerConnectionInterface.h:198