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
35 NetworkIdentifier(::NetworkIdentifier const& other) = default;
36
37 NetworkIdentifier() = default;
38
39public:
40 // member functions
41 // NOLINTBEGIN
42 MCAPI bool equalsTypeData(::NetworkIdentifier const& other) const;
43
44 MCAPI ::std::string getAddress() const;
45
46 MCAPI ::std::string getCorrelationId() const;
47
48 MCAPI uint64 getHash() const;
49
50 MCAPI ::std::string getNetherNetOrRakNetIDAsString() const;
51
52 MCAPI bool isUnassigned() const;
53
54 MCAPI bool operator<(::NetworkIdentifier const& other) const;
55
56 MCAPI ::NetworkIdentifier& operator=(::NetworkIdentifier&&);
57
58 MCAPI ::std::string toString() const;
59 // NOLINTEND
60
61public:
62 // static functions
63 // NOLINTBEGIN
64 MCAPI static ::std::string calculateCorrelationId(::RakNet::RakNetGUID const& rakId);
65 // NOLINTEND
66
67public:
68 // static variables
69 // NOLINTBEGIN
70 MCAPI static ::NetworkIdentifier& INVALID_ID();
71 // NOLINTEND
72};
73
74namespace std {
75template <>
76struct hash<NetworkIdentifier> {
77 size_t operator()(NetworkIdentifier const& d) const noexcept { return d.getHash(); }
78};
79} // namespace std
Definition NetworkIdentifier.h:10
STL namespace.
Definition NetworkID.h:17
Definition RakNetGUID.h:7
Definition Alias.h:14