Skip to content
LeviMC
English
AutoLightDark
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 bool equalsTypeData(::NetworkIdentifier const& other) const;
43
44 MCAPI ::std::string getAddress() const;
45
46 MCNAPI ::std::string getCorrelationId() const;
47
48 MCAPI uint64 getHash() const;
49
50 MCNAPI bool isUnassigned() const;
51
52 MCAPI ::std::string toString() const;
53 // NOLINTEND
54
55public:
56 // static functions
57 // NOLINTBEGIN
58 MCNAPI static ::std::string calculateCorrelationId(::RakNet::RakNetGUID const& rakId);
59 // NOLINTEND
60
61public:
62 // static variables
63 // NOLINTBEGIN
64 MCAPI static ::NetworkIdentifier& INVALID_ID();
65 // NOLINTEND
66};
67
68namespace std {
69template <>
70struct hash<NetworkIdentifier> {
71 size_t operator()(NetworkIdentifier const& d) const noexcept { return d.getHash(); }
72};
73} // namespace std
Definition NetworkIdentifier.h:10
MCAPI bool isUnassigned() const
MCAPI::std::string getCorrelationId() const
static MCAPI ::std::string calculateCorrelationId(::RakNet::RakNetGUID const &rakId)
STL namespace.
Definition NetworkID.h:17
Definition RakNetGUID.h:7
Definition Alias.h:14