3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/network/LocatorStateChangeRequest.h"
8#include "mc/network/PermissionIPv6.h"
9#include "mc/network/PermissionLAN.h"
10#include "mc/network/RakNetServerLANVisibility.h"
11#include "mc/network/RakPeerHelper.h"
12#include "mc/network/ServerConnectivityTestResult.h"
13#include "mc/network/ServerLocator.h"
14#include "mc/platform/threading/LockGuard.h"
15#include "mc/world/level/GameType.h"
27namespace Social {
struct Nonce; }
42 enum class protocolVersion :
int {
47 struct AnnounceServerData {
64 AnnounceServerData& operator=(AnnounceServerData
const&);
80 class NatHolePuncherFunctor {
89 NatHolePuncherFunctor& operator=(NatHolePuncherFunctor
const&);
90 NatHolePuncherFunctor(NatHolePuncherFunctor
const&);
91 NatHolePuncherFunctor();
94 class PingRateRecorder {
111 PingRateRecorder& operator=(PingRateRecorder
const&);
112 PingRateRecorder(PingRateRecorder
const&);
116 struct StateChangeRequestData {
127 StateChangeRequestData& operator=(StateChangeRequestData
const&);
128 StateChangeRequestData(StateChangeRequestData
const&);
129 StateChangeRequestData();
132 struct SuspendStateData {
143 SuspendStateData& operator=(SuspendStateData
const&);
144 SuspendStateData(SuspendStateData
const&);
182 RakNetServerLocator& operator=(RakNetServerLocator
const&);
183 RakNetServerLocator(RakNetServerLocator
const&);
184 RakNetServerLocator();
189 virtual ~RakNetServerLocator() =
default;
191 virtual void startAnnouncingServer(
192 ::std::string
const& playerName,
193 ::std::string
const& worldName,
197 bool isJoinableThroughServerScreen,
204 virtual void stopAnnouncingServer() ;
206 virtual void startServerDiscovery(
::PortPair ports) ;
208 virtual void stopServerDiscovery() ;
212 virtual ::std::vector<::PingedCompatibleServer> getServerList() const ;
214 virtual
void update() ;
216 virtual ::
std::chrono::milliseconds getPingTimeForGUID(::
std::
string const& guid) ;
218 virtual
void checkCanConnectToCustomServerAsync(
219 ::
std::
string hostIpAddress,
221 ::
std::function<
void(::ServerConnectivityTestResult)> callback
224 virtual
void _onDisable() ;
226 virtual
void _onEnable() ;
232 MCNAPI RakNetServerLocator(
235 ::
std::vector<::
std::
string> overrideBroadcastAddresses,
237 ::RakNetServerLANVisibility serverLanVisibility,
238 ::PermissionLAN permissionLAN,
239 ::PermissionIPv6 permissionIPv6,
240 ::Bedrock::NonOwnerPointer<::
AppPlatform> const& appPlatform,
241 ::
std::function<::
std::unique_ptr<::RakNet::RakPeerInterface,
void (*)(::RakNet::RakPeerInterface*)>()>
242 createUniqueRakPeerFunc
252 ::LocatorStateChangeRequest newState,
262 MCNAPI
void _initializeBroadcastAddresses();
265 MCNAPI
void _onPingSend(::std::string
const& guid, ::std::string
const& addr,
int ipVersion);
268 ::std::chrono::milliseconds& latencyToSet,
270 ::std::chrono::steady_clock::time_point
const& receivedTime,
279 MCNAPI
void _punchHoles();
297 ::std::vector<::std::string> overrideBroadcastAddresses,
299 ::RakNetServerLANVisibility serverLanVisibility,
300 ::PermissionLAN permissionLAN,
301 ::PermissionIPv6 permissionIPv6,
304 createUniqueRakPeerFunc
312 ::std::string
const& playerName,
313 ::std::string
const& worldName,
317 bool isJoinableThroughServerScreen,
339 ::std::string hostIpAddress,
341 ::std::function<
void(::ServerConnectivityTestResult)> callback
Definition AsynchronousIPResolver.h:5
Definition NonOwnerPointer.h:9
Definition RakNetConnector.h:31
Definition RakNetServerLocator.h:80
Definition RakNetServerLocator.h:94
MCAPI bool _onPongReceive(::std::chrono::milliseconds &latencyToSet, ::RakNet::RakNetGUID const &guid, ::std::chrono::steady_clock::time_point const &receivedTime, int ipVersion)
MCAPI void _onPingSend(::std::string const &guid, ::std::string const &addr, int ipVersion)
MCAPI void $startAnnouncingServer(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore, ::ServerSupportedAuthenticationTypes supportedAuth, ::Social::Nonce const &)
MCAPI void $stopAnnouncingServer()
MCAPI void _addCustomServerFromIpResolver(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void _startServerDiscovery(::PortPair const &ports)
MCAPI void _stopAnnouncingServer()
MCAPI ::std::vector<::PingedCompatibleServer > $getServerList() const
MCAPI bool _pingServerV6(::std::string const &address, int port)
MCAPI void * $ctor(::RakNetConnector &rakNetConnector, ::RakPeerHelper::IPSupportInterface &ipInterface, ::std::vector<::std::string > overrideBroadcastAddresses, bool isServer, ::RakNetServerLANVisibility serverLanVisibility, ::PermissionLAN permissionLAN, ::PermissionIPv6 permissionIPv6, ::Bedrock::NonOwnerPointer<::AppPlatform > const &appPlatform, ::std::function<::std::unique_ptr<::RakNet::RakPeerInterface, void(*)(::RakNet::RakPeerInterface *)>()> createUniqueRakPeerFunc)
MCAPI::std::chrono::milliseconds $getPingTimeForGUID(::std::string const &guid)
MCAPI void _enqueueStateChangeRequest(::LocatorStateChangeRequest newState, ::RakNetServerLocator::AnnounceServerData newAnnounceData, ::PortPair newPorts)
MCAPI void $startServerDiscovery(::PortPair ports)
MCAPI void _announceServer(::RakNetServerLocator::AnnounceServerData const &serverData)
MCAPI::std::string _getHostGuid(::std::string const &address, int port)
MCAPI void $addCustomServer(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void _getServerOriginalAddress(::std::string &originalAddressToSet, ::std::string const &ip)
MCAPI void _startAnnouncingServer(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI void $stopServerDiscovery()
MCAPI bool _pingServerV4(::std::string const &address, int port)
MCAPI void _stopServerDiscovery()
MCAPI void $checkCanConnectToCustomServerAsync(::std::string hostIpAddress, int port, ::std::function< void(::ServerConnectivityTestResult)> callback)
Definition RakPeerInterface.h:32
Definition RakPeerHelper.h:35
Definition RakPeerHelper.h:15
Definition ServerLocator.h:20
Definition PingedCompatibleServer.h:5
Definition RakNetServerLocator.h:47
MCAPI void * $ctor(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI AnnounceServerData(::RakNetServerLocator::AnnounceServerData const &announceData)
Definition RakNetServerLocator.h:116
Definition RakNetServerLocator.h:132
Definition RakNetGUID.h:7
Definition ServerSupportedAuthenticationTypes.h:5