Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
Servatrice Class Reference

#include <servatrice.h>

Inheritance diagram for Servatrice:
[legend]
Collaboration diagram for Servatrice:
[legend]

Public Types

enum  AuthenticationMethod { AuthenticationNone , AuthenticationSql , AuthenticationPassword }
enum  AuthenticationStrictness { AuthenticationLegacy , AuthenticationMixed , AuthenticationStrict }

Public Slots

void scheduleShutdown (const QString &reason, int minutes)
void updateLoginMessage ()
void setRequiredFeatures (const QString &featureList)
void onEmailDelivered (const QString &userName, EmailType type, const QString &token, qint64 rowId)
void onEmailPermanentlyFailed (const QString &userName, EmailType type, FailureReason reason, const QString &token, qint64 rowId)

Public Member Functions

 Servatrice (QObject *parent=nullptr)
 ~Servatrice () override
bool initServer ()
QMap< QString, bool > getServerRequiredFeatureList () const override
bool requiresChallengeResponseAuth () const override
 True when only challenge-response logins are accepted (strict mode).
QByteArray getLegacyBackupKey () const
 Key sealing legacy password backups, or empty when they are disabled.
int getLegacyBackupTtlDays () const
 Days a legacy password backup may go unused before it is purged.
QString getServerName () const
QString getLoginMessage () const override
SessionEvent * getLoginSessionEvent () const override
SessionEvent * makeShutdownEvent () const
QString getRequiredFeatures () const override
QString getAuthenticationMethodString () const
QString getDBTypeString () const
QString getDbPrefix () const
QString getEmailBlackList () const
QString getEmailWhiteList () const
AuthenticationMethod getAuthenticationMethod () const
AuthenticationStrictness getAuthenticationStrictness () const
bool permitUnregisteredUsers () const override
bool getGameShouldPing () const override
bool getClientIDRequiredEnabled () const override
bool getRegOnlyServerEnabled () const override
bool getMaxUserLimitEnabled () const override
bool getStoreReplaysEnabled () const override
bool getRegistrationEnabled () const
bool getRequireEmailForRegistrationEnabled () const
bool getRequireEmailActivationEnabled () const
bool getEnableLogQuery () const override
bool getEnableForgotPassword () const
bool getEnableForgotPasswordChallenge () const
bool getEnableAudit () const
bool getEnableRegistrationAudit () const
bool getEnableForgotPasswordAudit () const
int getMinPasswordLength () const
int getIdleClientTimeout () const override
int getServerID () const override
int getMaxGameInactivityTime () const override
int getMaxPlayerInactivityTime () const override
int getClientKeepAlive () const override
int getDeckShareExpiryDays () const
int getDeckShareCleanupInterval () const
int getDeckShareMaxDecksPerShare () const
int getDeckShareMaxSharesPerDay () const
int getMaxUsersPerAddress () const
QString getTrustedSources () const
 Raw security/trusted_sources list; match addresses against it with isTrustedSource().
int getMessageCountingInterval () const override
int getMaxMessageCountPerInterval () const override
int getMaxMessageSizePerInterval () const override
int getMaxGamesPerUser () const override
int getCommandCountingInterval () const override
int getMaxCommandCountPerInterval () const override
int getMaxUserTotal () const override
bool permitCreateGameAsJudge () const override
int getMaxTcpUserLimit () const
int getMaxWebSocketUserLimit () const
int getUsersWithAddress (const QHostAddress &address) const
int getMaxAccountsPerEmail () const
int getForgotPasswordTokenLife () const
QList< AbstractServerSocketInterface * > getUsersWithAddressAsList (const QHostAddress &address) const
void incTxBytes (quint64 num)
void incRxBytes (quint64 num)
void addDatabaseInterface (QThread *thread, Servatrice_DatabaseInterface *databaseInterface)
MetricsRegistry & getMetricsRegistry ()
qint64 getCardsInGamesTotal () const
int getMetricsSlowCommandMs () const
int getMetricsStallWarnMs () const
 Heartbeat overshoot that counts as a stall. A value of 0 disables the watchdogs.
void observeGameStartDurationMs (qint64 elapsedMs) override
qint64 getEventLoopStallsTotal () const
qint64 getEventLoopLastStallMs () const
qint64 getEventLoopMaxStallMs () const
void observeEventLoopStall (const QString &threadName, qint64 overshootMs)
 Records one heartbeat overshoot and logs a single warning for it.
void watchWorkerThread (QThread *thread)
RateLimiter * getRateLimiter ()
bool recordFailedLogin (const QString &ipAddress, const QString &userName) override
 Record a failed login attempt for the (address, username) pair; returns true if now locked out.
bool isLoginRateLimited (const QString &ipAddress, const QString &userName) override
 True if the (address, username) pair is already locked out of logging in.
int loginRateLimitRemainingSeconds (const QString &ipAddress, const QString &userName) override
 Seconds remaining before the login rate limit for the (address, username) pair lifts. Returns 0 if not limited.
void clearFailedLogins (const QString &ipAddress, const QString &userName) override
 Clear any failed-login lockout for the (address, username) pair, e.g. after a successful login.
bool recordRegistrationAttempt (const QString &ipAddress)
bool recordForgotPasswordAttempt (const QString &ipAddress)
bool isRateLimitExempt (const QString &ipAddress) const
 True when the address is in security/trusted_sources and therefore exempt from per-address limits.
int getMaxLoginAttemptsPerIp () const
int getLoginAttemptWindowSeconds () const
int getMaxRegistrationsPerIp () const
int getRegistrationWindowSeconds () const
int getMaxForgotPasswordRequestsPerIp () const
int getForgotPasswordWindowSeconds () const
bool islConnectionExists (int _serverId) const
void addIslInterface (int _serverId, IslInterface *interface)
void removeIslInterface (int _serverId)
std::shared_ptr< const Response_ReportStats > getCachedReportStats () const
void cacheReportStats (const Response_ReportStats &stats)
QList< ServerProperties > getServerList () const
Public Member Functions inherited from Server
 Server (QObject *parent=nullptr)
 ~Server () override=default
AuthenticationResult loginUser (Server_ProtocolHandler *session, QString &name, const QString &password, bool passwordNeedsHash, QString &reason, int &secondsLeft, QString &clientid, QString &clientVersion, QString &connectionType)
void broadcastUserInfoUpdate (Server_ProtocolHandler *source)
const QMap< int, Server_Room * > & getRooms ()
Server_AbstractUserInterface * findUser (const QString &userName) const
const QMap< QString, Server_ProtocolHandler * > & getUsers () const
const QMap< qint64, Server_ProtocolHandler * > & getUsersBySessionId () const
void addClient (Server_ProtocolHandler *player)
void removeClient (Server_ProtocolHandler *player)
QList< QString > getOnlineModeratorList () const
Server_DatabaseInterface * getDatabaseInterface () const
int getNextLocalGameId ()
void sendIsl_Response (const Response &item, int serverId=-1, qint64 sessionId=-1)
void sendIsl_SessionEvent (const SessionEvent &item, int serverId=-1, qint64 sessionId=-1)
void sendIsl_GameEventContainer (const GameEventContainer &item, int serverId=-1, qint64 sessionId=-1)
void sendIsl_RoomEvent (const RoomEvent &item, int serverId=-1, qint64 sessionId=-1)
void sendIsl_GameCommand (const CommandContainer &item, int serverId, qint64 sessionId, int roomId, int playerId)
void sendIsl_RoomCommand (const CommandContainer &item, int serverId, qint64 sessionId, int roomId)
const QMap< QString, Server_AbstractUserInterface * > & getExternalUsers () const
void addPersistentPlayer (const QString &userName, int roomId, int gameId, int playerId)
void removePersistentPlayer (const QString &userName, int roomId, int gameId, int playerId)
QList< PlayerReference > getPersistentPlayerReferences (const QString &userName) const
int getUsersCount () const
int getGamesCount () const
int getTCPUserCount () const
int getWebSocketUserCount () const

Public Attributes

QReadWriteLock islLock
Public Attributes inherited from Server
QReadWriteLock clientsLock
QReadWriteLock roomsLock

Protected Member Functions

void doSendIslMessage (const IslMessage &msg, int _serverId) override
Protected Member Functions inherited from Server
void prepareDestroy ()
void setDatabaseInterface (Server_DatabaseInterface *_databaseInterface)
void addRoom (Server_Room *newRoom)

Private Types

enum  DatabaseType { DatabaseNone , DatabaseMySql }

Private Slots

void statusUpdate ()
void sweepLegacyBackups ()
void shutdownTimeout ()
void cleanupExpiredDeckShares ()

Private Member Functions

bool cleanupDatabaseForEmail (const QString &userName, EmailType type, const QString &token, qint64 rowId)
void updateServerList ()
QString getDBPrefixString () const
QString getDBHostNameString () const
QString getDBDatabaseNameString () const
QString getDBUserNameString () const
QString getDBPasswordString () const
QString getRoomsMethodString () const
QString getISLNetworkSSLCertFile () const
QString getISLNetworkSSLKeyFile () const
int getServerStatusUpdateTime () const
int getNumberOfTCPPools () const
int getServerTCPPort () const
int getNumberOfWebSocketPools () const
int getServerWebSocketPort () const
int getISLNetworkPort () const
bool getISLNetworkEnabled () const
bool getEnableInternalSMTPClient () const
QHostAddress getServerTCPHost () const
QHostAddress getServerWebSocketHost () const

Private Attributes

AuthenticationMethod authenticationMethod
DatabaseType databaseType
QTimer * pingClock
QTimer * statusUpdateClock
QTimer * deckShareCleanupClock
QTimer * legacyBackupSweepClock
Servatrice_GameServer * gameServer
Servatrice_WebsocketGameServer * websocketGameServer
Servatrice_IslServer * islServer
QMutex loginMessageMutex
QString loginMessage
QMutex shutdownStateMutex
QString dbPrefix
QMap< QString, bool > serverRequiredFeatureList
QString officialWarnings
Servatrice_DatabaseInterface * servatriceDatabaseInterface
int serverId
int uptime
QMutex txBytesMutex
QMutex rxBytesMutex
quint64 txBytes
quint64 rxBytes
MetricsRegistry metricsRegistry
int metricsSlowCommandMs = 500
int metricsStallWarnMs = 2000
std::atomic< qint64 > eventLoopStallsTotal {0}
 heartbeat overshoots past the warn threshold
std::atomic< qint64 > eventLoopLastStallMs {0}
 overshoot of the most recent stall
std::atomic< qint64 > eventLoopMaxStallMs {0}
 worst overshoot seen since process start
QString shutdownReason
int shutdownMinutes
int nextShutdownMessageMinutes
QTimer * shutdownTimer
QMutex reportStatsMutex
QDateTime reportStatsTimestamp
std::shared_ptr< const Response_ReportStats > reportStatsCache
RateLimiter rateLimiter
QMutex serverListMutex
QList< ServerProperties > serverList
QMap< int, IslInterface * > islInterfaces

Static Private Attributes

static constexpr int reportStatsCacheTtlSeconds = 60

Additional Inherited Members

Signals inherited from Server
void pingClockTimeout ()
void sigSendIslMessage (const IslMessage &message, int serverId)
void endSession (qint64 sessionId)
Protected Slots inherited from Server
void externalUserJoined (const ServerInfo_User &userInfo)
void externalUserLeft (const QString &userName)
void externalRoomUserJoined (int roomId, const ServerInfo_User &userInfo)
void externalRoomUserLeft (int roomId, const QString &userName)
void externalRoomSay (int roomId, const QString &userName, const QString &message, const QString &channelId)
void externalRoomRemoveMessages (int roomId, const QString &userName, int amount)
void externalRoomGameListChanged (int roomId, const ServerInfo_Game &gameInfo)
void externalJoinGameCommandReceived (const Command_JoinGame &cmd, int cmdId, int roomId, int serverId, qint64 sessionId)
void externalGameCommandContainerReceived (const CommandContainer &cont, int playerId, int serverId, qint64 sessionId)
void externalGameEventContainerReceived (const GameEventContainer &cont, qint64 sessionId)
void externalResponseReceived (const Response &resp, qint64 sessionId)
Protected Attributes inherited from Server
QList< Server_ProtocolHandler * > clients
QMap< qint64, Server_ProtocolHandler * > usersBySessionId
QMap< QString, Server_ProtocolHandler * > users
QMap< qint64, Server_AbstractUserInterface * > externalUsersBySessionId
QMap< QString, Server_AbstractUserInterface * > externalUsers
QMap< int, Server_Room * > rooms
QMap< QThread *, Server_DatabaseInterface * > databaseInterfaces

Member Enumeration Documentation

◆ AuthenticationMethod

Enumerator
AuthenticationNone 
AuthenticationSql 
AuthenticationPassword 

◆ AuthenticationStrictness

Enumerator
AuthenticationLegacy 
AuthenticationMixed 
AuthenticationStrict 

◆ DatabaseType

Enumerator
DatabaseNone 
DatabaseMySql 

Constructor & Destructor Documentation

◆ Servatrice()

Servatrice::Servatrice ( QObject * parent = nullptr)
explicit
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Servatrice()

Servatrice::~Servatrice ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ addDatabaseInterface()

void Servatrice::addDatabaseInterface ( QThread * thread,
Servatrice_DatabaseInterface * databaseInterface )
Here is the caller graph for this function:

◆ addIslInterface()

void Servatrice::addIslInterface ( int _serverId,
IslInterface * interface )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cacheReportStats()

void Servatrice::cacheReportStats ( const Response_ReportStats & stats)
Here is the caller graph for this function:

◆ cleanupDatabaseForEmail()

bool Servatrice::cleanupDatabaseForEmail ( const QString & userName,
EmailType type,
const QString & token,
qint64 rowId )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanupExpiredDeckShares

void Servatrice::cleanupExpiredDeckShares ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearFailedLogins()

void Servatrice::clearFailedLogins ( const QString & ipAddress,
const QString & userName )
overridevirtual

Clear any failed-login lockout for the (address, username) pair, e.g. after a successful login.

Reimplemented from Server.

Here is the call graph for this function:

◆ doSendIslMessage()

void Servatrice::doSendIslMessage ( const IslMessage & msg,
int _serverId )
overrideprotectedvirtual

Reimplemented from Server.

◆ getAuthenticationMethod()

AuthenticationMethod Servatrice::getAuthenticationMethod ( ) const
inline
Here is the caller graph for this function:

◆ getAuthenticationMethodString()

QString Servatrice::getAuthenticationMethodString ( ) const
Here is the caller graph for this function:

◆ getAuthenticationStrictness()

Servatrice::AuthenticationStrictness Servatrice::getAuthenticationStrictness ( ) const
Here is the caller graph for this function:

◆ getCachedReportStats()

std::shared_ptr< const Response_ReportStats > Servatrice::getCachedReportStats ( ) const
Here is the caller graph for this function:

◆ getCardsInGamesTotal()

qint64 Servatrice::getCardsInGamesTotal ( ) const

Sums cards across all zones of all running games. Each game takes its own gameMutex – the hot per-game lock every game action contends on – and then iterates every player's zones, so the scrape cost is really O(total cards in play) plus one mutex acquisition per live game. Keep scrapes infrequent in big multiplayer rooms.

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

◆ getClientIDRequiredEnabled()

bool Servatrice::getClientIDRequiredEnabled ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getClientKeepAlive()

int Servatrice::getClientKeepAlive ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getCommandCountingInterval()

int Servatrice::getCommandCountingInterval ( ) const
overridevirtual

Reimplemented from Server.

◆ getDBDatabaseNameString()

QString Servatrice::getDBDatabaseNameString ( ) const
private
Here is the caller graph for this function:

◆ getDBHostNameString()

QString Servatrice::getDBHostNameString ( ) const
private
Here is the caller graph for this function:

◆ getDBPasswordString()

QString Servatrice::getDBPasswordString ( ) const
private
Here is the caller graph for this function:

◆ getDbPrefix()

QString Servatrice::getDbPrefix ( ) const
inline
Here is the caller graph for this function:

◆ getDBPrefixString()

QString Servatrice::getDBPrefixString ( ) const
private
Here is the caller graph for this function:

◆ getDBTypeString()

QString Servatrice::getDBTypeString ( ) const
Here is the caller graph for this function:

◆ getDBUserNameString()

QString Servatrice::getDBUserNameString ( ) const
private
Here is the caller graph for this function:

◆ getDeckShareCleanupInterval()

int Servatrice::getDeckShareCleanupInterval ( ) const
Here is the caller graph for this function:

◆ getDeckShareExpiryDays()

int Servatrice::getDeckShareExpiryDays ( ) const
Here is the caller graph for this function:

◆ getDeckShareMaxDecksPerShare()

int Servatrice::getDeckShareMaxDecksPerShare ( ) const
Here is the caller graph for this function:

◆ getDeckShareMaxSharesPerDay()

int Servatrice::getDeckShareMaxSharesPerDay ( ) const
Here is the caller graph for this function:

◆ getEmailBlackList()

QString Servatrice::getEmailBlackList ( ) const
Here is the caller graph for this function:

◆ getEmailWhiteList()

QString Servatrice::getEmailWhiteList ( ) const
Here is the caller graph for this function:

◆ getEnableAudit()

bool Servatrice::getEnableAudit ( ) const
Here is the caller graph for this function:

◆ getEnableForgotPassword()

bool Servatrice::getEnableForgotPassword ( ) const
Here is the caller graph for this function:

◆ getEnableForgotPasswordAudit()

bool Servatrice::getEnableForgotPasswordAudit ( ) const
Here is the caller graph for this function:

◆ getEnableForgotPasswordChallenge()

bool Servatrice::getEnableForgotPasswordChallenge ( ) const
Here is the caller graph for this function:

◆ getEnableInternalSMTPClient()

bool Servatrice::getEnableInternalSMTPClient ( ) const
private
Here is the caller graph for this function:

◆ getEnableLogQuery()

bool Servatrice::getEnableLogQuery ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getEnableRegistrationAudit()

bool Servatrice::getEnableRegistrationAudit ( ) const
Here is the caller graph for this function:

◆ getEventLoopLastStallMs()

qint64 Servatrice::getEventLoopLastStallMs ( ) const
inline
Here is the caller graph for this function:

◆ getEventLoopMaxStallMs()

qint64 Servatrice::getEventLoopMaxStallMs ( ) const
inline
Here is the caller graph for this function:

◆ getEventLoopStallsTotal()

qint64 Servatrice::getEventLoopStallsTotal ( ) const
inline
Here is the caller graph for this function:

◆ getForgotPasswordTokenLife()

int Servatrice::getForgotPasswordTokenLife ( ) const
Here is the caller graph for this function:

◆ getForgotPasswordWindowSeconds()

int Servatrice::getForgotPasswordWindowSeconds ( ) const
Here is the caller graph for this function:

◆ getGameShouldPing()

bool Servatrice::getGameShouldPing ( ) const
inlineoverridevirtual

Reimplemented from Server.

◆ getIdleClientTimeout()

int Servatrice::getIdleClientTimeout ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getISLNetworkEnabled()

bool Servatrice::getISLNetworkEnabled ( ) const
private
Here is the caller graph for this function:

◆ getISLNetworkPort()

int Servatrice::getISLNetworkPort ( ) const
private
Here is the caller graph for this function:

◆ getISLNetworkSSLCertFile()

QString Servatrice::getISLNetworkSSLCertFile ( ) const
private
Here is the caller graph for this function:

◆ getISLNetworkSSLKeyFile()

QString Servatrice::getISLNetworkSSLKeyFile ( ) const
private
Here is the caller graph for this function:

◆ getLegacyBackupKey()

QByteArray Servatrice::getLegacyBackupKey ( ) const

Key sealing legacy password backups, or empty when they are disabled.

Here is the caller graph for this function:

◆ getLegacyBackupTtlDays()

int Servatrice::getLegacyBackupTtlDays ( ) const

Days a legacy password backup may go unused before it is purged.

Here is the caller graph for this function:

◆ getLoginAttemptWindowSeconds()

int Servatrice::getLoginAttemptWindowSeconds ( ) const
Here is the caller graph for this function:

◆ getLoginMessage()

QString Servatrice::getLoginMessage ( ) const
inlineoverridevirtual

Reimplemented from Server.

◆ getLoginSessionEvent()

SessionEvent * Servatrice::getLoginSessionEvent ( ) const
overridevirtual

Reimplemented from Server.

Here is the call graph for this function:

◆ getMaxAccountsPerEmail()

int Servatrice::getMaxAccountsPerEmail ( ) const
Here is the caller graph for this function:

◆ getMaxCommandCountPerInterval()

int Servatrice::getMaxCommandCountPerInterval ( ) const
overridevirtual

Reimplemented from Server.

◆ getMaxForgotPasswordRequestsPerIp()

int Servatrice::getMaxForgotPasswordRequestsPerIp ( ) const
Here is the caller graph for this function:

◆ getMaxGameInactivityTime()

int Servatrice::getMaxGameInactivityTime ( ) const
overridevirtual

Reimplemented from Server.

◆ getMaxGamesPerUser()

int Servatrice::getMaxGamesPerUser ( ) const
overridevirtual

Reimplemented from Server.

◆ getMaxLoginAttemptsPerIp()

int Servatrice::getMaxLoginAttemptsPerIp ( ) const
Here is the caller graph for this function:

◆ getMaxMessageCountPerInterval()

int Servatrice::getMaxMessageCountPerInterval ( ) const
overridevirtual

Reimplemented from Server.

◆ getMaxMessageSizePerInterval()

int Servatrice::getMaxMessageSizePerInterval ( ) const
overridevirtual

Reimplemented from Server.

◆ getMaxPlayerInactivityTime()

int Servatrice::getMaxPlayerInactivityTime ( ) const
overridevirtual

Reimplemented from Server.

◆ getMaxRegistrationsPerIp()

int Servatrice::getMaxRegistrationsPerIp ( ) const
Here is the caller graph for this function:

◆ getMaxTcpUserLimit()

int Servatrice::getMaxTcpUserLimit ( ) const
Here is the caller graph for this function:

◆ getMaxUserLimitEnabled()

bool Servatrice::getMaxUserLimitEnabled ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getMaxUsersPerAddress()

int Servatrice::getMaxUsersPerAddress ( ) const
Here is the caller graph for this function:

◆ getMaxUserTotal()

int Servatrice::getMaxUserTotal ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getMaxWebSocketUserLimit()

int Servatrice::getMaxWebSocketUserLimit ( ) const
Here is the caller graph for this function:

◆ getMessageCountingInterval()

int Servatrice::getMessageCountingInterval ( ) const
overridevirtual

Reimplemented from Server.

◆ getMetricsRegistry()

MetricsRegistry & Servatrice::getMetricsRegistry ( )
inline
Here is the caller graph for this function:

◆ getMetricsSlowCommandMs()

int Servatrice::getMetricsSlowCommandMs ( ) const
inline
Here is the caller graph for this function:

◆ getMetricsStallWarnMs()

int Servatrice::getMetricsStallWarnMs ( ) const
inline

Heartbeat overshoot that counts as a stall. A value of 0 disables the watchdogs.

◆ getMinPasswordLength()

int Servatrice::getMinPasswordLength ( ) const
Here is the caller graph for this function:

◆ getNumberOfTCPPools()

int Servatrice::getNumberOfTCPPools ( ) const
private
Here is the caller graph for this function:

◆ getNumberOfWebSocketPools()

int Servatrice::getNumberOfWebSocketPools ( ) const
private
Here is the caller graph for this function:

◆ getRateLimiter()

RateLimiter * Servatrice::getRateLimiter ( )
inline
Here is the caller graph for this function:

◆ getRegistrationEnabled()

bool Servatrice::getRegistrationEnabled ( ) const
Here is the caller graph for this function:

◆ getRegistrationWindowSeconds()

int Servatrice::getRegistrationWindowSeconds ( ) const
Here is the caller graph for this function:

◆ getRegOnlyServerEnabled()

bool Servatrice::getRegOnlyServerEnabled ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getRequiredFeatures()

QString Servatrice::getRequiredFeatures ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getRequireEmailActivationEnabled()

bool Servatrice::getRequireEmailActivationEnabled ( ) const
Here is the caller graph for this function:

◆ getRequireEmailForRegistrationEnabled()

bool Servatrice::getRequireEmailForRegistrationEnabled ( ) const
Here is the caller graph for this function:

◆ getRoomsMethodString()

QString Servatrice::getRoomsMethodString ( ) const
private
Here is the caller graph for this function:

◆ getServerID()

int Servatrice::getServerID ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getServerList()

QList< ServerProperties > Servatrice::getServerList ( ) const
Here is the caller graph for this function:

◆ getServerName()

QString Servatrice::getServerName ( ) const
Here is the caller graph for this function:

◆ getServerRequiredFeatureList()

QMap< QString, bool > Servatrice::getServerRequiredFeatureList ( ) const
inlineoverridevirtual

Reimplemented from Server.

◆ getServerStatusUpdateTime()

int Servatrice::getServerStatusUpdateTime ( ) const
private
Here is the caller graph for this function:

◆ getServerTCPHost()

QHostAddress Servatrice::getServerTCPHost ( ) const
private
Here is the caller graph for this function:

◆ getServerTCPPort()

int Servatrice::getServerTCPPort ( ) const
private
Here is the caller graph for this function:

◆ getServerWebSocketHost()

QHostAddress Servatrice::getServerWebSocketHost ( ) const
private
Here is the caller graph for this function:

◆ getServerWebSocketPort()

int Servatrice::getServerWebSocketPort ( ) const
private
Here is the caller graph for this function:

◆ getStoreReplaysEnabled()

bool Servatrice::getStoreReplaysEnabled ( ) const
overridevirtual

Reimplemented from Server.

Here is the caller graph for this function:

◆ getTrustedSources()

QString Servatrice::getTrustedSources ( ) const

Raw security/trusted_sources list; match addresses against it with isTrustedSource().

Here is the caller graph for this function:

◆ getUsersWithAddress()

int Servatrice::getUsersWithAddress ( const QHostAddress & address) const
Here is the caller graph for this function:

◆ getUsersWithAddressAsList()

QList< AbstractServerSocketInterface * > Servatrice::getUsersWithAddressAsList ( const QHostAddress & address) const
Here is the caller graph for this function:

◆ incRxBytes()

void Servatrice::incRxBytes ( quint64 num)
Here is the caller graph for this function:

◆ incTxBytes()

void Servatrice::incTxBytes ( quint64 num)
Here is the caller graph for this function:

◆ initServer()

bool Servatrice::initServer ( )

◆ islConnectionExists()

bool Servatrice::islConnectionExists ( int _serverId) const
Here is the caller graph for this function:

◆ isLoginRateLimited()

bool Servatrice::isLoginRateLimited ( const QString & ipAddress,
const QString & userName )
overridevirtual

True if the (address, username) pair is already locked out of logging in.

Consulted before any authentication work (database round trip, password verification) so a blocked pair cannot burn server CPU per attempt.

Reimplemented from Server.

Here is the call graph for this function:

◆ isRateLimitExempt()

bool Servatrice::isRateLimitExempt ( const QString & ipAddress) const

True when the address is in security/trusted_sources and therefore exempt from per-address limits.

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

◆ loginRateLimitRemainingSeconds()

int Servatrice::loginRateLimitRemainingSeconds ( const QString & ipAddress,
const QString & userName )
overridevirtual

Seconds remaining before the login rate limit for the (address, username) pair lifts. Returns 0 if not limited.

Reimplemented from Server.

Here is the call graph for this function:

◆ makeShutdownEvent()

SessionEvent * Servatrice::makeShutdownEvent ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ observeEventLoopStall()

void Servatrice::observeEventLoopStall ( const QString & threadName,
qint64 overshootMs )

Records one heartbeat overshoot and logs a single warning for it.

Here is the caller graph for this function:

◆ observeGameStartDurationMs()

void Servatrice::observeGameStartDurationMs ( qint64 elapsedMs)
overridevirtual

Called once per actual game start with how long bringing every player's zones online took, so servers can spot deck sizes that wedge threads.

Reimplemented from Server.

Here is the call graph for this function:

◆ onEmailDelivered

void Servatrice::onEmailDelivered ( const QString & userName,
EmailType type,
const QString & token,
qint64 rowId )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onEmailPermanentlyFailed

void Servatrice::onEmailPermanentlyFailed ( const QString & userName,
EmailType type,
FailureReason reason,
const QString & token,
qint64 rowId )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ permitCreateGameAsJudge()

bool Servatrice::permitCreateGameAsJudge ( ) const
overridevirtual

Reimplemented from Server.

◆ permitUnregisteredUsers()

bool Servatrice::permitUnregisteredUsers ( ) const
inlineoverridevirtual

Reimplemented from Server.

◆ recordFailedLogin()

bool Servatrice::recordFailedLogin ( const QString & ipAddress,
const QString & userName )
overridevirtual

Record a failed login attempt for the (address, username) pair; returns true if now locked out.

Keyed by pair so a successful login as one user cannot wipe out another user's failure history from the same address (e.g. a guest login or the attacker's own account clearing the way for further guessing).

Reimplemented from Server.

Here is the call graph for this function:

◆ recordForgotPasswordAttempt()

bool Servatrice::recordForgotPasswordAttempt ( const QString & ipAddress)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ recordRegistrationAttempt()

bool Servatrice::recordRegistrationAttempt ( const QString & ipAddress)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeIslInterface()

void Servatrice::removeIslInterface ( int _serverId)
Here is the caller graph for this function:

◆ requiresChallengeResponseAuth()

bool Servatrice::requiresChallengeResponseAuth ( ) const
inlineoverridevirtual

True when only challenge-response logins are accepted (strict mode).

Reimplemented from Server.

Here is the call graph for this function:

◆ scheduleShutdown

void Servatrice::scheduleShutdown ( const QString & reason,
int minutes )
slot
Here is the call graph for this function:

◆ setRequiredFeatures

void Servatrice::setRequiredFeatures ( const QString & featureList)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdownTimeout

void Servatrice::shutdownTimeout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusUpdate

void Servatrice::statusUpdate ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sweepLegacyBackups

void Servatrice::sweepLegacyBackups ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateLoginMessage

void Servatrice::updateLoginMessage ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateServerList()

void Servatrice::updateServerList ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ watchWorkerThread()

void Servatrice::watchWorkerThread ( QThread * thread)

Installs an EventLoopWatchdog in thread. Called once per socket pool thread right after it starts.

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

Member Data Documentation

◆ authenticationMethod

AuthenticationMethod Servatrice::authenticationMethod
private

◆ databaseType

DatabaseType Servatrice::databaseType
private

◆ dbPrefix

QString Servatrice::dbPrefix
private

◆ deckShareCleanupClock

QTimer* Servatrice::deckShareCleanupClock
private

◆ eventLoopLastStallMs

std::atomic<qint64> Servatrice::eventLoopLastStallMs {0}
private

overshoot of the most recent stall

◆ eventLoopMaxStallMs

std::atomic<qint64> Servatrice::eventLoopMaxStallMs {0}
private

worst overshoot seen since process start

◆ eventLoopStallsTotal

std::atomic<qint64> Servatrice::eventLoopStallsTotal {0}
private

heartbeat overshoots past the warn threshold

◆ gameServer

Servatrice_GameServer* Servatrice::gameServer
private

◆ islInterfaces

QMap<int, IslInterface *> Servatrice::islInterfaces
private

◆ islLock

QReadWriteLock Servatrice::islLock

◆ islServer

Servatrice_IslServer* Servatrice::islServer
private

◆ legacyBackupSweepClock

QTimer* Servatrice::legacyBackupSweepClock
private

◆ loginMessage

QString Servatrice::loginMessage
private

◆ loginMessageMutex

QMutex Servatrice::loginMessageMutex
mutableprivate

◆ metricsRegistry

MetricsRegistry Servatrice::metricsRegistry
private

◆ metricsSlowCommandMs

int Servatrice::metricsSlowCommandMs = 500
private

◆ metricsStallWarnMs

int Servatrice::metricsStallWarnMs = 2000
private

◆ nextShutdownMessageMinutes

int Servatrice::nextShutdownMessageMinutes
private

◆ officialWarnings

QString Servatrice::officialWarnings
private

◆ pingClock

QTimer* Servatrice::pingClock
private

◆ rateLimiter

RateLimiter Servatrice::rateLimiter
private

◆ reportStatsCache

std::shared_ptr<const Response_ReportStats> Servatrice::reportStatsCache
private

◆ reportStatsCacheTtlSeconds

int Servatrice::reportStatsCacheTtlSeconds = 60
staticconstexprprivate

◆ reportStatsMutex

QMutex Servatrice::reportStatsMutex
mutableprivate

◆ reportStatsTimestamp

QDateTime Servatrice::reportStatsTimestamp
private

◆ rxBytes

quint64 Servatrice::rxBytes
private

◆ rxBytesMutex

QMutex Servatrice::rxBytesMutex
private

◆ servatriceDatabaseInterface

Servatrice_DatabaseInterface* Servatrice::servatriceDatabaseInterface
private

◆ serverId

int Servatrice::serverId
private

◆ serverList

QList<ServerProperties> Servatrice::serverList
private

◆ serverListMutex

QMutex Servatrice::serverListMutex
mutableprivate

◆ serverRequiredFeatureList

QMap<QString, bool> Servatrice::serverRequiredFeatureList
private

◆ shutdownMinutes

int Servatrice::shutdownMinutes
private

◆ shutdownReason

QString Servatrice::shutdownReason
private

◆ shutdownStateMutex

QMutex Servatrice::shutdownStateMutex
mutableprivate

◆ shutdownTimer

QTimer* Servatrice::shutdownTimer
private

◆ statusUpdateClock

QTimer * Servatrice::statusUpdateClock
private

◆ txBytes

quint64 Servatrice::txBytes
private

◆ txBytesMutex

QMutex Servatrice::txBytesMutex
private

◆ uptime

int Servatrice::uptime
private

◆ websocketGameServer

Servatrice_WebsocketGameServer* Servatrice::websocketGameServer
private

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