LeviLamina
Loading...
Searching...
No Matches
NetworkSessionManager.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/SignalingChannelId.h"
10#include "mc/deps/nether_net/utils/ErrorOr.h"
11#include "mc/platform/threading/UniqueLock.h"
12
13// auto generated forward declare list
14// clang-format off
15namespace NetherNet { class CandidateAdd; }
16namespace NetherNet { class ConnectError; }
17namespace NetherNet { class ConnectRequest; }
18namespace NetherNet { class ConnectResponse; }
19namespace NetherNet { class NetworkSession; }
20namespace NetherNet { struct NetworkID; }
21namespace NetherNet { struct SessionState; }
22// clang-format on
23
24namespace NetherNet {
25
26class NetworkSessionManager : public ::NetherNet::ContextProxy {
27public:
28 // NetworkSessionManager inner types declare
29 // clang-format off
31 // clang-format on
32
33 // NetworkSessionManager inner types define
34 struct NetworkSessionRecord {
35 public:
36 // member variables
37 // NOLINTBEGIN
39 // NOLINTEND
40
41 public:
42 // prevent constructor by default
43 NetworkSessionRecord& operator=(NetworkSessionRecord const&);
44 NetworkSessionRecord(NetworkSessionRecord const&);
45 NetworkSessionRecord();
46 };
47
48public:
49 // member variables
50 // NOLINTBEGIN
54 // NOLINTEND
55
56public:
57 // prevent constructor by default
58 NetworkSessionManager& operator=(NetworkSessionManager const&);
59 NetworkSessionManager(NetworkSessionManager const&);
60 NetworkSessionManager();
61
62public:
63 // virtual functions
64 // NOLINTBEGIN
65 virtual ~NetworkSessionManager() /*override*/ = default;
66 // NOLINTEND
67
68public:
69 // member functions
70 // NOLINTBEGIN
73 ::std::tuple<
74 ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession>>&,
76 );
77
79 ::NetherNet::NetworkID networkIDRemote,
80 uint64 connectionId,
81 ::NetherNet::ESessionError reason
82 );
83
84 MCNAPI ::gsl::not_null<::NetherNet::NetworkSession*> FindOrCreateSpecificSession(
86 uint64 connectionId,
88 bool disableTrickleIce
89 );
90
91 MCNAPI bool
92 GetSessionState(::NetherNet::NetworkID peerId, uint64 connectionId, ::NetherNet::SessionState* pConnectionState);
93
94 MCNAPI ::NetherNet::ESessionError InitiateIncomingSession(
96 ::NetherNet::ConnectRequest const& offer,
97 ::NetherNet::SignalingChannelId source,
99 bool disableTrickleIce
100 );
101
102 MCNAPI ::NetherNet::NetworkSession* InitiateOutgoingSession(
103 ::NetherNet::NetworkID remoteID,
105 bool disableTrickleIce
106 );
107
108 MCNAPI bool IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint* pcbMessageSize) const;
109
110 MCNAPI void NotifyOnSessionOpen(::NetherNet::NetworkID networkIDRemote, uint64 connectionId);
111
113
114 MCNAPI void ProcessError(::NetherNet::NetworkID remoteID, uint64 connectionId, ::NetherNet::ESessionError error);
115
116 MCNAPI void ProcessSignal(
117 ::NetherNet::NetworkID remoteID,
118 ::NetherNet::ConnectError const& error,
119 ::NetherNet::SignalingChannelId,
120 bool
121 ) const;
122
123 MCNAPI void ProcessSignal(
124 ::NetherNet::NetworkID remoteID,
125 ::NetherNet::ConnectResponse const& signal,
126 ::NetherNet::SignalingChannelId,
127 bool
128 ) const;
129
130 MCNAPI void ProcessSignal(
131 ::NetherNet::NetworkID remoteID,
132 ::NetherNet::CandidateAdd const& signal,
133 ::NetherNet::SignalingChannelId,
134 bool disableTrickleIce
135 );
136
137 MCNAPI bool
138 ReadPacket(::NetherNet::NetworkID remoteId, uint64 connectionId, void* pubDest, uint cbDest, uint* pcbMessageSize);
139
140 MCNAPI ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession>>
141 RemoveSession(::NetherNet::NetworkID remoteID, uint64 connectionId);
142
143 MCNAPI bool SendPacket(
144 ::NetherNet::NetworkID networkIDRemote,
145 uint64 connectionId,
146 uchar const* data,
147 uint64 size,
148 ::NetherNet::ESendType type
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 // vftables
164 // NOLINTBEGIN
165 MCNAPI static void** $vftable();
166 // NOLINTEND
167};
168
169} // namespace NetherNet
Definition UniqueLock.h:8
Definition CandidateAdd.h:7
Definition ConnectError.h:7
Definition ConnectRequest.h:12
Definition ConnectResponse.h:12
Definition ContextProxy.h:18
MCAPI bool ReadPacket(::NetherNet::NetworkID remoteId, uint64 connectionId, void *pubDest, uint cbDest, uint *pcbMessageSize)
static MCAPI void ** $vftable()
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 NotifyOnSessionOpen(::NetherNet::NetworkID networkIDRemote, uint64 connectionId)
MCAPI void ProcessSignal(::NetherNet::NetworkID remoteID, ::NetherNet::ConnectResponse const &signal, ::NetherNet::SignalingChannelId, bool) const
MCAPI void ProcessSignal(::NetherNet::NetworkID remoteID, ::NetherNet::CandidateAdd const &signal, ::NetherNet::SignalingChannelId, bool disableTrickleIce)
MCAPI::NetherNet::ESessionError InitiateIncomingSession(::NetherNet::NetworkID remoteID, ::NetherNet::ConnectRequest const &offer, ::NetherNet::SignalingChannelId source, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &sessionsLock, bool disableTrickleIce)
MCAPI bool GetSessionState(::NetherNet::NetworkID peerId, uint64 connectionId, ::NetherNet::SessionState *pConnectionState)
MCAPI bool SendPacket(::NetherNet::NetworkID networkIDRemote, uint64 connectionId, uchar const *data, uint64 size, ::NetherNet::ESendType type)
MCAPI ::gsl::not_null<::NetherNet::NetworkSession * > FindOrCreateSpecificSession(::NetherNet::NetworkID remoteId, uint64 connectionId, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &sessionsLock, bool disableTrickleIce)
MCAPI bool CloseSessionWithReason(::NetherNet::NetworkID networkIDRemote, uint64 connectionId, ::NetherNet::ESessionError reason)
MCAPI void PeriodicDeadSessionCleanupOnSignalThread()
MCAPI::NetherNet::NetworkSession * InitiateOutgoingSession(::NetherNet::NetworkID remoteID, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &sessionsLock, bool disableTrickleIce)
MCAPI void ProcessError(::NetherNet::NetworkID remoteID, uint64 connectionId, ::NetherNet::ESessionError error)
MCAPI ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession > > RemoveSession(::NetherNet::NetworkID remoteID, uint64 connectionId)
MCAPI bool IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint *pcbMessageSize) const
MCAPI void CloseInactiveSessionsOnSignalThread(::NetherNet::NetworkID remoteID, ::std::tuple< ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession > > &, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const & > const &list)
MCAPI void ProcessSignal(::NetherNet::NetworkID remoteID, ::NetherNet::ConnectError const &error, ::NetherNet::SignalingChannelId, bool) const
Definition NetworkSession.h:19
Definition NetworkID.h:17
Definition NetworkSessionManager.h:34
Definition SessionState.h:7
Definition Alias.h:14