Cockatrice 2026-06-01-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ConnectionController Class Reference

#include <remote_connection_controller.h>

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

Signals

void windowTitleChanged (const QString &title)
void tabSupervisorStartRequested (const ServerInfo_User &info)
void tabSupervisorStopRequested ()
void statusChanged (ClientStatus status)

Public Member Functions

 ConnectionController (QWidget *dialogParent, QObject *parent=nullptr)
 ~ConnectionController () override
RemoteClientclient () const
void registerToServer ()
void forgotPasswordRequest ()
void connectToServer ()
void connectToServerDirect (const QString &host, unsigned int port, const QString &playerName, const QString &password)
void disconnectFromServer ()
void refreshWindowTitle ()

Private Slots

void onStatusChanged (ClientStatus status)
void onUserInfoReceived (const ServerInfo_User &info)
void onLoginError (int r, QString reasonStr, quint32 endTime, const QList< QString > &missingFeatures)
void onRegisterAccepted ()
void onRegisterAcceptedNeedsActivate ()
void onRegisterError (int r, QString reasonStr, quint32 endTime)
void onActivateAccepted ()
void onActivateError ()
void onProtocolVersionMismatch (int localVersion, int remoteVersion)
void onNotifyUserAboutUpdate ()
void onConnectionClosedEvent (const Event_ConnectionClosed &event)
void onServerShutdownEvent (const Event_ServerShutdown &event)
void onSocketError (const QString &errorStr)
void onServerTimeout ()
void onForgotPasswordSuccess ()
void onForgotPasswordError ()
void onPromptForgotPasswordReset ()
void onPromptForgotPasswordChallenge ()

Private Member Functions

void wireClientSignals ()
void updateWindowTitle ()

Static Private Member Functions

static QString extractInvalidUsernameMessage (QString &in)

Private Attributes

RemoteClientremoteClient {nullptr}
QThread * clientThread {nullptr}
QWidget * dialogParent {nullptr}
QMessageBox serverShutdownMessageBox
DlgConnectdlgConnect {nullptr}

Detailed Description

Owns the RemoteClient and its worker thread. Encapsulates all connection, authentication, and registration logic so that MainWindow only needs to react to high-level signals.

Constructor & Destructor Documentation

◆ ConnectionController()

ConnectionController::ConnectionController ( QWidget * dialogParent,
QObject * parent = nullptr )
explicit
Here is the call graph for this function:

◆ ~ConnectionController()

ConnectionController::~ConnectionController ( )
override

Member Function Documentation

◆ client()

RemoteClient * ConnectionController::client ( ) const
inline

◆ connectToServer()

void ConnectionController::connectToServer ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectToServerDirect()

void ConnectionController::connectToServerDirect ( const QString & host,
unsigned int port,
const QString & playerName,
const QString & password )

◆ disconnectFromServer()

void ConnectionController::disconnectFromServer ( )

◆ extractInvalidUsernameMessage()

QString ConnectionController::extractInvalidUsernameMessage ( QString & in)
staticprivate

Parse the server's pipe-delimited username-rule string into HTML.

Here is the caller graph for this function:

◆ forgotPasswordRequest()

void ConnectionController::forgotPasswordRequest ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onActivateAccepted

void ConnectionController::onActivateAccepted ( )
privateslot
Here is the caller graph for this function:

◆ onActivateError

void ConnectionController::onActivateError ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onConnectionClosedEvent

void ConnectionController::onConnectionClosedEvent ( const Event_ConnectionClosed & event)
privateslot
Here is the caller graph for this function:

◆ onForgotPasswordError

void ConnectionController::onForgotPasswordError ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onForgotPasswordSuccess

void ConnectionController::onForgotPasswordSuccess ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onLoginError

void ConnectionController::onLoginError ( int r,
QString reasonStr,
quint32 endTime,
const QList< QString > & missingFeatures )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onNotifyUserAboutUpdate

void ConnectionController::onNotifyUserAboutUpdate ( )
privateslot
Here is the caller graph for this function:

◆ onPromptForgotPasswordChallenge

void ConnectionController::onPromptForgotPasswordChallenge ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onPromptForgotPasswordReset

void ConnectionController::onPromptForgotPasswordReset ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onProtocolVersionMismatch

void ConnectionController::onProtocolVersionMismatch ( int localVersion,
int remoteVersion )
privateslot
Here is the caller graph for this function:

◆ onRegisterAccepted

void ConnectionController::onRegisterAccepted ( )
privateslot
Here is the caller graph for this function:

◆ onRegisterAcceptedNeedsActivate

void ConnectionController::onRegisterAcceptedNeedsActivate ( )
privateslot
Here is the caller graph for this function:

◆ onRegisterError

void ConnectionController::onRegisterError ( int r,
QString reasonStr,
quint32 endTime )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onServerShutdownEvent

void ConnectionController::onServerShutdownEvent ( const Event_ServerShutdown & event)
privateslot
Here is the caller graph for this function:

◆ onServerTimeout

void ConnectionController::onServerTimeout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onSocketError

void ConnectionController::onSocketError ( const QString & errorStr)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onStatusChanged

void ConnectionController::onStatusChanged ( ClientStatus status)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onUserInfoReceived

void ConnectionController::onUserInfoReceived ( const ServerInfo_User & info)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshWindowTitle()

void ConnectionController::refreshWindowTitle ( )
inline
Here is the call graph for this function:

◆ registerToServer()

void ConnectionController::registerToServer ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusChanged

void ConnectionController::statusChanged ( ClientStatus status)
signal
Here is the caller graph for this function:

◆ tabSupervisorStartRequested

void ConnectionController::tabSupervisorStartRequested ( const ServerInfo_User & info)
signal
Here is the caller graph for this function:

◆ tabSupervisorStopRequested

void ConnectionController::tabSupervisorStopRequested ( )
signal
Here is the caller graph for this function:

◆ updateWindowTitle()

void ConnectionController::updateWindowTitle ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowTitleChanged

void ConnectionController::windowTitleChanged ( const QString & title)
signal
Here is the caller graph for this function:

◆ wireClientSignals()

void ConnectionController::wireClientSignals ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ clientThread

QThread* ConnectionController::clientThread {nullptr}
private

◆ dialogParent

QWidget* ConnectionController::dialogParent {nullptr}
private

◆ dlgConnect

DlgConnect* ConnectionController::dlgConnect {nullptr}
private

◆ remoteClient

RemoteClient* ConnectionController::remoteClient {nullptr}
private

◆ serverShutdownMessageBox

QMessageBox ConnectionController::serverShutdownMessageBox
private

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