46 public ::NetworkEnableDisableListener {
59 ::ll::TypedStorage<8, 8, ::std::reference_wrapper<::Scheduler>> receiveThread;
60 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RemoteConnector>> remoteConnector;
61 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerLocator>> serverLocator;
62 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::AppPlatform>> appPlatform;
63 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner>> networkSessionOwner;
64 ::ll::TypedStorage<4, 20, ::NetworkSettingOptions> networkSettingOptions;
65 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IPacketSerializationController>> serializationController;
81 struct IncomingPacketQueue {
85 ::ll::TypedStorage<8, 8, ::NetEventCallback&> mCallbacksObj;
86 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mMutex;
91 IncomingPacketQueue& operator=(IncomingPacketQueue
const&);
92 IncomingPacketQueue(IncomingPacketQueue
const&);
93 IncomingPacketQueue();
99 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner>> mNetworkSessionOwner;
100 ::ll::TypedStorage<8, 80, ::std::recursive_mutex> mConnectionsMutex;
101 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::NetworkConnection>>> mConnections;
102 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LocalConnector>> mLocalConnector;
103 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PacketGroupDefinition::PacketGroupBuilder>> mPacketGroupBuilder;
104 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RemoteConnector>> mRemoteConnector;
105 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ServerLocator>> mServerLocator;
106 ::ll::TypedStorage<8, 8, uint64> mCurrentConnection;
107 ::ll::TypedStorage<8, 16, ::Bedrock::Threading::Async<void>> mReceiveTask;
108 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mReceiveTaskGroup;
109 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::IPacketObserver>> mPacketObserver;
110 ::ll::TypedStorage<8, 8, ::Scheduler&> mMainThread;
111 ::ll::TypedStorage<8, 32, ::std::string> mReceiveBuffer;
112 ::ll::TypedStorage<8, 32, ::std::string> mSendBuffer;
113 ::ll::TypedStorage<8, 80, ::BinaryStream> mSendStream;
114 ::ll::TypedStorage<8, 32, ::std::unique_ptr<::NetworkSystem::IncomingPacketQueue>[4]> mIncomingPackets;
115 ::ll::TypedStorage<1, 1, bool> mUseIPv6Only;
116 ::ll::TypedStorage<2, 2, ushort> mDefaultGamePort;
117 ::ll::TypedStorage<2, 2, ushort> mDefaultGamePortv6;
118 ::ll::TypedStorage<1, 1, bool> mIsLanDiscoveryEnabled;
119 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::NetworkStatistics>> mNetworkStatistics;
120 ::ll::TypedStorage<1, 1, bool> mWebsocketsEnabled;
121 ::ll::TypedStorage<4, 20, ::NetworkSettingOptions> mNetworkSettingOptions;
122 ::ll::TypedStorage<1, 1, bool> mRawRecordingEnabled;
123 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::cereal::ReflectionCtx>>> mReflectionCtx;
124 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::IPacketSerializationController>>> mPacketOverrides;
128 ::gsl::not_null<::std::unique_ptr<
131 mSessionSummaryPublisher;
136 NetworkSystem& operator=(NetworkSystem
const&);
137 NetworkSystem(NetworkSystem
const&);
146 virtual bool useIPv4Only() const ;
148 virtual
bool useIPv6Only() const ;
150 virtual ushort getDefaultGamePort() const ;
152 virtual ushort getDefaultGamePortv6() const ;
154 virtual ~NetworkSystem() ;
156 virtual
void _onDisable() ;
158 virtual
void _onEnable() ;
166 virtual
void onConnectionClosed(
168 ::Connection::DisconnectFailReason const discoReason,
169 ::
std::
string const& messageFromServer,
170 ::
std::
string const& messageBodyOverride,
171 bool skipDisconnectMessage,
172 ::Json::Value const& sessionSummary
176 onAllConnectionsClosed(::Connection::DisconnectFailReason discoReason,
bool skipDisconnectMessage) ;
178 virtual
void onAllRemoteConnectionsClosed(
179 ::Connection::DisconnectFailReason discoReason,
180 bool skipDisconnectMessage
183 virtual
void onOutgoingConnectionFailed(::Connection::DisconnectFailReason discoReason) ;
185 virtual
void onWebsocketRequest(
186 ::
std::
string const& serverAddress,
187 ::
std::
string const& payload,
188 ::
std::function<
void()> errorCallback
195 MCAPI explicit NetworkSystem(::NetworkSystem::
Dependencies&& deps);
200 _sortAndPacketizeEvents(::
NetworkConnection& connection, ::
std::chrono::steady_clock::time_point endTime);
203 MCAPI
void closeConnection(
205 ::Connection::DisconnectFailReason discoReason,
206 ::std::string
const& messageFromServer
210 MCAPI
void disconnect();
216 MCAPI ::Bedrock::NotNullNonOwnerPtr<::RemoteConnector> getRemoteConnector();
218 MCAPI
bool isServer()
const;
224 MCAPI
void runEvents(
bool networkIsCritical);
228 MCAPI
void sendToMultiple(::std::vector<::NetworkIdentifierWithSubId>
const& ids,
::Packet const& packet);
230 MCAPI
void setDevConnectionQuality(::DevConnectionQuality quality);
232 MCAPI
void update(::std::vector<::WeakEntityRef>
const* userList);
250 MCFOLD
bool $useIPv4Only()
const;
252 MCAPI
bool $useIPv6Only()
const;
254 MCAPI ushort $getDefaultGamePort()
const;
256 MCAPI ushort $getDefaultGamePortv6()
const;
258 MCAPI
void $_onDisable();
260 MCAPI
void $_onEnable();
262 MCAPI
bool $onNewIncomingConnection(
::NetworkIdentifier const&
id, ::std::shared_ptr<::NetworkPeer>&& peer);
264 MCAPI
bool $onNewOutgoingConnection(
::NetworkIdentifier const&
id, ::std::shared_ptr<::NetworkPeer>&& peer);
266 MCAPI
void $onConnectionClosed(
268 ::Connection::DisconnectFailReason
const discoReason,
269 ::std::string
const& messageFromServer,
270 ::std::string
const& messageBodyOverride,
271 bool skipDisconnectMessage,
275 MCAPI
void $onAllConnectionsClosed(::Connection::DisconnectFailReason discoReason,
bool skipDisconnectMessage);
278 $onAllRemoteConnectionsClosed(::Connection::DisconnectFailReason discoReason,
bool skipDisconnectMessage);
280 MCAPI
void $onOutgoingConnectionFailed(::Connection::DisconnectFailReason discoReason);
282 MCAPI
void $onWebsocketRequest(
283 ::std::string
const& serverAddress,
284 ::std::string
const& payload,
285 ::std::function<
void()> errorCallback