Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
IntentOpenServerRoomByName Class Reference

Connects to the configured server and opens a room identified by its name. More...

#include <intent_open_server_room_by_name.h>

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

Public Member Functions

 IntentOpenServerRoomByName (TabSupervisor *_tabSupervisor, RemoteClient *_remoteClient, std::unique_ptr< ContextJoinRoom > _context, const QString &_roomName)
Public Member Functions inherited from Intent
 Intent (QObject *parent=nullptr)
 ~Intent () override
void execute ()

Protected Member Functions

bool checkPrecondition () const override
void onPreconditionSatisfied () override
void onPreconditionNotSatisfied () override
Protected Member Functions inherited from Intent
void runDependency (Intent *dependency)
void emitFinished ()
void emitFailed (const QString &reason)

Private Member Functions

void processListRooms (const Event_ListRooms &event)
void openRoom (const ServerInfo_Room &roomInfo)
void handleJoinResponse (const Response &response)
void onClientStatusChanged (ClientStatus status)
bool selectOpenRoom ()

Private Attributes

TabSupervisortabSupervisor
RemoteClientremoteClient
QScopedPointer< ContextJoinRoomcontext
QString roomName
bool listening = false
bool joinPending = false
QTimer checkTimer
QTimer refreshTimer

Additional Inherited Members

Signals inherited from Intent
void finished ()
void failed (QString reason)

Detailed Description

Connects to the configured server and opens a room identified by its name.

Room ids are assigned by the server per session, so the room is resolved by name from the room list once the client is logged in. If the room is already open it is simply selected.

The join itself is sent directly through the client instead of TabServer::joinRoom, so a failed join only fails the intent silently instead of popping a modal error box during startup. Success is routed to TabSupervisor::addRoomTab, the same tab-creation machinery the normal join flow uses.

Constructor & Destructor Documentation

◆ IntentOpenServerRoomByName()

IntentOpenServerRoomByName::IntentOpenServerRoomByName ( TabSupervisor * _tabSupervisor,
RemoteClient * _remoteClient,
std::unique_ptr< ContextJoinRoom > _context,
const QString & _roomName )
Here is the call graph for this function:

Member Function Documentation

◆ checkPrecondition()

bool IntentOpenServerRoomByName::checkPrecondition ( ) const
overrideprotectedvirtual

Implements Intent.

◆ handleJoinResponse()

void IntentOpenServerRoomByName::handleJoinResponse ( const Response & response)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onClientStatusChanged()

void IntentOpenServerRoomByName::onClientStatusChanged ( ClientStatus status)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onPreconditionNotSatisfied()

void IntentOpenServerRoomByName::onPreconditionNotSatisfied ( )
overrideprotectedvirtual

Implements Intent.

Here is the call graph for this function:

◆ onPreconditionSatisfied()

void IntentOpenServerRoomByName::onPreconditionSatisfied ( )
overrideprotectedvirtual

Implements Intent.

Here is the call graph for this function:

◆ openRoom()

void IntentOpenServerRoomByName::openRoom ( const ServerInfo_Room & roomInfo)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processListRooms()

void IntentOpenServerRoomByName::processListRooms ( const Event_ListRooms & event)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectOpenRoom()

bool IntentOpenServerRoomByName::selectOpenRoom ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ checkTimer

QTimer IntentOpenServerRoomByName::checkTimer
private

◆ context

QScopedPointer<ContextJoinRoom> IntentOpenServerRoomByName::context
private

◆ joinPending

bool IntentOpenServerRoomByName::joinPending = false
private

◆ listening

bool IntentOpenServerRoomByName::listening = false
private

◆ refreshTimer

QTimer IntentOpenServerRoomByName::refreshTimer
private

◆ remoteClient

RemoteClient* IntentOpenServerRoomByName::remoteClient
private

◆ roomName

QString IntentOpenServerRoomByName::roomName
private

◆ tabSupervisor

TabSupervisor* IntentOpenServerRoomByName::tabSupervisor
private

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