50 public ::NetworkEnableDisableListener {
63 ::ll::TypedStorage<8, 8, ::std::reference_wrapper<::Scheduler>> receiveThread;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RemoteConnector>> remoteConnector;
65 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerLocator>> serverLocator;
66 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::AppPlatform>> appPlatform;
67 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner>> networkSessionOwner;
68 ::ll::TypedStorage<4, 20, ::NetworkSettingOptions> networkSettingOptions;
69 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IPacketSerializationController>> serializationController;
85 struct IncomingPacketQueue {
89 ::ll::TypedStorage<8, 8, ::NetEventCallback&> mCallbacksObj;
90 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutex;
95 IncomingPacketQueue& operator=(IncomingPacketQueue
const&);
96 IncomingPacketQueue(IncomingPacketQueue
const&);
97 IncomingPacketQueue();
103 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner>> mNetworkSessionOwner;
104 ::ll::TypedStorage<8, 80, ::std::recursive_mutex> mConnectionsMutex;
105 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::NetworkConnection>>> mConnections;
106 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LocalConnector>> mLocalConnector;
107 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PacketGroupDefinition::PacketGroupBuilder>> mPacketGroupBuilder;
108 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RemoteConnector>> mRemoteConnector;
109 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerLocator>> mServerLocator;
110 ::ll::TypedStorage<8, 8, uint64> mCurrentConnection;
111 ::ll::TypedStorage<8, 16, ::Bedrock::Threading::Async<void>> mReceiveTask;
112 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mReceiveTaskGroup;
113 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::IPacketObserver>> mPacketObserver;
114 ::ll::TypedStorage<8, 8, ::Scheduler&> mMainThread;
115 ::ll::TypedStorage<8, 32, ::std::string> mReceiveBuffer;
116 ::ll::TypedStorage<8, 32, ::std::string> mSendBuffer;
117 ::ll::TypedStorage<8, 80, ::BinaryStream> mSendStream;
118 ::ll::TypedStorage<8, 32, ::std::unique_ptr<::NetworkSystem::IncomingPacketQueue>[4]> mIncomingPackets;
119 ::ll::TypedStorage<1, 1, bool> mUseIPv6Only;
120 ::ll::TypedStorage<2, 2, ushort> mDefaultGamePort;
121 ::ll::TypedStorage<2, 2, ushort> mDefaultGamePortv6;
122 ::ll::TypedStorage<1, 1, bool> mIsLanDiscoveryEnabled;
123 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::NetworkStatistics>> mNetworkStatistics;
124 ::ll::TypedStorage<1, 1, bool> mWebsocketsEnabled;
125 ::ll::TypedStorage<4, 20, ::NetworkSettingOptions> mNetworkSettingOptions;
126 ::ll::TypedStorage<1, 1, bool> mRawRecordingEnabled;
127 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::cereal::ReflectionCtx>>> mReflectionCtx;
128 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::IPacketSerializationController>>> mPacketOverrides;
132 ::gsl::not_null<::std::unique_ptr<
135 mSessionSummaryPublisher;
140 NetworkSystem& operator=(NetworkSystem
const&);
141 NetworkSystem(NetworkSystem
const&);
150 virtual bool useIPv4Only() const ;
152 virtual
bool useIPv6Only() const ;
154 virtual ushort getDefaultGamePort() const ;
156 virtual ushort getDefaultGamePortv6() const ;
158 virtual ~NetworkSystem() ;
160 virtual
void _onDisable() ;
162 virtual
void _onEnable() ;
170 virtual
void onConnectionClosed(
172 ::Connection::DisconnectFailReason const discoReason,
173 ::
std::
string const& messageFromServer,
174 ::
std::
string const& messageBodyOverride,
175 bool skipDisconnectMessage,
176 ::Json::Value const& sessionSummary
180 onAllConnectionsClosed(::Connection::DisconnectFailReason discoReason,
bool skipDisconnectMessage) ;
182 virtual
void onAllRemoteConnectionsClosed(
183 ::Connection::DisconnectFailReason discoReason,
184 bool skipDisconnectMessage
187 virtual
void onOutgoingConnectionFailed(::Connection::DisconnectFailReason discoReason) ;
189 virtual
void onWebsocketRequest(
190 ::
std::
string const& serverAddress,
191 ::
std::
string const& payload,
192 ::
std::function<
void()> errorCallback
199 MCAPI explicit NetworkSystem(::NetworkSystem::
Dependencies&& deps);
201 MCAPI ::TransportLayer _getTransportLayer() const;
205 MCAPI
bool _isUsingNetherNetTransportLayer() const;
210 MCAPI
void _setDisableLanSignaling(
bool disableLanSignaling);
214 _sortAndPacketizeEvents(
::NetworkConnection& connection, ::std::chrono::steady_clock::time_point endTime);
217 MCAPI
void closeConnection(
219 ::Connection::DisconnectFailReason discoReason,
220 ::std::string
const& messageFromServer
224 MCAPI
void disconnect();
228 MCAPI ::std::weak_ptr<::CompressedNetworkPeer> getCompressedPeerForUser(
::NetworkIdentifier const&
id);
230 MCFOLD ::std::vector<::std::unique_ptr<::NetworkConnection>>
const& getConnections()
const;
232 MCAPI ::std::weak_ptr<::EncryptedNetworkPeer> getEncryptedPeerForUser(
::NetworkIdentifier const&
id);
235 MCFOLD ::NetworkStatistics
const* getNetworkStatistics()
const;
240 MCFOLD ::Bedrock::NotNullNonOwnerPtr<::RemoteConnector const> getRemoteConnector()
const;
242 MCFOLD ::Bedrock::NotNullNonOwnerPtr<::RemoteConnector> getRemoteConnector();
244 MCFOLD ::ServerLocator& getServerLocator();
247 MCAPI ::Bedrock::PubSub::Connector<void(
::Json::Value const&)>& getSessionSummaryCallback();
249 MCAPI
bool hasNetworkSession()
const;
251 MCAPI
bool isNetherNetEnabled()
const;
254 MCAPI
bool isServer()
const;
262 MCAPI
void runEvents(
bool networkIsCritical);
266 MCAPI
void sendToMultiple(::std::vector<::NetworkIdentifierWithSubId>
const& ids,
::Packet const& packet);
271 MCAPI
void setConnectionChannelPaused(
::NetworkIdentifier const&
id, uint channel,
bool paused);
273 MCAPI
void setDefaultGamePort(ushort defaultPort);
275 MCAPI
void setDefaultGamePortv6(ushort defaultPortv6);
277 MCAPI
void setDevConnectionQuality(::DevConnectionQuality quality);
279 MCAPI
void setUseIPv6Only(
bool useIPv6Only);
282 MCAPI
void unregisterClientOrServerInstance(::SubClientId
const& subID);
284 MCAPI
void update(::std::vector<::WeakEntityRef>
const* userList);
302 MCFOLD
bool $useIPv4Only()
const;
304 MCAPI
bool $useIPv6Only()
const;
306 MCAPI ushort $getDefaultGamePort()
const;
308 MCAPI ushort $getDefaultGamePortv6()
const;
310 MCAPI
void $_onDisable();
312 MCAPI
void $_onEnable();
314 MCAPI
bool $onNewIncomingConnection(
::NetworkIdentifier const&
id, ::std::shared_ptr<::NetworkPeer>&& peer);
316 MCAPI
bool $onNewOutgoingConnection(
::NetworkIdentifier const&
id, ::std::shared_ptr<::NetworkPeer>&& peer);
318 MCAPI
void $onConnectionClosed(
320 ::Connection::DisconnectFailReason
const discoReason,
321 ::std::string
const& messageFromServer,
322 ::std::string
const& messageBodyOverride,
323 bool skipDisconnectMessage,
327 MCAPI
void $onAllConnectionsClosed(::Connection::DisconnectFailReason discoReason,
bool skipDisconnectMessage);
330 $onAllRemoteConnectionsClosed(::Connection::DisconnectFailReason discoReason,
bool skipDisconnectMessage);
332 MCAPI
void $onOutgoingConnectionFailed(::Connection::DisconnectFailReason discoReason);
334 MCAPI
void $onWebsocketRequest(
335 ::std::string
const& serverAddress,
336 ::std::string
const& payload,
337 ::std::function<
void()> errorCallback