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"
25namespace RakNet {
struct Packet; }
41 enum class protocolVersion :
int {
46 struct AnnounceServerData {
70 ::std::string
const& playerName,
71 ::std::string
const& worldName,
75 bool isJoinableThroughServerScreen,
91 ::std::string
const& playerName,
92 ::std::string
const& worldName,
96 bool isJoinableThroughServerScreen,
109 class NatHolePuncherFunctor {
118 NatHolePuncherFunctor& operator=(NatHolePuncherFunctor
const&);
119 NatHolePuncherFunctor(NatHolePuncherFunctor
const&);
120 NatHolePuncherFunctor();
123 class PingRateRecorder {
140 PingRateRecorder& operator=(PingRateRecorder
const&);
141 PingRateRecorder(PingRateRecorder
const&);
145 struct StateChangeRequestData {
156 StateChangeRequestData& operator=(StateChangeRequestData
const&);
157 StateChangeRequestData(StateChangeRequestData
const&);
158 StateChangeRequestData();
173 struct SuspendStateData {
184 SuspendStateData& operator=(SuspendStateData
const&);
185 SuspendStateData(SuspendStateData
const&);
235 RakNetServerLocator& operator=(RakNetServerLocator
const&);
236 RakNetServerLocator(RakNetServerLocator
const&);
237 RakNetServerLocator();
242 virtual ~RakNetServerLocator() ;
244 virtual void startAnnouncingServer(
245 ::std::string
const& playerName,
246 ::std::string
const& worldName,
251 bool isJoinableThroughServerScreen,
258 virtual void startServerDiscovery(
::PortPair ports) ;
260 virtual void stopServerDiscovery() ;
264 virtual void addCustomServer(::std::string
const& address,
int port) ;
266 virtual ::std::vector<::PingedCompatibleServer> getServerList() const ;
268 virtual
void clearServerList() ;
270 virtual
void update() ;
272 virtual
float getPingTimeForGUID(::
std::
string const& guid) ;
274 virtual
void checkCanConnectToCustomServerAsync(
275 ::
std::
string hostIpAddress,
277 ::
std::function<
void(::ServerConnectivityTestResult)> callback
280 virtual
void _onDisable() ;
282 virtual
void _onEnable() ;
288 MCNAPI RakNetServerLocator(
291 ::
std::vector<::
std::
string> overrideBroadcastAddresses,
293 ::RakNetServerLANVisibility serverLanVisibility,
294 ::PermissionLAN permissionLAN,
295 ::PermissionIPv6 permissionIPv6,
296 ::Bedrock::NonOwnerPointer<::
AppPlatform> const& appPlatform,
297 ::
std::function<::
std::unique_ptr<::RakNet::RakPeerInterface,
void (*)(::RakNet::RakPeerInterface*)>()>
298 createUniqueRakPeerFunc
312 ::LocatorStateChangeRequest newState,
322 ::
std::
string const& data,
323 ::RakNet::
Packet const* p,
324 bool insertAtBeginning,
333 _onPongReceive(
float& latencyToSet, ::RakNet::RakNetGUID const& guid, uint const& receivedTime,
int ipVersion);
335 MCNAPI_C
void _punchHoles();
367 ::
std::vector<::
std::
string> overrideBroadcastAddresses,
369 ::RakNetServerLANVisibility serverLanVisibility,
370 ::PermissionLAN permissionLAN,
371 ::PermissionIPv6 permissionIPv6,
372 ::Bedrock::NonOwnerPointer<::
AppPlatform> const& appPlatform,
373 ::
std::function<::
std::unique_ptr<::RakNet::RakPeerInterface,
void (*)(::RakNet::RakPeerInterface*)>()>
374 createUniqueRakPeerFunc
388 ::
std::
string const& playerName,
389 ::
std::
string const& worldName,
390 ::Bedrock::NonOwnerPointer<::
AppPlatform> appPlatform,
394 bool isJoinableThroughServerScreen,
418 ::
std::
string hostIpAddress,
420 ::
std::function<
void(::ServerConnectivityTestResult)> callback
Definition AsynchronousIPResolver.h:5
Definition NonOwnerPointer.h:9
Definition RakNetConnector.h:29
Definition RakNetServerLocator.h:109
Definition RakNetServerLocator.h:123
MCAPI void _onPingSend(::std::string const &guid, ::std::string const &addr, int ipVersion)
MCAPI void $clearServerList()
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 _updateState()
MCAPI float $getPingTimeForGUID(::std::string const &guid)
MCAPI void $stopAnnouncingServer(::Bedrock::NonOwnerPointer<::AppPlatform > appPlatform)
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::std::string _getHostGuid(::std::string const &address, int port)
MCAPI void $addCustomServer(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void $startAnnouncingServer(::std::string const &playerName, ::std::string const &worldName, ::Bedrock::NonOwnerPointer<::AppPlatform > appPlatform, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore)
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 _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:46
MCAPI AnnounceServerData(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore)
MCAPI ~AnnounceServerData()
MCAPI::RakNetServerLocator::AnnounceServerData & operator=(::RakNetServerLocator::AnnounceServerData const &)
MCAPI void * $ctor(::std::string const &playerName, ::std::string const &worldName, ::GameType gameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore)
MCAPI void * $ctor(::RakNetServerLocator::AnnounceServerData const &announceData)
MCAPI AnnounceServerData(::RakNetServerLocator::AnnounceServerData const &announceData)
Definition RakNetServerLocator.h:145
MCAPI ~StateChangeRequestData()
Definition RakNetServerLocator.h:173
MCAPI ~SuspendStateData()
Definition RakNetGUID.h:7