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

#include <game_event_handler.h>

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

Public Slots

void sendGameCommand (PendingCommand *pend, int playerId=-1)
void sendGameCommand (const ::google::protobuf::Message &command, int playerId=-1)

Signals

void emitUserEvent ()
void addPlayerToAutoCompleteList (QString playerName)
void localPlayerDeckSelected (Player *localPlayer, int playerId, ServerInfo_Player playerInfo)
void remotePlayerDeckSelected (QString deckList, int playerId, QString playerName)
void remotePlayersDecksSelected (QVector< QPair< int, QPair< QString, QString > > > opponentDecks)
void localPlayerSideboardLocked (int playerId, bool sideboardLocked)
void localPlayerReadyStateChanged (int playerId, bool ready)
void gameStopped ()
void gameClosed ()
void playerPropertiesChanged (const ServerInfo_PlayerProperties &prop, int playerId)
void playerJoined (const ServerInfo_PlayerProperties &playerInfo)
void playerLeft (int leavingPlayerId)
void playerKicked ()
void spectatorJoined (const ServerInfo_PlayerProperties &spectatorInfo)
void spectatorLeft (int leavingSpectatorId)
void gameFlooded ()
void containerProcessingStarted (GameEventContext context)
void setContextJudgeName (QString judgeName)
void containerProcessingDone ()
void logSpectatorSay (ServerInfo_User userInfo, QString message)
void logSpectatorLeave (QString name, QString reason)
void logGameStart ()
void logReadyStart (Player *player)
void logNotReadyStart (Player *player)
void logDeckSelect (Player *player, QString deckHash, int sideboardSize)
void logSideboardLockSet (Player *player, bool sideboardLocked)
void logConnectionStateChanged (Player *player, bool connected)
void logJoinSpectator (QString spectatorName)
void logJoinPlayer (Player *player)
void logLeave (Player *player, QString reason)
void logKicked ()
void logTurnReversed (Player *player, bool reversed)
void logGameClosed ()
void logActivePlayer (Player *activePlayer)
void logActivePhaseChanged (int activePhase)
void logConcede (int playerId)
void logUnconcede (int playerId)

Public Member Functions

 GameEventHandler (AbstractGame *_game)
void handleNextTurn ()
void handleReverseTurn ()
void handleActiveLocalPlayerConceded ()
void handleActiveLocalPlayerUnconceded ()
void handleActivePhaseChanged (int phase)
void handleGameLeft ()
void handleChatMessageSent (const QString &chatMessage)
void handleArrowDeletion (int arrowId)
void eventSpectatorSay (const Event_GameSay &event, int eventPlayerId, const GameEventContext &context)
void eventSpectatorLeave (const Event_Leave &event, int eventPlayerId, const GameEventContext &context)
void eventGameStateChanged (const Event_GameStateChanged &event, int eventPlayerId, const GameEventContext &context)
void processCardAttachmentsForPlayers (const Event_GameStateChanged &event)
void eventPlayerPropertiesChanged (const Event_PlayerPropertiesChanged &event, int eventPlayerId, const GameEventContext &context)
void eventJoin (const Event_Join &event, int eventPlayerId, const GameEventContext &context)
void eventLeave (const Event_Leave &event, int eventPlayerId, const GameEventContext &context)
QString getLeaveReason (Event_Leave::LeaveReason reason)
void eventKicked (const Event_Kicked &event, int eventPlayerId, const GameEventContext &context)
void eventGameHostChanged (const Event_GameHostChanged &event, int eventPlayerId, const GameEventContext &context)
void eventGameClosed (const Event_GameClosed &event, int eventPlayerId, const GameEventContext &context)
void eventSetActivePlayer (const Event_SetActivePlayer &event, int eventPlayerId, const GameEventContext &context)
void eventSetActivePhase (const Event_SetActivePhase &event, int eventPlayerId, const GameEventContext &context)
void eventPing (const Event_Ping &event, int eventPlayerId, const GameEventContext &context)
void eventReverseTurn (const Event_ReverseTurn &event, int eventPlayerId, const GameEventContext &)
void commandFinished (const Response &response)
void processGameEventContainer (const GameEventContainer &cont, AbstractClient *client, EventProcessingOptions options)
PendingCommandprepareGameCommand (const ::google::protobuf::Message &cmd)
PendingCommandprepareGameCommand (const QList< const ::google::protobuf::Message * > &cmdList)

Private Attributes

AbstractGamegame

Constructor & Destructor Documentation

◆ GameEventHandler()

GameEventHandler::GameEventHandler ( AbstractGame * _game)
explicit

Member Function Documentation

◆ addPlayerToAutoCompleteList

void GameEventHandler::addPlayerToAutoCompleteList ( QString playerName)
signal
Here is the caller graph for this function:

◆ commandFinished()

void GameEventHandler::commandFinished ( const Response & response)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ containerProcessingDone

void GameEventHandler::containerProcessingDone ( )
signal
Here is the caller graph for this function:

◆ containerProcessingStarted

void GameEventHandler::containerProcessingStarted ( GameEventContext context)
signal
Here is the caller graph for this function:

◆ emitUserEvent

void GameEventHandler::emitUserEvent ( )
signal
Here is the caller graph for this function:

◆ eventGameClosed()

void GameEventHandler::eventGameClosed ( const Event_GameClosed & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventGameHostChanged()

void GameEventHandler::eventGameHostChanged ( const Event_GameHostChanged & event,
int eventPlayerId,
const GameEventContext & context )
Here is the caller graph for this function:

◆ eventGameStateChanged()

void GameEventHandler::eventGameStateChanged ( const Event_GameStateChanged & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventJoin()

void GameEventHandler::eventJoin ( const Event_Join & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventKicked()

void GameEventHandler::eventKicked ( const Event_Kicked & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventLeave()

void GameEventHandler::eventLeave ( const Event_Leave & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventPing()

void GameEventHandler::eventPing ( const Event_Ping & event,
int eventPlayerId,
const GameEventContext & context )

◆ eventPlayerPropertiesChanged()

void GameEventHandler::eventPlayerPropertiesChanged ( const Event_PlayerPropertiesChanged & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventReverseTurn()

void GameEventHandler::eventReverseTurn ( const Event_ReverseTurn & event,
int eventPlayerId,
const GameEventContext &  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventSetActivePhase()

void GameEventHandler::eventSetActivePhase ( const Event_SetActivePhase & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventSetActivePlayer()

void GameEventHandler::eventSetActivePlayer ( const Event_SetActivePlayer & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventSpectatorLeave()

void GameEventHandler::eventSpectatorLeave ( const Event_Leave & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventSpectatorSay()

void GameEventHandler::eventSpectatorSay ( const Event_GameSay & event,
int eventPlayerId,
const GameEventContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gameClosed

void GameEventHandler::gameClosed ( )
signal
Here is the caller graph for this function:

◆ gameFlooded

void GameEventHandler::gameFlooded ( )
signal
Here is the caller graph for this function:

◆ gameStopped

void GameEventHandler::gameStopped ( )
signal
Here is the caller graph for this function:

◆ getLeaveReason()

QString GameEventHandler::getLeaveReason ( Event_Leave::LeaveReason reason)
Here is the caller graph for this function:

◆ handleActiveLocalPlayerConceded()

void GameEventHandler::handleActiveLocalPlayerConceded ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleActiveLocalPlayerUnconceded()

void GameEventHandler::handleActiveLocalPlayerUnconceded ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleActivePhaseChanged()

void GameEventHandler::handleActivePhaseChanged ( int phase)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleArrowDeletion()

void GameEventHandler::handleArrowDeletion ( int arrowId)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleChatMessageSent()

void GameEventHandler::handleChatMessageSent ( const QString & chatMessage)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleGameLeft()

void GameEventHandler::handleGameLeft ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleNextTurn()

void GameEventHandler::handleNextTurn ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleReverseTurn()

void GameEventHandler::handleReverseTurn ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ localPlayerDeckSelected

void GameEventHandler::localPlayerDeckSelected ( Player * localPlayer,
int playerId,
ServerInfo_Player playerInfo )
signal
Here is the caller graph for this function:

◆ localPlayerReadyStateChanged

void GameEventHandler::localPlayerReadyStateChanged ( int playerId,
bool ready )
signal
Here is the caller graph for this function:

◆ localPlayerSideboardLocked

void GameEventHandler::localPlayerSideboardLocked ( int playerId,
bool sideboardLocked )
signal
Here is the caller graph for this function:

◆ logActivePhaseChanged

void GameEventHandler::logActivePhaseChanged ( int activePhase)
signal
Here is the caller graph for this function:

◆ logActivePlayer

void GameEventHandler::logActivePlayer ( Player * activePlayer)
signal
Here is the caller graph for this function:

◆ logConcede

void GameEventHandler::logConcede ( int playerId)
signal
Here is the caller graph for this function:

◆ logConnectionStateChanged

void GameEventHandler::logConnectionStateChanged ( Player * player,
bool connected )
signal
Here is the caller graph for this function:

◆ logDeckSelect

void GameEventHandler::logDeckSelect ( Player * player,
QString deckHash,
int sideboardSize )
signal
Here is the caller graph for this function:

◆ logGameClosed

void GameEventHandler::logGameClosed ( )
signal
Here is the caller graph for this function:

◆ logGameStart

void GameEventHandler::logGameStart ( )
signal
Here is the caller graph for this function:

◆ logJoinPlayer

void GameEventHandler::logJoinPlayer ( Player * player)
signal
Here is the caller graph for this function:

◆ logJoinSpectator

void GameEventHandler::logJoinSpectator ( QString spectatorName)
signal
Here is the caller graph for this function:

◆ logKicked

void GameEventHandler::logKicked ( )
signal
Here is the caller graph for this function:

◆ logLeave

void GameEventHandler::logLeave ( Player * player,
QString reason )
signal
Here is the caller graph for this function:

◆ logNotReadyStart

void GameEventHandler::logNotReadyStart ( Player * player)
signal
Here is the caller graph for this function:

◆ logReadyStart

void GameEventHandler::logReadyStart ( Player * player)
signal
Here is the caller graph for this function:

◆ logSideboardLockSet

void GameEventHandler::logSideboardLockSet ( Player * player,
bool sideboardLocked )
signal
Here is the caller graph for this function:

◆ logSpectatorLeave

void GameEventHandler::logSpectatorLeave ( QString name,
QString reason )
signal
Here is the caller graph for this function:

◆ logSpectatorSay

void GameEventHandler::logSpectatorSay ( ServerInfo_User userInfo,
QString message )
signal
Here is the caller graph for this function:

◆ logTurnReversed

void GameEventHandler::logTurnReversed ( Player * player,
bool reversed )
signal
Here is the caller graph for this function:

◆ logUnconcede

void GameEventHandler::logUnconcede ( int playerId)
signal
Here is the caller graph for this function:

◆ playerJoined

void GameEventHandler::playerJoined ( const ServerInfo_PlayerProperties & playerInfo)
signal
Here is the caller graph for this function:

◆ playerKicked

void GameEventHandler::playerKicked ( )
signal
Here is the caller graph for this function:

◆ playerLeft

void GameEventHandler::playerLeft ( int leavingPlayerId)
signal
Here is the caller graph for this function:

◆ playerPropertiesChanged

void GameEventHandler::playerPropertiesChanged ( const ServerInfo_PlayerProperties & prop,
int playerId )
signal
Here is the caller graph for this function:

◆ prepareGameCommand() [1/2]

PendingCommand * GameEventHandler::prepareGameCommand ( const ::google::protobuf::Message & cmd)

◆ prepareGameCommand() [2/2]

PendingCommand * GameEventHandler::prepareGameCommand ( const QList< const ::google::protobuf::Message * > & cmdList)

◆ processCardAttachmentsForPlayers()

void GameEventHandler::processCardAttachmentsForPlayers ( const Event_GameStateChanged & event)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processGameEventContainer()

void GameEventHandler::processGameEventContainer ( const GameEventContainer & cont,
AbstractClient * client,
EventProcessingOptions options )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remotePlayerDeckSelected

void GameEventHandler::remotePlayerDeckSelected ( QString deckList,
int playerId,
QString playerName )
signal
Here is the caller graph for this function:

◆ remotePlayersDecksSelected

void GameEventHandler::remotePlayersDecksSelected ( QVector< QPair< int, QPair< QString, QString > > > opponentDecks)
signal
Here is the caller graph for this function:

◆ sendGameCommand [1/2]

void GameEventHandler::sendGameCommand ( const ::google::protobuf::Message & command,
int playerId = -1 )
slot

◆ sendGameCommand [2/2]

void GameEventHandler::sendGameCommand ( PendingCommand * pend,
int playerId = -1 )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContextJudgeName

void GameEventHandler::setContextJudgeName ( QString judgeName)
signal
Here is the caller graph for this function:

◆ spectatorJoined

void GameEventHandler::spectatorJoined ( const ServerInfo_PlayerProperties & spectatorInfo)
signal
Here is the caller graph for this function:

◆ spectatorLeft

void GameEventHandler::spectatorLeft ( int leavingSpectatorId)
signal
Here is the caller graph for this function:

Member Data Documentation

◆ game

AbstractGame* GameEventHandler::game
private

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