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
27public:
28 // NetworkSessionManager inner types declare
29 // clang-format off
31 // clang-format on
32
33 // NetworkSessionManager inner types define
35 public:
36 // member variables
37 // NOLINTBEGIN
39 // NOLINTEND
40
41 public:
42 // prevent constructor by default
46 };
47
48public:
49 // member variables
50 // NOLINTBEGIN
54 // NOLINTEND
55
56public:
57 // prevent constructor by default
61
62public:
63 // virtual functions
64 // NOLINTBEGIN
65 // vIndex: 0
66 virtual ~NetworkSessionManager() /*override*/ = default;
67 // NOLINTEND
68
69public:
70 // member functions
71 // NOLINTBEGIN
74 ::std::tuple<
75 ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession>>&,
77 );
78
80 ::NetherNet::NetworkID networkIDRemote,
81 uint64 connectionId,
82 ::NetherNet::ESessionError reason
83 );
84
85 MCNAPI ::gsl::not_null<::NetherNet::NetworkSession*> FindOrCreateSpecificSession(
87 uint64 connectionId,
89 );
90
91 MCNAPI ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession>>& GetCurrentSessions(
94 );
95
96 MCNAPI bool
97 GetSessionState(::NetherNet::NetworkID peerId, uint64 connectionId, ::NetherNet::SessionState* pConnectionState);
98
99 MCNAPI ::NetherNet::ESessionError InitiateIncomingSession(
100 ::NetherNet::NetworkID remoteID,
101 ::NetherNet::ConnectRequest const& offer,
102 ::NetherNet::SignalingChannelId source,
104 );
105
106 MCNAPI ::NetherNet::NetworkSession* InitiateOutgoingSession(
107 ::NetherNet::NetworkID remoteID,
109 );
110
111 MCNAPI bool IsPacketAvailable(::NetherNet::NetworkID remoteId, uint64 connectionId, uint* pcbMessageSize) const;
112
113 MCNAPI void NotifyOnSessionOpen(::NetherNet::NetworkID networkIDRemote, uint64 connectionId);
114
116
117 MCNAPI void ProcessError(::NetherNet::NetworkID remoteID, uint64 connectionId, ::NetherNet::ESessionError error);
118
119 MCNAPI void ProcessSignal(
120 ::NetherNet::NetworkID remoteID,
121 ::NetherNet::ConnectError const& error,
122 ::NetherNet::SignalingChannelId
123 ) const;
124
125 MCNAPI void ProcessSignal(
126 ::NetherNet::NetworkID remoteID,
127 ::NetherNet::ConnectResponse const& signal,
128 ::NetherNet::SignalingChannelId
129 ) const;
130
131 MCNAPI void ProcessSignal(
132 ::NetherNet::NetworkID remoteID,
133 ::NetherNet::CandidateAdd const& signal,
134 ::NetherNet::SignalingChannelId
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
Definition NetworkSessionManager.h:26
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 ProcessSignal(::NetherNet::NetworkID remoteID, ::NetherNet::ConnectError const &error, ::NetherNet::SignalingChannelId) const
MCAPI void ProcessSignal(::NetherNet::NetworkID remoteID, ::NetherNet::ConnectResponse const &signal, ::NetherNet::SignalingChannelId) const
MCAPI void ProcessSignal(::NetherNet::NetworkID remoteID, ::NetherNet::CandidateAdd const &signal, ::NetherNet::SignalingChannelId)
MCAPI::NetherNet::NetworkSession * InitiateOutgoingSession(::NetherNet::NetworkID remoteID, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &sessionsLock)
MCAPI void NotifyOnSessionOpen(::NetherNet::NetworkID networkIDRemote, uint64 connectionId)
MCAPI ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession > > & GetCurrentSessions(::NetherNet::NetworkID remoteID, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &)
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 bool CloseSessionWithReason(::NetherNet::NetworkID networkIDRemote, uint64 connectionId, ::NetherNet::ESessionError reason)
MCAPI void PeriodicDeadSessionCleanupOnSignalThread()
MCAPI::NetherNet::ESessionError InitiateIncomingSession(::NetherNet::NetworkID remoteID, ::NetherNet::ConnectRequest const &offer, ::NetherNet::SignalingChannelId source, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &sessionsLock)
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 ::gsl::not_null<::NetherNet::NetworkSession * > FindOrCreateSpecificSession(::NetherNet::NetworkID remoteId, uint64 connectionId, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const &sessionsLock)
MCAPI void CloseInactiveSessionsOnSignalThread(::NetherNet::NetworkID remoteID, ::std::tuple< ::std::vector<::std::unique_ptr<::NetherNet::NetworkSession > > &, ::Bedrock::Threading::UniqueLock<::std::recursive_mutex > const & > const &list)
Definition NetworkSession.h:8
Definition NetworkID.h:17
Definition NetworkSessionManager.h:34
Definition SessionState.h:7
Definition Alias.h:14