Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ServerLocatorComposite.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/network/PermissionIPv6.h"
8#include "mc/network/PermissionLAN.h"
9#include "mc/network/RakNetServerLANVisibility.h"
10#include "mc/network/RakPeerHelper.h"
11#include "mc/network/ServerConnectivityTestResult.h"
12#include "mc/network/StubServerLocator.h"
13#include "mc/platform/brstd/copyable_function.h"
14#include "mc/world/level/GameType.h"
15
16// auto generated forward declare list
17// clang-format off
18class AppPlatform;
21class RakNetConnector;
25struct PortPair;
27namespace Bedrock::Http { class DispatcherInterface; }
28namespace Bedrock::PubSub { class Subscription; }
29namespace Social { struct Nonce; }
30// clang-format on
31
32class ServerLocatorComposite : public ::StubServerLocator {
33public:
34 // member variables
35 // NOLINTBEGIN
39 // NOLINTEND
40
41public:
42 // prevent constructor by default
43 ServerLocatorComposite& operator=(ServerLocatorComposite const&);
44 ServerLocatorComposite(ServerLocatorComposite const&);
45 ServerLocatorComposite();
46
47public:
48 // virtual functions
49 // NOLINTBEGIN
50 virtual ~ServerLocatorComposite() /*override*/ = default;
51
52 virtual void startAnnouncingServer(
53 ::std::string const& playerName,
54 ::std::string const& worldName,
55 ::GameType worldGameType,
56 int numPlayers,
57 int maxNumPlayers,
58 bool isJoinableThroughServerScreen,
59 bool isEditorWorld,
60 bool isHardcore,
62 ::Social::Nonce const& nonce
63 ) /*override*/;
64
65 virtual void stopAnnouncingServer() /*override*/;
66
67 virtual void startServerDiscovery(::PortPair ports) /*override*/;
68
69 virtual void stopServerDiscovery() /*override*/;
70
71 virtual void addCustomServer(::AsynchronousIPResolver const& futureIP, int port) /*override*/;
72
73 virtual ::Bedrock::PubSub::Subscription acquireHttpProbePermission() /*override*/;
74
75 virtual ::std::vector<::PingedCompatibleServer> getServerList() const /*override*/;
76
77 virtual ::std::shared_ptr<::TransportEndpointCache> getTransportEndpointCache() const /*override*/;
78
79 virtual void update() /*override*/;
80
81 virtual ::std::chrono::milliseconds getPingTimeForGUID(::std::string const& guid) /*override*/;
82
83 virtual void checkCanConnectToCustomServerAsync(
84 ::std::string hostIpAddress,
85 int port,
86 ::std::function<void(::ServerConnectivityTestResult)> callback
87 ) /*override*/;
88
89 virtual void _onDisable() /*override*/;
90
91 virtual void _onEnable() /*override*/;
92 // NOLINTEND
93
94public:
95 // member functions
96 // NOLINTBEGIN
97#ifdef LL_PLAT_C
98 MCNAPI ServerLocatorComposite(
99 ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner> networkSessionOwner,
100 ::brstd::copyable_function<bool() const> isNetworkAllowed
101 );
102
103 MCNAPI void initializeNetherNetServerLocator(
104 ::Bedrock::NotNullNonOwnerPtr<::NetherNetConnector>&& connector,
106 ::Bedrock::NotNullNonOwnerPtr<::Bedrock::Http::DispatcherInterface> dispatcher
107 );
108
109 MCNAPI void initializeRakNetServerLocator(
110 ::RakNetConnector& rakNetConnector,
112 ::std::vector<::std::string> overrideBroadcastAddresses,
113 bool isServer,
114 ::RakNetServerLANVisibility lanDiscoveryStatus,
115 ::PermissionLAN permissionLAN,
116 ::PermissionIPv6 permissionIPv6,
118 );
119#endif
120 // NOLINTEND
121
122public:
123 // constructor thunks
124 // NOLINTBEGIN
125#ifdef LL_PLAT_C
126 MCNAPI void* $ctor(
127 ::Bedrock::NotNullNonOwnerPtr<::NetworkSessionOwner> networkSessionOwner,
128 ::brstd::copyable_function<bool() const> isNetworkAllowed
129 );
130#endif
131 // NOLINTEND
132
133public:
134 // virtual function thunks
135 // NOLINTBEGIN
136#ifdef LL_PLAT_C
137 MCNAPI void $startAnnouncingServer(
138 ::std::string const& playerName,
139 ::std::string const& worldName,
140 ::GameType worldGameType,
141 int numPlayers,
142 int maxNumPlayers,
143 bool isJoinableThroughServerScreen,
144 bool isEditorWorld,
145 bool isHardcore,
147 ::Social::Nonce const& nonce
148 );
149
150 MCNAPI void $stopAnnouncingServer();
151
152 MCNAPI void $startServerDiscovery(::PortPair ports);
153
154 MCNAPI void $stopServerDiscovery();
155
156 MCNAPI void $addCustomServer(::AsynchronousIPResolver const& futureIP, int port);
157
158 MCNAPI ::Bedrock::PubSub::Subscription $acquireHttpProbePermission();
159
160 MCNAPI ::std::vector<::PingedCompatibleServer> $getServerList() const;
161
162 MCNAPI ::std::shared_ptr<::TransportEndpointCache> $getTransportEndpointCache() const;
163
164 MCNAPI void $update();
165
166 MCNAPI ::std::chrono::milliseconds $getPingTimeForGUID(::std::string const& guid);
167
169 ::std::string hostIpAddress,
170 int port,
171 ::std::function<void(::ServerConnectivityTestResult)> callback
172 );
173
174 MCNAPI void $_onDisable();
175
176 MCNAPI void $_onEnable();
177#endif
178
179
180 // NOLINTEND
181};
Definition AppPlatform.h:79
Definition AsynchronousIPResolver.h:5
Definition DispatcherInterface.h:17
Definition NonOwnerPointer.h:9
Definition Subscription.h:10
Definition NetworkSessionOwner.h:9
Definition RakNetConnector.h:30
Definition RakPeerHelper.h:35
MCAPI void $_onEnable()
MCAPI ::std::shared_ptr<::TransportEndpointCache > $getTransportEndpointCache() const
MCAPI::Bedrock::PubSub::Subscription $acquireHttpProbePermission()
MCAPI void $_onDisable()
Definition StubServerLocator.h:19
MCAPI void $stopAnnouncingServer()
MCAPI::std::chrono::milliseconds $getPingTimeForGUID(::std::string const &guid)
MCAPI void $checkCanConnectToCustomServerAsync(::std::string hostIpAddress, int port, ::std::function< void(::ServerConnectivityTestResult)> callback)
MCAPI void $addCustomServer(::AsynchronousIPResolver const &futureIP, int port)
MCAPI void $startServerDiscovery(::PortPair ports)
MCAPI ::std::vector<::PingedCompatibleServer > $getServerList() const
MCAPI void $startAnnouncingServer(::std::string const &playerName, ::std::string const &worldName, ::GameType worldGameType, int numPlayers, int maxNumPlayers, bool isJoinableThroughServerScreen, bool isEditorWorld, bool isHardcore, ::ServerSupportedAuthenticationTypes supportedAuth, ::Social::Nonce const &nonce)
MCAPI void $update()
MCAPI void $stopServerDiscovery()
Definition TransportEndpointCache.h:8
Definition copyable_function.h:8
Definition NetherNetConnector.h:31
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition ServerSupportedAuthenticationTypes.h:5
Definition Nonce.h:10
Definition Alias.h:14