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
15struct PortPair;
17namespace Social { struct Nonce; }
18// clang-format on
19
20class ServerLocator : public ::NetworkEnableDisableListener {
21public:
22 // virtual functions
23 // NOLINTBEGIN
24 virtual ~ServerLocator() /*override*/ = default;
25
26 virtual void startAnnouncingServer(
27 ::std::string const& playerName,
28 ::std::string const& worldName,
29 ::GameType gameType,
30 int numPlayers,
31 int maxNumPlayers,
32 bool isJoinableThroughServerScreen,
33 bool isEditorWorld,
34 bool isHardcore,
36 ::Social::Nonce const& nonce
37 ) = 0;
38
39 virtual void stopAnnouncingServer() = 0;
40
41 virtual void startServerDiscovery(::PortPair ports) = 0;
42
43 virtual void stopServerDiscovery() = 0;
44
45 virtual void addCustomServer(::AsynchronousIPResolver const& futureIP, int port) = 0;
46
47 virtual ::std::vector<::PingedCompatibleServer> getServerList() const = 0;
48
49 virtual void update() = 0;
50
51 virtual ::std::chrono::milliseconds getPingTimeForGUID(::std::string const& guid) = 0;
52
53 virtual void checkCanConnectToCustomServerAsync(
54 ::std::string hostIpAddress,
55 int port,
56 ::std::function<void(::ServerConnectivityTestResult)> callback
57 ) = 0;
58
59 virtual void _onDisable() /*override*/;
60
61 virtual void _onEnable() /*override*/;
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67#ifdef LL_PLAT_C
68 MCNAPI ::Bedrock::Threading::Async<::ServerConnectivityTestResult>
69 checkCanConnectToCustomServerAsync(::std::string const& hostIpAddress, int port);
70#endif
71 // NOLINTEND
72
73public:
74 // virtual function thunks
75 // NOLINTBEGIN
76 MCNAPI void $_onDisable();
77
78 MCNAPI void $_onEnable();
79
80
81 // NOLINTEND
82};
Definition AsynchronousIPResolver.h:5
Definition ServerLocator.h:20
MCAPI void $_onEnable()
MCAPI void $_onDisable()
Definition PingedCompatibleServer.h:5
Definition PortPair.h:5
Definition ServerSupportedAuthenticationTypes.h:5
Definition Nonce.h:10