|
Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
|
MinecraftUUID compliant data holder. More...
#include <uuid.h>
Public Member Functions | |
| MinecraftUUID () | |
| Construct a new MinecraftUUID object. | |
| bool | operator== (const MinecraftUUID &other) |
| Equality operator. | |
| std::string | getFull () const |
| Get the hex of the MinecraftUUID with hyphens. | |
| std::string | getTrimmed () const |
| Get the hex of the MinecraftUUID without hyphens. | |
| const std::byte * | getBytes () const |
| Get the raw bytes of the MinecraftUUID. | |
Static Public Member Functions | |
| static MinecraftUUID | newRandom () |
| Constructs a new random MinecraftUUID. | |
| static MinecraftUUID | fromUsername (const std::string &name) |
| Constructs an MinecraftUUID from an username. | |
| static MinecraftUUID | fromHex (const std::string &hexString) |
| Contructs an MinecraftUUID from an hex string. | |
| static MinecraftUUID | fromBytes (const std::byte *buff) |
| Constructs an MinecraftUUID from the raw bytes. | |
| static void | loadLua (lua_State *state, const char *namespaceName) |
| Loads MinecraftUUID to the lua state. | |
MinecraftUUID compliant data holder.
Data holder for an RFC 4122 compliant MinecraftUUID.
| MinecraftUUID::MinecraftUUID | ( | ) |
Construct a new MinecraftUUID object.
In reality, just a wrapper around newRandom()
|
static |
Constructs an MinecraftUUID from the raw bytes.
| buff | a pointer to the MinecraftUUID |
|
static |
Contructs an MinecraftUUID from an hex string.
Interprets the hex string as an MinecraftUUID, whether it contains hyphens or not.
| hexString | the string to construct from |
|
static |
Constructs an MinecraftUUID from an username.
In reality, uses MD5 to generate a sequence of hex characters so that we can interpret the digested name as an MinecraftUUID. It is then a deterministic function. See more at crypto::md5Digest
| name | the name to generate from |
| const std::byte * MinecraftUUID::getBytes | ( | ) | const |
Get the raw bytes of the MinecraftUUID.
| std::string MinecraftUUID::getFull | ( | ) | const |
Get the hex of the MinecraftUUID with hyphens.
It will resemble something such as :
| std::string MinecraftUUID::getTrimmed | ( | ) | const |
Get the hex of the MinecraftUUID without hyphens.
It will resemble something such as :
Loads MinecraftUUID to the lua state.
| state | the lua state to load to |
| namespaceName | the namespace to load to |
|
static |
Constructs a new random MinecraftUUID.
| bool MinecraftUUID::operator== | ( | const MinecraftUUID & | other | ) |
Equality operator.
| other | the other member |