|
R-Type
Distributed multiplayer game engine in C++
|
Manages active player sessions with authentication support. More...
#include <SessionManager.hpp>


Public Member Functions | |
| SessionManager () | |
| SessionManager (std::shared_ptr< AuthService > authService) | |
| ~SessionManager () override=default | |
| std::shared_ptr< Session > | createSession (const std::string &id) override |
| Create a new session. | |
| std::shared_ptr< Session > | getSession (const std::string &id) override |
| Get session by ID. | |
| void | removeSession (const std::string &id) override |
| Remove session by ID. | |
| std::string | authenticateAndCreateSession (const std::string &username, const std::string &password) |
| Authenticate and create a session. | |
| std::shared_ptr< AuthService > | getAuthService () |
| Get the auth service. | |
Public Member Functions inherited from server::ISessionManager | |
| virtual | ~ISessionManager ()=default |
Private Attributes | |
| std::unordered_map< std::string, std::shared_ptr< Session > > | _sessions |
| std::shared_ptr< AuthService > | _authService |
Manages active player sessions with authentication support.
Definition at line 21 of file SessionManager.hpp.
| server::SessionManager::SessionManager | ( | ) |
Definition at line 13 of file SessionManager.cpp.
|
explicit |
Definition at line 15 of file SessionManager.cpp.
|
overridedefault |
| std::string server::SessionManager::authenticateAndCreateSession | ( | const std::string & | username, |
| const std::string & | password | ||
| ) |
Authenticate and create a session.
| username | Username |
| password | Password |
Definition at line 17 of file SessionManager.cpp.
References _authService, createSession(), LOG_INFO, and LOG_WARNING.

|
overridevirtual |
Create a new session.
| id | Session identifier |
Implements server::ISessionManager.
Definition at line 32 of file SessionManager.cpp.
References _sessions, LOG_INFO, and LOG_WARNING.
Referenced by authenticateAndCreateSession().
|
inline |
Get the auth service.
Definition at line 43 of file SessionManager.hpp.
References _authService.
|
overridevirtual |
Get session by ID.
| id | Session identifier |
Implements server::ISessionManager.
Definition at line 45 of file SessionManager.cpp.
References _sessions.
|
overridevirtual |
Remove session by ID.
| id | Session identifier |
Implements server::ISessionManager.
Definition at line 53 of file SessionManager.cpp.
|
private |
Definition at line 47 of file SessionManager.hpp.
Referenced by authenticateAndCreateSession(), and getAuthService().
|
private |
Definition at line 46 of file SessionManager.hpp.
Referenced by createSession(), getSession(), and removeSession().