Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <Authenticator.h>
Classes | |
class | cUser |
Public Member Functions | |
void | Authenticate (int a_ClientID, std::string_view a_Username, std::string_view a_ServerHash) |
Queues a request for authenticating a user. More... | |
cAuthenticator () | |
void | ReadSettings (cSettingsRepositoryInterface &a_Settings) |
(Re-)read server and address from INI: More... | |
void | Start (cSettingsRepositoryInterface &a_Settings) |
Starts the authenticator thread. More... | |
void | Stop (void) |
Stops the authenticator thread. More... | |
virtual | ~cAuthenticator () override |
Public Member Functions inherited from cIsThread | |
cIsThread (AString &&a_ThreadName) | |
bool | IsCurrentThread (void) const |
Returns true if the thread calling this function is the thread contained within this object. More... | |
void | Start (void) |
Starts the thread; returns without waiting for the actual start. More... | |
void | Stop (void) |
Signals the thread to terminate and waits until it's finished. More... | |
virtual | ~cIsThread () |
Private Types | |
using | cUserList = std::deque< cUser > |
using | Super = cIsThread |
Private Member Functions | |
bool | AuthWithYggdrasil (AString &a_UserName, const AString &a_ServerId, cUUID &a_UUID, Json::Value &a_Properties) const |
Returns true if the user authenticated okay, false on error Returns the case-corrected username, UUID, and properties (eg. More... | |
virtual void | Execute (void) override |
cIsThread override: More... | |
Private Attributes | |
AString | m_Address |
The URL to use for auth, without server part. More... | |
cCriticalSection | m_CS |
AString | m_PropertiesAddress |
cUserList | m_Queue |
cEvent | m_QueueNonempty |
AString | m_Server |
The server that is to be contacted for auth / UUID conversions. More... | |
bool | m_ShouldAuthenticate |
Additional Inherited Members | |
Protected Attributes inherited from cIsThread | |
std::atomic< bool > | m_ShouldTerminate |
The overriden Execute() method should check this value periodically and terminate if this is true. More... | |
Definition at line 30 of file Authenticator.h.
|
private |
Definition at line 69 of file Authenticator.h.
|
private |
Definition at line 33 of file Authenticator.h.
cAuthenticator::cAuthenticator | ( | void | ) |
Definition at line 28 of file Authenticator.cpp.
|
overridevirtual |
Definition at line 40 of file Authenticator.cpp.
void cAuthenticator::Authenticate | ( | int | a_ClientID, |
std::string_view | a_Username, | ||
std::string_view | a_ServerHash | ||
) |
Queues a request for authenticating a user.
If the auth fails, the user will be kicked
Definition at line 90 of file Authenticator.cpp.
|
private |
Returns true if the user authenticated okay, false on error Returns the case-corrected username, UUID, and properties (eg.
skin).
Definition at line 176 of file Authenticator.cpp.
|
overrideprivatevirtual |
void cAuthenticator::ReadSettings | ( | cSettingsRepositoryInterface & | a_Settings | ) |
(Re-)read server and address from INI:
Definition at line 49 of file Authenticator.cpp.
void cAuthenticator::Start | ( | cSettingsRepositoryInterface & | a_Settings | ) |
Starts the authenticator thread.
The thread may be started and stopped repeatedly
Definition at line 114 of file Authenticator.cpp.
void cAuthenticator::Stop | ( | void | ) |
Stops the authenticator thread.
The thread may be started and stopped repeatedly
Definition at line 124 of file Authenticator.cpp.
|
private |
The URL to use for auth, without server part.
USERNAME% will be replaced with actual user name. SERVERID% will be replaced with server's ID. For example "/session/minecraft/hasJoined?username=%USERNAME%&serverId=%SERVERID%".
Definition at line 82 of file Authenticator.h.
|
private |
Definition at line 71 of file Authenticator.h.
|
private |
Definition at line 84 of file Authenticator.h.
|
private |
Definition at line 72 of file Authenticator.h.
|
private |
Definition at line 73 of file Authenticator.h.
|
private |
The server that is to be contacted for auth / UUID conversions.
Definition at line 76 of file Authenticator.h.
|
private |
Definition at line 85 of file Authenticator.h.