Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
Connector.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/network/TransportLayer.h"
7#include "mc/network/connection/DisconnectFailReason.h"
8
9// auto generated forward declare list
10// clang-format off
12class NetworkPeer;
13class WebKey;
14namespace Json { class Value; }
15namespace Social { class GameConnectionInfo; }
16namespace Social { struct ResolvedExperienceInfo; }
17// clang-format on
18
19class Connector {
20public:
21 // Connector inner types declare
22 // clang-format off
24 // clang-format on
25
26 // Connector inner types define
28 public:
29 // virtual functions
30 // NOLINTBEGIN
31 virtual ~ConnectionCallbacks() = default;
32
33 virtual bool onNewIncomingConnection(
34 ::NetworkIdentifier const& id,
35 ::std::shared_ptr<::NetworkPeer>&& peer,
36 ::std::optional<::WebKey> identityPublicKey
37 ) = 0;
38
39 virtual bool
40 onNewOutgoingConnection(::NetworkIdentifier const& id, ::std::shared_ptr<::NetworkPeer>&& peer) = 0;
41
42 virtual void onConnectionClosed(
43 ::NetworkIdentifier const& id,
44 ::Connection::DisconnectFailReason const discoReason,
45 ::std::string const& messageFromServer,
46 ::std::string const& messageBodyOverride,
47 bool skipDisconnectMessage,
48 ::Json::Value const& sessionSummary
49 ) = 0;
50 // NOLINTEND
51 };
52
53public:
54 // member variables
55 // NOLINTBEGIN
56 ::ll::TypedStorage<8, 8, ::Connector::ConnectionCallbacks&> mCallbacks;
57 // NOLINTEND
58
59public:
60 // prevent constructor by default
61 Connector& operator=(Connector const&);
62 Connector(Connector const&);
63 Connector();
64
65public:
66 // virtual functions
67 // NOLINTBEGIN
68 virtual ~Connector() = default;
69
70 virtual ::std::string getLocalIp();
71
72 virtual ushort getPort() const;
73
74 virtual ::Social::GameConnectionInfo const& getConnectedGameInfo() const;
75
76 virtual void
77 setConnectedResolvedExperienceInfo(::std::optional<::Social::ResolvedExperienceInfo> const& resolvedExperienceInfo);
78
79 virtual bool isIPv4Supported() const;
80
81 virtual bool isIPv6Supported() const;
82
83 virtual ushort getIPv4Port() const;
84
85 virtual ushort getIPv6Port() const;
86
87 virtual ::TransportLayer getNetworkType() const;
88 // NOLINTEND
89
90public:
91 // virtual function thunks
92 // NOLINTBEGIN
93 MCNAPI ::std::string $getLocalIp();
94
95 MCNAPI ushort $getPort() const;
96
97 MCNAPI ::Social::GameConnectionInfo const& $getConnectedGameInfo() const;
98
100 ::std::optional<::Social::ResolvedExperienceInfo> const& resolvedExperienceInfo
101 );
102
103 MCNAPI bool $isIPv4Supported() const;
104
105 MCNAPI bool $isIPv6Supported() const;
106
107 MCNAPI ushort $getIPv4Port() const;
108
109 MCNAPI ushort $getIPv6Port() const;
110
111 MCNAPI ::TransportLayer $getNetworkType() const;
112
113
114 // NOLINTEND
115
116public:
117 // vftables
118 // NOLINTBEGIN
119 MCNAPI static void** $vftable();
120 // NOLINTEND
121};
MCAPI ushort $getPort() const
MCAPI::Social::GameConnectionInfo const & $getConnectedGameInfo() const
MCAPI::TransportLayer $getNetworkType() const
MCAPI bool $isIPv6Supported() const
MCAPI::std::string $getLocalIp()
MCAPI bool $isIPv4Supported() const
MCAPI ushort $getIPv6Port() const
static MCAPI void ** $vftable()
MCAPI ushort $getIPv4Port() const
MCAPI void $setConnectedResolvedExperienceInfo(::std::optional<::Social::ResolvedExperienceInfo > const &resolvedExperienceInfo)
Definition Value.h:16
Definition NetworkIdentifier.h:10
Definition NetworkPeer.h:8
Definition GameConnectionInfo.h:24
Definition WebKey.h:13
Definition Connector.h:27
Definition ResolvedExperienceInfo.h:7