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

#include <server_player.h>

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

Public Member Functions

 Server_Player (Server_Game *_game, int _playerId, const ServerInfo_User &_userInfo, bool _judge, Server_AbstractUserInterface *_handler)
 ~Server_Player () override
const QMap< int, Server_Counter * > & getCounters () const
int newCounterId () const
void addCounter (Server_Counter *counter)
void setupZones () override
void clearZones () override
Response::ResponseCode drawCards (GameEventStorage &ges, int number)
void onCardBeingMoved (GameEventStorage &ges, const MoveCardStruct &cardStruct, Server_CardZone *startzone, Server_CardZone *targetzone, bool undoingDraw) override
Response::ResponseCode cmdDeckSelect (const Command_DeckSelect &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdSetSideboardPlan (const Command_SetSideboardPlan &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdSetSideboardLock (const Command_SetSideboardLock &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdShuffle (const Command_Shuffle &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdMulligan (const Command_Mulligan &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdDrawCards (const Command_DrawCards &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdUndoDraw (const Command_UndoDraw &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdIncCounter (const Command_IncCounter &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdCreateCounter (const Command_CreateCounter &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdSetCounter (const Command_SetCounter &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdDelCounter (const Command_DelCounter &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdNextTurn (const Command_NextTurn &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdSetActivePhase (const Command_SetActivePhase &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Response::ResponseCode cmdReverseTurn (const Command_ReverseTurn &, ResponseContainer &, GameEventStorage &ges) override
Response::ResponseCode cmdChangeZoneProperties (const Command_ChangeZoneProperties &cmd, ResponseContainer &rc, GameEventStorage &ges) override
void getInfo (ServerInfo_Player *info, Server_AbstractParticipant *playerWhosAsking, bool omniscient, bool withUserInfo) override
Public Member Functions inherited from Server_AbstractPlayer
 Server_AbstractPlayer (Server_Game *_game, int _playerId, const ServerInfo_User &_userInfo, bool _judge, Server_AbstractUserInterface *_handler)
 ~Server_AbstractPlayer () override
void prepareDestroy () override
const DeckListgetDeckList () const
bool getReadyStart () const
void setReadyStart (bool _readyStart)
bool getConceded () const
void setConceded (bool _conceded)
const QMap< QString, Server_CardZone * > & getZones () const
const QMap< int, Server_Arrow * > & getArrows () const
int newCardId ()
int newArrowId () const
void addZone (Server_CardZone *zone)
void addArrow (Server_Arrow *arrow)
void updateArrowId (int id)
bool deleteArrow (int arrowId)
Response::ResponseCode moveCard (GameEventStorage &ges, Server_CardZone *startzone, const QList< const CardToMove * > &_cards, Server_CardZone *targetzone, int xCoord, int yCoord, bool fixFreeSpaces=true, bool undoingDraw=false, bool isReversed=false)
void unattachCard (GameEventStorage &ges, Server_Card *card)
Response::ResponseCode setCardAttrHelper (GameEventStorage &ges, int targetPlayerId, const QString &zone, int cardId, CardAttribute attribute, const QString &attrValue, Server_Card *unzonedCard=nullptr)
virtual Response::ResponseCode cmdConcede (const Command_Concede &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdUnconcede (const Command_Unconcede &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdReadyStart (const Command_ReadyStart &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdRollDie (const Command_RollDie &cmd, ResponseContainer &rc, GameEventStorage &ges) const override
virtual Response::ResponseCode cmdMoveCard (const Command_MoveCard &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdFlipCard (const Command_FlipCard &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdAttachCard (const Command_AttachCard &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdCreateToken (const Command_CreateToken &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdCreateArrow (const Command_CreateArrow &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdDeleteArrow (const Command_DeleteArrow &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdSetCardAttr (const Command_SetCardAttr &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdSetCardCounter (const Command_SetCardCounter &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdIncCardCounter (const Command_IncCardCounter &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdDumpZone (const Command_DumpZone &cmd, ResponseContainer &rc, GameEventStorage &ges) override
virtual Response::ResponseCode cmdRevealCards (const Command_RevealCards &cmd, ResponseContainer &rc, GameEventStorage &ges) override
Public Member Functions inherited from Server_AbstractParticipant
 Server_AbstractParticipant (Server_Game *_game, int _playerId, const ServerInfo_User &_userInfo, bool _judge, Server_AbstractUserInterface *_handler)
 ~Server_AbstractParticipant () override
void removeFromGame ()
Server_AbstractUserInterfacegetUserInterface () const
void setUserInterface (Server_AbstractUserInterface *_userInterface)
void disconnectClient ()
int getPlayerId () const
bool getSpectator () const
bool getJudge () const
Server_GamegetGame () const
int getPingTime () const
bool updatePingTime ()
void getProperties (ServerInfo_PlayerProperties &result, bool withUserInfo)
virtual Response::ResponseCode cmdLeaveGame (const Command_LeaveGame &cmd, ResponseContainer &rc, GameEventStorage &ges)
virtual Response::ResponseCode cmdKickFromGame (const Command_KickFromGame &cmd, ResponseContainer &rc, GameEventStorage &ges)
virtual Response::ResponseCode cmdJudge (const Command_Judge &cmd, ResponseContainer &rc, GameEventStorage &ges)
virtual Response::ResponseCode cmdGameSay (const Command_GameSay &cmd, ResponseContainer &rc, GameEventStorage &ges)
Response::ResponseCode processGameCommand (const GameCommand &command, ResponseContainer &rc, GameEventStorage &ges)
void sendGameEvent (const GameEventContainer &event)
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

Private Attributes

QMap< int, Server_Counter * > counters
QList< int > lastDrawList

Additional Inherited Members

Protected Member Functions inherited from Server_AbstractPlayer
void revealTopCardIfNeeded (Server_CardZone *zone, GameEventStorage &ges)
Protected Attributes inherited from Server_AbstractPlayer
bool conceded
DeckListdeck
bool sideboardLocked
QMap< QString, Server_CardZone * > zones
bool readyStart
int nextCardId
Protected Attributes inherited from Server_AbstractParticipant
Server_Gamegame
Server_AbstractUserInterfaceuserInterface
int pingTime
int playerId
bool spectator
bool judge
QMutex playerMutex
Protected Attributes inherited from ServerInfo_User_Container
ServerInfo_User * userInfo

Constructor & Destructor Documentation

◆ Server_Player()

Server_Player::Server_Player ( Server_Game * _game,
int _playerId,
const ServerInfo_User & _userInfo,
bool _judge,
Server_AbstractUserInterface * _handler )
Here is the call graph for this function:

◆ ~Server_Player()

Server_Player::~Server_Player ( )
overridedefault

Member Function Documentation

◆ addCounter()

void Server_Player::addCounter ( Server_Counter * counter)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearZones()

void Server_Player::clearZones ( )
overridevirtual

Reimplemented from Server_AbstractPlayer.

Here is the call graph for this function:

◆ cmdChangeZoneProperties()

Response::ResponseCode Server_Player::cmdChangeZoneProperties ( const Command_ChangeZoneProperties & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractPlayer.

Here is the call graph for this function:

◆ cmdCreateCounter()

Response::ResponseCode Server_Player::cmdCreateCounter ( const Command_CreateCounter & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdDeckSelect()

Response::ResponseCode Server_Player::cmdDeckSelect ( const Command_DeckSelect & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdDelCounter()

Response::ResponseCode Server_Player::cmdDelCounter ( const Command_DelCounter & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdDrawCards()

Response::ResponseCode Server_Player::cmdDrawCards ( const Command_DrawCards & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdIncCounter()

Response::ResponseCode Server_Player::cmdIncCounter ( const Command_IncCounter & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdMulligan()

Response::ResponseCode Server_Player::cmdMulligan ( const Command_Mulligan & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdNextTurn()

Response::ResponseCode Server_Player::cmdNextTurn ( const Command_NextTurn & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

◆ cmdReverseTurn()

Response::ResponseCode Server_Player::cmdReverseTurn ( const Command_ReverseTurn & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdSetActivePhase()

Response::ResponseCode Server_Player::cmdSetActivePhase ( const Command_SetActivePhase & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

◆ cmdSetCounter()

Response::ResponseCode Server_Player::cmdSetCounter ( const Command_SetCounter & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdSetSideboardLock()

Response::ResponseCode Server_Player::cmdSetSideboardLock ( const Command_SetSideboardLock & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdSetSideboardPlan()

Response::ResponseCode Server_Player::cmdSetSideboardPlan ( const Command_SetSideboardPlan & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

◆ cmdShuffle()

Response::ResponseCode Server_Player::cmdShuffle ( const Command_Shuffle & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ cmdUndoDraw()

Response::ResponseCode Server_Player::cmdUndoDraw ( const Command_UndoDraw & cmd,
ResponseContainer & rc,
GameEventStorage & ges )
overridevirtual

Reimplemented from Server_AbstractParticipant.

Here is the call graph for this function:

◆ drawCards()

Response::ResponseCode Server_Player::drawCards ( GameEventStorage & ges,
int number )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCounters()

const QMap< int, Server_Counter * > & Server_Player::getCounters ( ) const
inline

◆ getInfo()

void Server_Player::getInfo ( ServerInfo_Player * info,
Server_AbstractParticipant * playerWhosAsking,
bool omniscient,
bool withUserInfo )
overridevirtual

Reimplemented from Server_AbstractPlayer.

Here is the call graph for this function:

◆ newCounterId()

int Server_Player::newCounterId ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCardBeingMoved()

void Server_Player::onCardBeingMoved ( GameEventStorage & ges,
const MoveCardStruct & cardStruct,
Server_CardZone * startzone,
Server_CardZone * targetzone,
bool undoingDraw )
overridevirtual

Reimplemented from Server_AbstractPlayer.

Here is the call graph for this function:

◆ setupZones()

void Server_Player::setupZones ( )
overridevirtual

Reimplemented from Server_AbstractPlayer.

Here is the call graph for this function:

Member Data Documentation

◆ counters

QMap<int, Server_Counter *> Server_Player::counters
private

◆ lastDrawList

QList<int> Server_Player::lastDrawList
private

The documentation for this class was generated from the following files:
  • libcockatrice_network/libcockatrice/network/server/remote/game/server_player.h
  • libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp