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

#include <server_protocolhandler.h>

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

Public Slots

void prepareDestroy ()

Public Member Functions

 Server_ProtocolHandler (Server *_server, Server_DatabaseInterface *_databaseInterface, QObject *parent=0)
 ~Server_ProtocolHandler ()
bool getAcceptsUserListChanges () const
bool getAcceptsRoomListChanges () const
virtual QString getAddress () const =0
virtual QString getConnectionType () const =0
Server_DatabaseInterfacegetDatabaseInterface () const
int getLastCommandTime () const
bool addSaidMessageSize (int size)
void processCommandContainer (const CommandContainer &cont)
void sendProtocolItem (const Response &item)
void sendProtocolItem (const SessionEvent &item)
void sendProtocolItem (const GameEventContainer &item)
void sendProtocolItem (const RoomEvent &item)
Public Member Functions inherited from Server_AbstractUserInterface
 Server_AbstractUserInterface (Server *_server)
 Server_AbstractUserInterface (Server *_server, const ServerInfo_User_Container &other)
 ~Server_AbstractUserInterface () override
void playerRemovedFromGame (Server_Game *game)
void playerAddedToGame (int gameId, int roomId, int playerId)
void joinPersistentGames (ResponseContainer &rc)
QMap< int, QPair< int, int > > getGames () const
void sendProtocolItemByType (ServerMessage::MessageType type, const ::google::protobuf::Message &item)
void sendResponseContainer (const ResponseContainer &responseContainer, Response::ResponseCode responseCode)
Public Member Functions inherited from ServerInfo_User_Container
 ServerInfo_User_Container (ServerInfo_User *_userInfo=nullptr)
 ServerInfo_User_Container (const ServerInfo_User &_userInfo)
 ServerInfo_User_Container (const ServerInfo_User_Container &other)
ServerInfo_User_Containeroperator= (const ServerInfo_User_Container &other)=default
virtual ~ServerInfo_User_Container ()
ServerInfo_User * getUserInfo () const
void setUserInfo (const ServerInfo_User &_userInfo)
ServerInfo_User & copyUserInfo (ServerInfo_User &result, bool complete, bool internalInfo=false, bool sessionInfo=false) const
ServerInfo_User copyUserInfo (bool complete, bool internalInfo=false, bool sessionInfo=false) const

Protected Member Functions

virtual void logDebugMessage (const QString &)

Protected Attributes

QMap< int, Server_Room * > rooms
bool deleted
Server_DatabaseInterfacedatabaseInterface
AuthenticationResult authState
bool usingRealPassword
bool acceptsUserListChanges
bool acceptsRoomListChanges
bool idleClientWarningSent
Protected Attributes inherited from Server_AbstractUserInterface
Serverserver
Protected Attributes inherited from ServerInfo_User_Container
ServerInfo_User * userInfo

Private Slots

void pingClockTimeout ()

Private Member Functions

virtual void transmitProtocolItem (const ServerMessage &item)=0
Response::ResponseCode cmdPing (const Command_Ping &cmd, ResponseContainer &rc)
Response::ResponseCode cmdLogin (const Command_Login &cmd, ResponseContainer &rc)
Response::ResponseCode cmdMessage (const Command_Message &cmd, ResponseContainer &rc)
Response::ResponseCode cmdGetGamesOfUser (const Command_GetGamesOfUser &cmd, ResponseContainer &rc)
Response::ResponseCode cmdGetUserInfo (const Command_GetUserInfo &cmd, ResponseContainer &rc)
Response::ResponseCode cmdListRooms (const Command_ListRooms &cmd, ResponseContainer &rc)
Response::ResponseCode cmdJoinRoom (const Command_JoinRoom &cmd, ResponseContainer &rc)
Response::ResponseCode cmdListUsers (const Command_ListUsers &cmd, ResponseContainer &rc)
Response::ResponseCode cmdLeaveRoom (const Command_LeaveRoom &cmd, Server_Room *room, ResponseContainer &rc)
Response::ResponseCode cmdRoomSay (const Command_RoomSay &cmd, Server_Room *room, ResponseContainer &rc)
Response::ResponseCode cmdCreateGame (const Command_CreateGame &cmd, Server_Room *room, ResponseContainer &rc)
Response::ResponseCode cmdJoinGame (const Command_JoinGame &cmd, Server_Room *room, ResponseContainer &rc)
Response::ResponseCode processSessionCommandContainer (const CommandContainer &cont, ResponseContainer &rc)
virtual Response::ResponseCode processExtendedSessionCommand (int, const SessionCommand &, ResponseContainer &)
Response::ResponseCode processRoomCommandContainer (const CommandContainer &cont, ResponseContainer &rc)
Response::ResponseCode processGameCommandContainer (const CommandContainer &cont, ResponseContainer &rc)
Response::ResponseCode processModeratorCommandContainer (const CommandContainer &cont, ResponseContainer &rc)
virtual Response::ResponseCode processExtendedModeratorCommand (int, const ModeratorCommand &, ResponseContainer &)
Response::ResponseCode processAdminCommandContainer (const CommandContainer &cont, ResponseContainer &rc)
virtual Response::ResponseCode processExtendedAdminCommand (int, const AdminCommand &, ResponseContainer &)
void resetIdleTimer ()

Private Attributes

QList< int > messageSizeOverTime
QList< int > messageCountOverTime
QList< int > commandCountOverTime
int timeRunning
int lastDataReceived
int lastActionReceived

Additional Inherited Members

Static Public Member Functions inherited from Server_AbstractUserInterface
static SessionEvent * prepareSessionEvent (const ::google::protobuf::Message &sessionEvent)

Constructor & Destructor Documentation

◆ Server_ProtocolHandler()

Server_ProtocolHandler::Server_ProtocolHandler ( Server * _server,
Server_DatabaseInterface * _databaseInterface,
QObject * parent = 0 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Server_ProtocolHandler()

Server_ProtocolHandler::~Server_ProtocolHandler ( )

Member Function Documentation

◆ addSaidMessageSize()

bool Server_ProtocolHandler::addSaidMessageSize ( int size)
virtual

Implements Server_AbstractUserInterface.

Here is the caller graph for this function:

◆ cmdCreateGame()

Response::ResponseCode Server_ProtocolHandler::cmdCreateGame ( const Command_CreateGame & cmd,
Server_Room * room,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdGetGamesOfUser()

Response::ResponseCode Server_ProtocolHandler::cmdGetGamesOfUser ( const Command_GetGamesOfUser & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdGetUserInfo()

Response::ResponseCode Server_ProtocolHandler::cmdGetUserInfo ( const Command_GetUserInfo & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdJoinGame()

Response::ResponseCode Server_ProtocolHandler::cmdJoinGame ( const Command_JoinGame & cmd,
Server_Room * room,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdJoinRoom()

Response::ResponseCode Server_ProtocolHandler::cmdJoinRoom ( const Command_JoinRoom & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdLeaveRoom()

Response::ResponseCode Server_ProtocolHandler::cmdLeaveRoom ( const Command_LeaveRoom & cmd,
Server_Room * room,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdListRooms()

Response::ResponseCode Server_ProtocolHandler::cmdListRooms ( const Command_ListRooms & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdListUsers()

Response::ResponseCode Server_ProtocolHandler::cmdListUsers ( const Command_ListUsers & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdLogin()

Response::ResponseCode Server_ProtocolHandler::cmdLogin ( const Command_Login & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdMessage()

Response::ResponseCode Server_ProtocolHandler::cmdMessage ( const Command_Message & cmd,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdPing()

Response::ResponseCode Server_ProtocolHandler::cmdPing ( const Command_Ping & cmd,
ResponseContainer & rc )
private
Here is the caller graph for this function:

◆ cmdRoomSay()

Response::ResponseCode Server_ProtocolHandler::cmdRoomSay ( const Command_RoomSay & cmd,
Server_Room * room,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAcceptsRoomListChanges()

bool Server_ProtocolHandler::getAcceptsRoomListChanges ( ) const
inline

◆ getAcceptsUserListChanges()

bool Server_ProtocolHandler::getAcceptsUserListChanges ( ) const
inline

◆ getAddress()

virtual QString Server_ProtocolHandler::getAddress ( ) const
pure virtual

Implemented in AbstractServerSocketInterface, LocalServerInterface, TcpServerSocketInterface, and WebsocketServerSocketInterface.

Here is the caller graph for this function:

◆ getConnectionType()

virtual QString Server_ProtocolHandler::getConnectionType ( ) const
pure virtual

Implemented in LocalServerInterface, TcpServerSocketInterface, and WebsocketServerSocketInterface.

Here is the caller graph for this function:

◆ getDatabaseInterface()

Server_DatabaseInterface * Server_ProtocolHandler::getDatabaseInterface ( ) const
inline

◆ getLastCommandTime()

int Server_ProtocolHandler::getLastCommandTime ( ) const
inlinevirtual

◆ logDebugMessage()

virtual void Server_ProtocolHandler::logDebugMessage ( const QString & )
inlineprotectedvirtual

Reimplemented in AbstractServerSocketInterface.

Here is the caller graph for this function:

◆ pingClockTimeout

void Server_ProtocolHandler::pingClockTimeout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareDestroy

void Server_ProtocolHandler::prepareDestroy ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processAdminCommandContainer()

Response::ResponseCode Server_ProtocolHandler::processAdminCommandContainer ( const CommandContainer & cont,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processCommandContainer()

void Server_ProtocolHandler::processCommandContainer ( const CommandContainer & cont)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processExtendedAdminCommand()

virtual Response::ResponseCode Server_ProtocolHandler::processExtendedAdminCommand ( int ,
const AdminCommand & ,
ResponseContainer &  )
inlineprivatevirtual

Reimplemented in AbstractServerSocketInterface.

Here is the caller graph for this function:

◆ processExtendedModeratorCommand()

virtual Response::ResponseCode Server_ProtocolHandler::processExtendedModeratorCommand ( int ,
const ModeratorCommand & ,
ResponseContainer &  )
inlineprivatevirtual

Reimplemented in AbstractServerSocketInterface.

Here is the caller graph for this function:

◆ processExtendedSessionCommand()

virtual Response::ResponseCode Server_ProtocolHandler::processExtendedSessionCommand ( int ,
const SessionCommand & ,
ResponseContainer &  )
inlineprivatevirtual

Reimplemented in AbstractServerSocketInterface.

Here is the caller graph for this function:

◆ processGameCommandContainer()

Response::ResponseCode Server_ProtocolHandler::processGameCommandContainer ( const CommandContainer & cont,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processModeratorCommandContainer()

Response::ResponseCode Server_ProtocolHandler::processModeratorCommandContainer ( const CommandContainer & cont,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processRoomCommandContainer()

Response::ResponseCode Server_ProtocolHandler::processRoomCommandContainer ( const CommandContainer & cont,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processSessionCommandContainer()

Response::ResponseCode Server_ProtocolHandler::processSessionCommandContainer ( const CommandContainer & cont,
ResponseContainer & rc )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetIdleTimer()

void Server_ProtocolHandler::resetIdleTimer ( )
private
Here is the caller graph for this function:

◆ sendProtocolItem() [1/4]

void Server_ProtocolHandler::sendProtocolItem ( const GameEventContainer & item)
virtual

Implements Server_AbstractUserInterface.

Here is the call graph for this function:

◆ sendProtocolItem() [2/4]

void Server_ProtocolHandler::sendProtocolItem ( const Response & item)
virtual

Implements Server_AbstractUserInterface.

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

◆ sendProtocolItem() [3/4]

void Server_ProtocolHandler::sendProtocolItem ( const RoomEvent & item)
virtual

Implements Server_AbstractUserInterface.

Here is the call graph for this function:

◆ sendProtocolItem() [4/4]

void Server_ProtocolHandler::sendProtocolItem ( const SessionEvent & item)
virtual

Implements Server_AbstractUserInterface.

Here is the call graph for this function:

◆ transmitProtocolItem()

virtual void Server_ProtocolHandler::transmitProtocolItem ( const ServerMessage & item)
privatepure virtual

Implemented in AbstractServerSocketInterface, and LocalServerInterface.

Here is the caller graph for this function:

Member Data Documentation

◆ acceptsRoomListChanges

bool Server_ProtocolHandler::acceptsRoomListChanges
protected

◆ acceptsUserListChanges

bool Server_ProtocolHandler::acceptsUserListChanges
protected

◆ authState

AuthenticationResult Server_ProtocolHandler::authState
protected

◆ commandCountOverTime

QList<int> Server_ProtocolHandler::commandCountOverTime
private

◆ databaseInterface

Server_DatabaseInterface* Server_ProtocolHandler::databaseInterface
protected

◆ deleted

bool Server_ProtocolHandler::deleted
protected

◆ idleClientWarningSent

bool Server_ProtocolHandler::idleClientWarningSent
protected

◆ lastActionReceived

int Server_ProtocolHandler::lastActionReceived
private

◆ lastDataReceived

int Server_ProtocolHandler::lastDataReceived
private

◆ messageCountOverTime

QList<int> Server_ProtocolHandler::messageCountOverTime
private

◆ messageSizeOverTime

QList<int> Server_ProtocolHandler::messageSizeOverTime
private

◆ rooms

QMap<int, Server_Room *> Server_ProtocolHandler::rooms
protected

◆ timeRunning

int Server_ProtocolHandler::timeRunning
private

◆ usingRealPassword

bool Server_ProtocolHandler::usingRealPassword
protected

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