LeviLamina
Loading...
Searching...
No Matches
NetworkIdentifier.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/raknet/RakNetGUID.h"
5
6// auto generated inclusion list
7#include "mc/deps/nether_net/NetworkID.h"
8#include "mc/deps/raknet/RakNetGUID.h"
9
10class NetworkIdentifier {
11public:
12 // NetworkIdentifier inner types define
13 enum class Type : int {
14 RakNet = 0,
15 Address = 1,
16 Address6 = 2,
17 NetherNet = 3,
18 Invalid = 4,
19 };
20
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::NetherNet::NetworkID mNetherNetId;
27 ::NetworkIdentifier::Type mType;
28 // NOLINTEND
29
30public:
31 LLNDAPI std::string getIPAndPort() const;
32
33 [[nodiscard]] bool operator==(::NetworkIdentifier const& other) const { return equalsTypeData(other); }
34
35public:
36 NetworkIdentifier(::NetworkIdentifier const& other) = default;
37 NetworkIdentifier() = default;
38
39public:
40 // member functions
41 // NOLINTBEGIN
42 MCAPI explicit NetworkIdentifier(::sockaddr_in6 const& address);
43
44 MCAPI explicit NetworkIdentifier(::sockaddr_in const& address);
45
46 MCAPI explicit NetworkIdentifier(::RakNet::RakNetGUID const& guid);
47
48 MCAPI explicit NetworkIdentifier(::NetherNet::NetworkID const& nethernetId);
49
50 MCAPI bool equalsTypeData(::NetworkIdentifier const& other) const;
51
52 MCAPI ::std::string getAddress() const;
53
54 MCAPI ::std::string getCorrelationId() const;
55
56 MCAPI uint64 getHash() const;
57
58#ifdef LL_PLAT_C
59 MCAPI ::std::string getNetherNetIDAsString() const;
60
61 MCFOLD ::NetherNet::NetworkID const& getNetherNetId() const;
62#endif
63
64 MCAPI ::std::string getNetherNetOrRakNetIDAsString() const;
65
66 MCFOLD ::RakNet::RakNetGUID const& getRakNetGUID() const;
67
68 MCFOLD ::sockaddr_in const& getSocketAddress() const;
69
70 MCFOLD ::sockaddr_in6 const& getSocketAddress6() const;
71
72 MCFOLD ::NetworkIdentifier::Type getType() const;
73
74#ifdef LL_PLAT_C
75 MCAPI bool isType(::NetworkIdentifier::Type type) const;
76#endif
77
78 MCAPI bool isUnassigned() const;
79
80 MCAPI ::std::string toString() const;
81 // NOLINTEND
82
83public:
84 // static functions
85 // NOLINTBEGIN
86#ifdef LL_PLAT_C
87 MCAPI static ::std::string calculateCorrelationId(::NetherNet::NetworkID const& netherNetId);
88#endif
89
90 MCAPI static ::std::string calculateCorrelationId(::RakNet::RakNetGUID const& rakId);
91 // NOLINTEND
92
93public:
94 // static variables
95 // NOLINTBEGIN
96 MCAPI static ::NetworkIdentifier& INVALID_ID();
97 // NOLINTEND
98
99public:
100 // constructor thunks
101 // NOLINTBEGIN
102 MCAPI void* $ctor();
103
104 MCAPI void* $ctor(::sockaddr_in6 const& address);
105
106 MCAPI void* $ctor(::sockaddr_in const& address);
107
108 MCAPI void* $ctor(::RakNet::RakNetGUID const& guid);
109
110 MCAPI void* $ctor(::NetherNet::NetworkID const& nethernetId);
111 // NOLINTEND
112};
113
114namespace std {
115template <>
116struct hash<NetworkIdentifier> {
117 size_t operator()(NetworkIdentifier const& d) const noexcept { return d.getHash(); }
118};
119} // namespace std
Definition NetworkIdentifier.h:10
STL namespace.
Definition NetworkID.h:17
Definition RakNetGUID.h:7
Definition Alias.h:14