Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
Server_Room Class Reference

#include <server_room.h>

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

Signals

void roomInfoChanged (const ServerInfo_Room &roomInfo)
void gameListChanged (const ServerInfo_Game &gameInfo)

Public Member Functions

 Server_Room (int _id, int _chatHistorySize, const QString &_name, const QString &_description, const QString &_permissionLevel, const QString &_privilegeLevel, bool _autoJoin, const QString &_joinMessage, const QStringList &_gameTypes, Server *parent)
 ~Server_Room () override
int getId () const
QString getName () const
QString getDescription () const
QString getRoomPermission () const
QString getRoomPrivilege () const
bool getAutoJoin () const
bool userMayJoin (const ServerInfo_User &userInfo)
QString getJoinMessage () const
const QStringList & getGameTypes () const
const QMap< int, Server_Game * > & getGames () const
const QMap< int, ServerInfo_Game > & getExternalGames () const
ServergetServer () const
const ServerInfo_Room & getInfo (ServerInfo_Room &result, bool complete, bool showGameTypes=false, bool includeExternalData=true) const
int getGamesCreatedByUser (const QString &name) const
QList< ServerInfo_Game > getGamesOfUser (const QString &name) const
QList< ServerInfo_ChatMessage > & getChatHistory ()
void addClient (Server_ProtocolHandler *client)
void removeClient (Server_ProtocolHandler *client)
void addExternalUser (const ServerInfo_User &userInfo)
void removeExternalUser (const QString &_name)
const QMap< QString, ServerInfo_User_Container > & getExternalUsers () const
void updateExternalGameList (const ServerInfo_Game &gameInfo)
Response::ResponseCode processJoinGameCommand (const Command_JoinGame &cmd, ResponseContainer &rc, Server_AbstractUserInterface *userInterface)
void say (const QString &userName, const QString &s, bool sendToIsl=true)
void removeSaidMessages (const QString &userName, int amount, bool sendToIsl=true)
void addGame (Server_Game *game)
void removeGame (Server_Game *game)
void sendRoomEvent (RoomEvent *event, bool sendToIsl=true)
RoomEvent * prepareRoomEvent (const ::google::protobuf::Message &roomEvent)

Public Attributes

QReadWriteLock usersLock
QReadWriteLock gamesLock
QReadWriteLock historyLock

Private Slots

void broadcastGameListUpdate (const ServerInfo_Game &gameInfo, bool sendToIsl=true)

Private Attributes

int id
int chatHistorySize
QString name
QString description
QString permissionLevel
QString privilegeLevel
bool autoJoin
QString joinMessage
QStringList gameTypes
QMap< int, Server_Game * > games
QMap< int, ServerInfo_Game > externalGames
QMap< QString, Server_ProtocolHandler * > users
QMap< QString, ServerInfo_User_ContainerexternalUsers
QList< ServerInfo_ChatMessage > chatHistory

Constructor & Destructor Documentation

◆ Server_Room()

Server_Room::Server_Room ( int _id,
int _chatHistorySize,
const QString & _name,
const QString & _description,
const QString & _permissionLevel,
const QString & _privilegeLevel,
bool _autoJoin,
const QString & _joinMessage,
const QStringList & _gameTypes,
Server * parent )
Here is the call graph for this function:

◆ ~Server_Room()

Server_Room::~Server_Room ( )
override

Member Function Documentation

◆ addClient()

void Server_Room::addClient ( Server_ProtocolHandler * client)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addExternalUser()

void Server_Room::addExternalUser ( const ServerInfo_User & userInfo)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addGame()

void Server_Room::addGame ( Server_Game * game)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcastGameListUpdate

void Server_Room::broadcastGameListUpdate ( const ServerInfo_Game & gameInfo,
bool sendToIsl = true )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gameListChanged

void Server_Room::gameListChanged ( const ServerInfo_Game & gameInfo)
signal
Here is the caller graph for this function:

◆ getAutoJoin()

bool Server_Room::getAutoJoin ( ) const
inline

◆ getChatHistory()

QList< ServerInfo_ChatMessage > & Server_Room::getChatHistory ( )
inline
Here is the caller graph for this function:

◆ getDescription()

QString Server_Room::getDescription ( ) const
inline

◆ getExternalGames()

const QMap< int, ServerInfo_Game > & Server_Room::getExternalGames ( ) const
inline
Here is the caller graph for this function:

◆ getExternalUsers()

const QMap< QString, ServerInfo_User_Container > & Server_Room::getExternalUsers ( ) const
inline
Here is the caller graph for this function:

◆ getGames()

const QMap< int, Server_Game * > & Server_Room::getGames ( ) const
inline
Here is the caller graph for this function:

◆ getGamesCreatedByUser()

int Server_Room::getGamesCreatedByUser ( const QString & name) const
Here is the caller graph for this function:

◆ getGamesOfUser()

QList< ServerInfo_Game > Server_Room::getGamesOfUser ( const QString & name) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGameTypes()

const QStringList & Server_Room::getGameTypes ( ) const
inline

◆ getId()

int Server_Room::getId ( ) const
inline
Here is the caller graph for this function:

◆ getInfo()

const ServerInfo_Room & Server_Room::getInfo ( ServerInfo_Room & result,
bool complete,
bool showGameTypes = false,
bool includeExternalData = true ) const
Here is the caller graph for this function:

◆ getJoinMessage()

QString Server_Room::getJoinMessage ( ) const
inline
Here is the caller graph for this function:

◆ getName()

QString Server_Room::getName ( ) const
inline
Here is the caller graph for this function:

◆ getRoomPermission()

QString Server_Room::getRoomPermission ( ) const
inline

◆ getRoomPrivilege()

QString Server_Room::getRoomPrivilege ( ) const
inline

◆ getServer()

Server * Server_Room::getServer ( ) const
Here is the caller graph for this function:

◆ prepareRoomEvent()

RoomEvent * Server_Room::prepareRoomEvent ( const ::google::protobuf::Message & roomEvent)
Here is the caller graph for this function:

◆ processJoinGameCommand()

Response::ResponseCode Server_Room::processJoinGameCommand ( const Command_JoinGame & cmd,
ResponseContainer & rc,
Server_AbstractUserInterface * userInterface )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeClient()

void Server_Room::removeClient ( Server_ProtocolHandler * client)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeExternalUser()

void Server_Room::removeExternalUser ( const QString & _name)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeGame()

void Server_Room::removeGame ( Server_Game * game)
Here is the call graph for this function:

◆ removeSaidMessages()

void Server_Room::removeSaidMessages ( const QString & userName,
int amount,
bool sendToIsl = true )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ roomInfoChanged

void Server_Room::roomInfoChanged ( const ServerInfo_Room & roomInfo)
signal
Here is the caller graph for this function:

◆ say()

void Server_Room::say ( const QString & userName,
const QString & s,
bool sendToIsl = true )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendRoomEvent()

void Server_Room::sendRoomEvent ( RoomEvent * event,
bool sendToIsl = true )
Here is the caller graph for this function:

◆ updateExternalGameList()

void Server_Room::updateExternalGameList ( const ServerInfo_Game & gameInfo)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ userMayJoin()

bool Server_Room::userMayJoin ( const ServerInfo_User & userInfo)
Here is the caller graph for this function:

Member Data Documentation

◆ autoJoin

bool Server_Room::autoJoin
private

◆ chatHistory

QList<ServerInfo_ChatMessage> Server_Room::chatHistory
private

◆ chatHistorySize

int Server_Room::chatHistorySize
private

◆ description

QString Server_Room::description
private

◆ externalGames

QMap<int, ServerInfo_Game> Server_Room::externalGames
private

◆ externalUsers

QMap<QString, ServerInfo_User_Container> Server_Room::externalUsers
private

◆ games

QMap<int, Server_Game *> Server_Room::games
private

◆ gamesLock

QReadWriteLock Server_Room::gamesLock
mutable

◆ gameTypes

QStringList Server_Room::gameTypes
private

◆ historyLock

QReadWriteLock Server_Room::historyLock
mutable

◆ id

int Server_Room::id
private

◆ joinMessage

QString Server_Room::joinMessage
private

◆ name

QString Server_Room::name
private

◆ permissionLevel

QString Server_Room::permissionLevel
private

◆ privilegeLevel

QString Server_Room::privilegeLevel
private

◆ users

QMap<QString, Server_ProtocolHandler *> Server_Room::users
private

◆ usersLock

QReadWriteLock Server_Room::usersLock
mutable

The documentation for this class was generated from the following files:
  • libcockatrice_network/libcockatrice/network/server/remote/server_room.h
  • libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp