Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
IntentUrlParser Class Reference

Parses cockatrice:// links and runs them as serialized intent chains. More...

#include <url_parser.h>

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

Signals

void urlChainFinished (bool connected)
 Emitted when the last queued chain ended; carries whether the client is logged in.

Public Member Functions

 IntentUrlParser (QObject *parent, MainWindow *mainWindow)
void handle (const QString &urlStr)

Private Member Functions

Intent * createJoinGameIntent (const QUrlQuery &query, PendingIntentChain &chain)
Intent * createOpenDeckIntent (const QUrlQuery &query, PendingIntentChain &chain)
QString generateJoinGameMessage (const ContextJoinGame &context, const QString &gameDescription)
bool isConnectedTo (const QString &hostname, const QString &port) const
void startNextChain ()
void chainEnded (bool chainSucceeded)
void onChainIntentDestroyed ()
void restorePreviousServer (const PendingIntentChain &chain)
void restoreToPreviousServer (const PendingIntentChain &chain)

Private Attributes

MainWindow * mainWindow
QList< PendingIntentChain > pendingChains
bool chainRunning = false
QMetaObject::Connection chainBackstopConnection

Detailed Description

Parses cockatrice:// links and runs them as serialized intent chains.

Links are parsed by action (joingame/opendeck) and translated into an intent chain. Chains are queued and run one at a time: a document can hand multiple links to the window while an earlier chain still connects, and running two connect chains concurrently tears the connection down. urlChainFinished is emitted once the queue has fully drained.

Constructor & Destructor Documentation

◆ IntentUrlParser()

IntentUrlParser::IntentUrlParser ( QObject * parent,
MainWindow * mainWindow )
Here is the caller graph for this function:

Member Function Documentation

◆ chainEnded()

void IntentUrlParser::chainEnded ( bool chainSucceeded)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createJoinGameIntent()

Intent * IntentUrlParser::createJoinGameIntent ( const QUrlQuery & query,
PendingIntentChain & chain )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createOpenDeckIntent()

Intent * IntentUrlParser::createOpenDeckIntent ( const QUrlQuery & query,
PendingIntentChain & chain )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateJoinGameMessage()

QString IntentUrlParser::generateJoinGameMessage ( const ContextJoinGame & context,
const QString & gameDescription )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle()

void IntentUrlParser::handle ( const QString & urlStr)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isConnectedTo()

bool IntentUrlParser::isConnectedTo ( const QString & hostname,
const QString & port ) const
nodiscardprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onChainIntentDestroyed()

void IntentUrlParser::onChainIntentDestroyed ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ restorePreviousServer()

void IntentUrlParser::restorePreviousServer ( const PendingIntentChain & chain)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ restoreToPreviousServer()

void IntentUrlParser::restoreToPreviousServer ( const PendingIntentChain & chain)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startNextChain()

void IntentUrlParser::startNextChain ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ urlChainFinished

void IntentUrlParser::urlChainFinished ( bool connected)
signal

Emitted when the last queued chain ended; carries whether the client is logged in.

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

Member Data Documentation

◆ chainBackstopConnection

QMetaObject::Connection IntentUrlParser::chainBackstopConnection
private

◆ chainRunning

bool IntentUrlParser::chainRunning = false
private

◆ mainWindow

MainWindow* IntentUrlParser::mainWindow
private

◆ pendingChains

QList<PendingIntentChain> IntentUrlParser::pendingChains
private

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