gauthd
 
Loading...
Searching...
No Matches
GNET::GAuthServer Class Reference

Main authentication server class handling sessions and user validation. More...

#include <gauthserver.hpp>

Inheritance diagram for GNET::GAuthServer:
Collaboration diagram for GNET::GAuthServer:

Public Types

typedef std::map< int, UserInfoUserMap
 Map для хранения информации о пользователях (userid -> UserInfo).
 
typedef std::map< int, unsigned int > AccountingMap
 Map для учета времени онлайн (userid -> время в секундах).
 
typedef std::map< unsigned int, char > ZoneMap
 Map для связи сессий и зон (session id -> zoneid).
 

Public Member Functions

std::string Identification () const
 Идентификатор протокола.
 
void SetAccumulate (size_t size)
 Установить лимит накопления данных.
 
 GAuthServer ()
 Конструктор по умолчанию.
 
bool ValidUser (Session::ID sid, int userid)
 Проверить валидность пользователя.
 
void SetSidIdx (int idx)
 Установить индекс аутентификации.
 
int GetSidIdx ()
 Получить индекс аутентификации.
 

Static Public Member Functions

static GAuthServerGetInstance ()
 Получить экземпляр синглтона.
 

Public Attributes

Octets shared_key
 Общий ключ для шифрования.
 
Thread::RWLock locker_map
 Блокировка для доступа к usermap.
 
UserMap usermap
 Контейнер с данными пользователей.
 
Thread::Mutex locker_accntmap
 Блокировка для доступа к accntmap.
 
AccountingMap accntmap
 Контейнер с данными о времени онлайн.
 
Thread::Mutex locker_zonemap
 Блокировка для доступа к zonemap.
 
ZoneMap zonemap
 Контейнер с данными о зонах.
 

Detailed Description

Main authentication server class handling sessions and user validation.

Класс-менеджер для управления аутентификацией и сессиями пользователей.

Singleton instance managing client sessions, zone mappings, and user authentication.

Definition at line 44 of file gauthserver.hpp.

Member Typedef Documentation

◆ AccountingMap

typedef std::map<int, unsigned int> GNET::GAuthServer::AccountingMap

Map для учета времени онлайн (userid -> время в секундах).

Definition at line 136 of file gauthserver.hpp.

◆ UserMap

typedef std::map<int, UserInfo> GNET::GAuthServer::UserMap

Map для хранения информации о пользователях (userid -> UserInfo).

Definition at line 115 of file gauthserver.hpp.

◆ ZoneMap

typedef std::map<unsigned int, char> GNET::GAuthServer::ZoneMap

Map для связи сессий и зон (session id -> zoneid).

Definition at line 145 of file gauthserver.hpp.

Constructor & Destructor Documentation

◆ GAuthServer()

GNET::GAuthServer::GAuthServer ( )
inline

Конструктор по умолчанию.

Definition at line 97 of file gauthserver.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ GetInstance()

static GAuthServer * GNET::GAuthServer::GetInstance ( )
inlinestatic

Получить экземпляр синглтона.

Returns
Указатель на GAuthServer.

Definition at line 80 of file gauthserver.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSidIdx()

int GNET::GAuthServer::GetSidIdx ( )
inline

Получить индекс аутентификации.

Returns
Текущий индекс.

Definition at line 128 of file gauthserver.hpp.

◆ Identification()

std::string GNET::GAuthServer::Identification ( ) const
inline

Идентификатор протокола.

Returns
Строка "GAuthServer".

Definition at line 86 of file gauthserver.hpp.

Here is the caller graph for this function:

◆ SetAccumulate()

void GNET::GAuthServer::SetAccumulate ( size_t size)
inline

Установить лимит накопления данных.

Parameters
sizeНовый лимит.

Definition at line 92 of file gauthserver.hpp.

Here is the caller graph for this function:

◆ SetSidIdx()

void GNET::GAuthServer::SetSidIdx ( int idx)
inline

Установить индекс аутентификации.

Parameters
idxНовый индекс.

Definition at line 122 of file gauthserver.hpp.

◆ ValidUser()

bool GNET::GAuthServer::ValidUser ( Session::ID sid,
int userid )

Проверить валидность пользователя.

Validates user-session association.

Parameters
sidИдентификатор сессии.
useridИдентификатор пользователя.
Returns
true если пользователь валиден, иначе false.
Parameters
sidSession ID to validate.
useridUser ID to check.
Returns
true if user exists and is bound to the specified session, false otherwise.

Uses read lock for thread-safe access to usermap.

Definition at line 65 of file gauthserver.cpp.

Member Data Documentation

◆ accntmap

AccountingMap GNET::GAuthServer::accntmap

Контейнер с данными о времени онлайн.

Definition at line 137 of file gauthserver.hpp.

◆ locker_accntmap

Thread::Mutex GNET::GAuthServer::locker_accntmap

Блокировка для доступа к accntmap.

Definition at line 130 of file gauthserver.hpp.

◆ locker_map

Thread::RWLock GNET::GAuthServer::locker_map

Блокировка для доступа к usermap.

Definition at line 109 of file gauthserver.hpp.

◆ locker_zonemap

Thread::Mutex GNET::GAuthServer::locker_zonemap

Блокировка для доступа к zonemap.

Definition at line 139 of file gauthserver.hpp.

◆ shared_key

Octets GNET::GAuthServer::shared_key

Общий ключ для шифрования.

Definition at line 99 of file gauthserver.hpp.

◆ usermap

UserMap GNET::GAuthServer::usermap

Контейнер с данными пользователей.

Definition at line 116 of file gauthserver.hpp.

◆ zonemap

ZoneMap GNET::GAuthServer::zonemap

Контейнер с данными о зонах.

Definition at line 146 of file gauthserver.hpp.


The documentation for this class was generated from the following files: