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"
26namespace RakNet {
struct Packet; }
42 enum class protocolVersion :
int {
47 struct AnnounceServerData {
64 AnnounceServerData& operator=(AnnounceServerData
const&);
73 ::std::string
const& playerName,
74 ::std::string
const& worldName,
78 bool isJoinableThroughServerScreen,
93 ::std::string
const& playerName,
94 ::std::string
const& worldName,
98 bool isJoinableThroughServerScreen,
112 class NatHolePuncherFunctor {
121 NatHolePuncherFunctor& operator=(NatHolePuncherFunctor
const&);
122 NatHolePuncherFunctor(NatHolePuncherFunctor
const&);
123 NatHolePuncherFunctor();
129 MCNAPI
bool punch(::std::function<
bool()> lanDiscoveryPortPuncher, ::std::function<
bool()> gamePortPuncher);
134 class PingRateRecorder {
151 PingRateRecorder& operator=(PingRateRecorder
const&);
152 PingRateRecorder(PingRateRecorder
const&);
158 MCNAPI
bool pingEnd(uint
const& endTime,
int ipVersion);
162 struct StateChangeRequestData {
173 StateChangeRequestData& operator=(StateChangeRequestData
const&);
174 StateChangeRequestData(StateChangeRequestData
const&);
175 StateChangeRequestData();
190 struct SuspendStateData {
201 SuspendStateData& operator=(SuspendStateData
const&);
202 SuspendStateData(SuspendStateData
const&);
252 RakNetServerLocator& operator=(RakNetServerLocator
const&);
253 RakNetServerLocator(RakNetServerLocator
const&);
254 RakNetServerLocator();
259 virtual ~RakNetServerLocator() ;
261 virtual void startAnnouncingServer(
262 ::std::string
const& playerName,
263 ::std::string
const& worldName,
267 bool isJoinableThroughServerScreen,
273 virtual void stopAnnouncingServer() ;
275 virtual void startServerDiscovery(
::PortPair ports) ;
277 virtual void stopServerDiscovery() ;
281 virtual void addCustomServer(::std::string
const& address,
int port) ;
283 virtual ::std::vector<::PingedCompatibleServer> getServerList() const ;
285 virtual
void clearServerList() ;
287 virtual
void update() ;
289 virtual
float getPingTimeForGUID(::
std::
string const& guid) ;
291 virtual
void checkCanConnectToCustomServerAsync(
292 ::
std::
string hostIpAddress,
294 ::
std::function<
void(::ServerConnectivityTestResult)> callback
297 virtual
void _onDisable() ;
299 virtual
void _onEnable() ;
305 MCNAPI RakNetServerLocator(
308 ::
std::vector<::
std::
string> overrideBroadcastAddresses,
310 ::RakNetServerLANVisibility serverLanVisibility,
311 ::PermissionLAN permissionLAN,
312 ::PermissionIPv6 permissionIPv6,
313 ::Bedrock::NonOwnerPointer<::
AppPlatform> const& appPlatform,
314 ::
std::function<::
std::unique_ptr<::RakNet::RakPeerInterface,
void (*)(::RakNet::RakPeerInterface*)>()>
315 createUniqueRakPeerFunc
329 ::LocatorStateChangeRequest newState,
339 ::
std::
string const& data,
340 ::RakNet::
Packet const* p,
341 bool insertAtBeginning,
350 _onPongReceive(
float& latencyToSet, ::RakNet::RakNetGUID const& guid, uint const& receivedTime,
int ipVersion);
386 ::
std::vector<::
std::
string> overrideBroadcastAddresses,
388 ::RakNetServerLANVisibility serverLanVisibility,
389 ::PermissionLAN permissionLAN,
390 ::PermissionIPv6 permissionIPv6,
391 ::Bedrock::NonOwnerPointer<::
AppPlatform> const& appPlatform,
392 ::
std::function<::
std::unique_ptr<::RakNet::RakPeerInterface,
void (*)(::RakNet::RakPeerInterface*)>()>
393 createUniqueRakPeerFunc
407 ::
std::
string const& playerName,
408 ::
std::
string const& worldName,
412 bool isJoinableThroughServerScreen,
437 ::
std::
string hostIpAddress,
439 ::
std::function<
void(::ServerConnectivityTestResult)> callback
Definition AsynchronousIPResolver.h:8
Definition RakNetConnector.h:29
Definition RakNetServerLocator.h:112
Definition RakNetServerLocator.h:134
MCAPI bool pingEnd(uint const &endTime, int ipVersion)
MCAPI void $clearServerList()
MCAPI void $stopAnnouncingServer()
MCAPI bool _onPongReceive(float &latencyToSet, ::RakNet::RakNetGUID const &guid, uint const &receivedTime, int ipVersion)
MCAPI void _addCustomServerFromIpResolver(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void _startServerDiscovery(::PortPair const &ports)
MCAPI void _setPingResponder(::RakNetServerLocator::AnnounceServerData const &serverData)
MCAPI void _stopAnnouncingServer()
MCAPI ::std::vector<::PingedCompatibleServer > $getServerList() const
MCAPI bool _handleUnconnectedPong(::std::string const &data, ::RakNet::Packet const *p, bool insertAtBeginning, uint64 readTime)
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)
MCAPI bool _pingServerV6(::std::string const &address, int port)
MCAPI void _updateState()
MCAPI float $getPingTimeForGUID(::std::string const &guid)
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)
static MCAPI void ** $vftable()
MCAPI void _enqueueStateChangeRequest(::LocatorStateChangeRequest newState, ::RakNetServerLocator::AnnounceServerData newAnnounceData, ::PortPair newPorts)
MCAPI void $startServerDiscovery(::PortPair ports)
MCAPI void _announceServer(::RakNetServerLocator::AnnounceServerData const &serverData)
MCAPI void $addCustomServer(::AsynchronousIPResolver const &futureIP, int port)
MCAPI bool _addCustomServerV6(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void _getServerOriginalAddress(::std::string &originalAddressToSet, ::std::string const &ip)
MCAPI void _startAnnouncingServer(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI bool _updateQueuedPings()
MCAPI void _updateNetwork()
MCAPI void $stopServerDiscovery()
MCAPI bool _pingServerV4(::std::string const &address, int port)
MCAPI void _onPingSend(::std::string const &guid, ::std::string const &ipVersion, int)
MCAPI::std::string _getHostGuid(::std::string const &address, int)
MCAPI bool _addCustomServerV4(::AsynchronousIPResolver const &futureIP, int port)
static MCAPI bool parseUnconnectedPongPacketData(::std::string const &data, ::std::vector<::std::string > &extraData)
MCAPI void _initializeBroadcastAddresses()
MCAPI void _stopServerDiscovery()
MCAPI void $checkCanConnectToCustomServerAsync(::std::string hostIpAddress, int port, ::std::function< void(::ServerConnectivityTestResult)> callback)
Definition RakPeerInterface.h:32
Definition RakPeerHelper.h:15
Definition ServerLocator.h:19
Definition PingedCompatibleServer.h:5
Definition RakNetServerLocator.h:47
MCAPI ~AnnounceServerData()
MCAPI void * $ctor(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore, ::ServerSupportedAuthenticationTypes supportedAuth)
MCAPI AnnounceServerData(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore, ::ServerSupportedAuthenticationTypes supportedAuth)
MCAPI void * $ctor(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI AnnounceServerData(::RakNetServerLocator::AnnounceServerData const &announceData)
Definition RakNetServerLocator.h:162
MCAPI ~StateChangeRequestData()
Definition RakNetServerLocator.h:190
MCAPI ~SuspendStateData()
Definition RakNetGUID.h:7
Definition ServerSupportedAuthenticationTypes.h:5