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

#include <serversocketinterface.h>

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

Public Slots

void initConnection (int socketDescriptor)
Public Slots inherited from Server_ProtocolHandler
void prepareDestroy ()

Public Member Functions

 TcpServerSocketInterface (Servatrice *_server, Servatrice_DatabaseInterface *_databaseInterface, QObject *parent=0)
 ~TcpServerSocketInterface ()
QHostAddress getPeerAddress () const
QString getAddress () const
QString getConnectionType () const
Public Member Functions inherited from AbstractServerSocketInterface
 AbstractServerSocketInterface (Servatrice *_server, Servatrice_DatabaseInterface *_databaseInterface, QObject *parent=0)
 ~AbstractServerSocketInterface ()
bool initSession ()
void transmitProtocolItem (const ServerMessage &item)
Public Member Functions inherited from Server_ProtocolHandler
 Server_ProtocolHandler (Server *_server, Server_DatabaseInterface *_databaseInterface, QObject *parent=0)
 ~Server_ProtocolHandler ()
bool getAcceptsUserListChanges () const
bool getAcceptsRoomListChanges () const
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 Slots

void readClient ()
void flushOutputQueue ()
Protected Slots inherited from AbstractServerSocketInterface
void catchSocketError (QAbstractSocket::SocketError socketError)
void catchSocketDisconnected ()
virtual void flushOutputQueue ()=0

Protected Member Functions

void writeToSocket (QByteArray &data)
void flushSocket ()
void initSessionDeprecated ()
bool initTcpSession ()
Protected Member Functions inherited from AbstractServerSocketInterface
void logDebugMessage (const QString &message)
bool tooManyRegistrationAttempts (const QString &ipAddress)

Private Attributes

QTcpSocket * socket
QByteArray inputBuffer
bool messageInProgress
bool handshakeStarted
int messageLength

Additional Inherited Members

Signals inherited from AbstractServerSocketInterface
void outputQueueChanged ()
void incTxBytes (qint64 amount)
Static Public Member Functions inherited from Server_AbstractUserInterface
static SessionEvent * prepareSessionEvent (const ::google::protobuf::Message &sessionEvent)
Protected Attributes inherited from AbstractServerSocketInterface
Servatriceservatrice
QList< ServerMessage > outputQueue
QMutex outputQueueMutex
Protected Attributes inherited from Server_ProtocolHandler
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

Constructor & Destructor Documentation

◆ TcpServerSocketInterface()

TcpServerSocketInterface::TcpServerSocketInterface ( Servatrice * _server,
Servatrice_DatabaseInterface * _databaseInterface,
QObject * parent = 0 )
Here is the call graph for this function:

◆ ~TcpServerSocketInterface()

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

Member Function Documentation

◆ flushOutputQueue

void TcpServerSocketInterface::flushOutputQueue ( )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flushSocket()

void TcpServerSocketInterface::flushSocket ( )
inlineprotectedvirtual

Implements AbstractServerSocketInterface.

Here is the caller graph for this function:

◆ getAddress()

QString TcpServerSocketInterface::getAddress ( ) const
inlinevirtual

Implements AbstractServerSocketInterface.

Here is the caller graph for this function:

◆ getConnectionType()

QString TcpServerSocketInterface::getConnectionType ( ) const
inlinevirtual

◆ getPeerAddress()

QHostAddress TcpServerSocketInterface::getPeerAddress ( ) const
inlinevirtual

◆ initConnection

void TcpServerSocketInterface::initConnection ( int socketDescriptor)
slot
Here is the call graph for this function:

◆ initSessionDeprecated()

void TcpServerSocketInterface::initSessionDeprecated ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initTcpSession()

bool TcpServerSocketInterface::initTcpSession ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readClient

void TcpServerSocketInterface::readClient ( )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeToSocket()

void TcpServerSocketInterface::writeToSocket ( QByteArray & data)
inlineprotectedvirtual

Implements AbstractServerSocketInterface.

Here is the caller graph for this function:

Member Data Documentation

◆ handshakeStarted

bool TcpServerSocketInterface::handshakeStarted
private

◆ inputBuffer

QByteArray TcpServerSocketInterface::inputBuffer
private

◆ messageInProgress

bool TcpServerSocketInterface::messageInProgress
private

◆ messageLength

int TcpServerSocketInterface::messageLength
private

◆ socket

QTcpSocket* TcpServerSocketInterface::socket
private

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