Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ServerLocator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/threading/Async.h"
7#include "mc/network/NetworkEnableDisableListener.h"
8#include "mc/network/ServerConnectivityTestResult.h"
9#include "mc/world/level/GameType.h"
10
11// auto generated forward declare list
12// clang-format off
16struct PortPair;
18namespace Bedrock::PubSub { class Subscription; }
19namespace Social { struct Nonce; }
20// clang-format on
21
22class ServerLocator : public ::NetworkEnableDisableListener {
23public:
24 // virtual functions
25 // NOLINTBEGIN
26 virtual ~ServerLocator() /*override*/ = default;
27
28 virtual ::std::shared_ptr<::TransportEndpointCache> getTransportEndpointCache() const;
29
30#ifdef LL_PLAT_S
31 virtual void startAnnouncingServer(
32 ::std::string const& playerName,
33 ::std::string const& worldName,
34 ::GameType gameType,
35 int numPlayers,
36 int maxNumPlayers,
37 bool isJoinableThroughServerScreen,
38 bool isEditorWorld,
39 bool isHardcore,
41 ::Social::Nonce const& nonce
42 ) = 0;
43#else // LL_PLAT_C
44 virtual void startAnnouncingServer(
45 ::std::string const& playerName,
46 ::std::string const& worldName,
47 ::GameType worldGameType,
48 int numPlayers,
49 int maxNumPlayers,
50 bool isJoinableThroughServerScreen,
51 bool isEditorWorld,
52 bool isHardcore,
54 ::Social::Nonce const& nonce
55 ) = 0;
56#endif
57
58 virtual void stopAnnouncingServer() = 0;
59
60 virtual void startServerDiscovery(::PortPair ports) = 0;
61
62 virtual void stopServerDiscovery() = 0;
63
64 virtual void addCustomServer(::AsynchronousIPResolver const& futureIP, int port) = 0;
65
66 virtual ::Bedrock::PubSub::Subscription acquireHttpProbePermission();
67
68 virtual ::std::vector<::PingedCompatibleServer> getServerList() const = 0;
69
70 virtual void update() = 0;
71
72 virtual ::std::chrono::milliseconds getPingTimeForGUID(::std::string const& guid) = 0;
73
74 virtual void checkCanConnectToCustomServerAsync(
75 ::std::string hostIpAddress,
76 int port,
77 ::std::function<void(::ServerConnectivityTestResult)> callback
78 ) = 0;
79
80 virtual void _onDisable() /*override*/;
81
82 virtual void _onEnable() /*override*/;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88#ifdef LL_PLAT_C
89 MCNAPI ::Bedrock::Threading::Async<::ServerConnectivityTestResult>
90 checkCanConnectToCustomServerAsync(::std::string const& hostIpAddress, int port);
91#endif
92 // NOLINTEND
93
94public:
95 // virtual function thunks
96 // NOLINTBEGIN
97 MCNAPI ::std::shared_ptr<::TransportEndpointCache> $getTransportEndpointCache() const;
98
99 MCNAPI ::Bedrock::PubSub::Subscription $acquireHttpProbePermission();
100
101 MCNAPI void $_onDisable();
102
103 MCNAPI void $_onEnable();
104
105
106 // NOLINTEND
107};
Definition AsynchronousIPResolver.h:5
Definition Subscription.h:10
Definition ServerLocator.h:22
MCAPI void $_onEnable()
MCAPI ::std::shared_ptr<::TransportEndpointCache > $getTransportEndpointCache() const
MCAPI::Bedrock::PubSub::Subscription $acquireHttpProbePermission()
MCAPI void $_onDisable()
Definition TransportEndpointCache.h:8
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition ServerSupportedAuthenticationTypes.h:5
Definition Nonce.h:10