#include <server_game.h>
Signals | |
| void | sigStartGameIfReady (bool override) |
| void | gameInfoChanged (ServerInfo_Game gameInfo) |
Public Member Functions | |
| Server_Game (const ServerInfo_User &_creatorInfo, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, const QList< int > &_gameTypes, bool _onlyBuddies, bool _onlyRegistered, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, int _startingLifeTotal, bool _shareDecklistsOnLoad, Server_Room *parent) | |
| ~Server_Game () override | |
| Server_Room * | getRoom () const |
| void | getInfo (ServerInfo_Game &result) const |
| int | getHostId () const |
| ServerInfo_User * | getCreatorInfo () const |
| bool | getGameStarted () const |
| int | getPlayerCount () const |
| int | getSpectatorCount () const |
| QMap< int, Server_AbstractPlayer * > | getPlayers () const |
| Server_AbstractPlayer * | getPlayer (int id) const |
| const QMap< int, Server_AbstractParticipant * > & | getParticipants () const |
| int | getGameId () const |
| QString | getDescription () const |
| QString | getPassword () const |
| int | getMaxPlayers () const |
| bool | getSpectatorsAllowed () const |
| bool | getSpectatorsNeedPassword () const |
| bool | getSpectatorsCanTalk () const |
| bool | getSpectatorsSeeEverything () const |
| int | getStartingLifeTotal () const |
| bool | getShareDecklistsOnLoad () const |
| Response::ResponseCode | checkJoin (ServerInfo_User *user, const QString &_password, bool spectator, bool overrideRestrictions, bool asJudge) |
| bool | containsUser (const QString &userName) const |
| void | addPlayer (Server_AbstractUserInterface *userInterface, ResponseContainer &rc, bool spectator, bool judge, bool broadcastUpdate=true) |
| void | removeParticipant (Server_AbstractParticipant *participant, Event_Leave::LeaveReason reason) |
| void | removeArrowsRelatedToPlayer (GameEventStorage &ges, Server_AbstractPlayer *player) |
| void | unattachCards (GameEventStorage &ges, Server_AbstractPlayer *player) |
| bool | kickParticipant (int playerId) |
| void | startGameIfReady (bool forceStartGame) |
| void | stopGameIfFinished () |
| int | getActivePlayer () const |
| int | getActivePhase () const |
| void | setActivePlayer (int newPlayer) |
| void | setActivePhase (int newPhase) |
| void | removeArrows (int newPhase, bool force=false) |
| void | nextTurn () |
| int | getSecondsElapsed () const |
| bool | reverseTurnOrder () |
| void | createGameJoinedEvent (Server_AbstractParticipant *participant, ResponseContainer &rc, bool resuming) |
| GameEventContainer * | prepareGameEvent (const ::google::protobuf::Message &gameEvent, int playerId, GameEventContext *context=0) |
| GameEventContext | prepareGameEventContext (const ::google::protobuf::Message &gameEventContext) |
| void | sendGameStateToPlayers () |
| void | sendGameEventContainer (GameEventContainer *cont, GameEventStorageItem::EventRecipients recipients=GameEventStorageItem::SendToPrivate|GameEventStorageItem::SendToOthers, int privatePlayerId=-1) |
Public Attributes | |
| QRecursiveMutex | gameMutex |
Private Slots | |
| void | pingClockTimeout () |
| void | doStartGameIfReady (bool forceStartGame=false) |
Private Member Functions | |
| void | createGameStateChangedEvent (Event_GameStateChanged *event, Server_AbstractParticipant *recipient, bool omniscient, bool withUserInfo) |
| void | storeGameInformation () |
Private Attributes | |
| Server_Room * | room |
| int | nextPlayerId |
| int | hostId |
| ServerInfo_User * | creatorInfo |
| QMap< int, Server_AbstractParticipant * > | participants |
| QSet< QString > | allPlayersEver |
| QSet< QString > | allSpectatorsEver |
| bool | gameStarted |
| bool | gameClosed |
| int | gameId |
| QString | description |
| QString | password |
| int | maxPlayers |
| QList< int > | gameTypes |
| int | activePlayer |
| int | activePhase |
| bool | onlyBuddies |
| bool | onlyRegistered |
| bool | spectatorsAllowed |
| bool | spectatorsNeedPassword |
| bool | spectatorsCanTalk |
| bool | spectatorsSeeEverything |
| int | startingLifeTotal |
| bool | shareDecklistsOnLoad |
| int | inactivityCounter |
| int | startTimeOfThisGame |
| int | secondsElapsed |
| bool | firstGameStarted |
| bool | turnOrderReversed |
| QDateTime | startTime |
| QTimer * | pingClock |
| QList< GameReplay * > | replayList |
| GameReplay * | currentReplay |
| Server_Game::Server_Game | ( | const ServerInfo_User & | _creatorInfo, |
| int | _gameId, | ||
| const QString & | _description, | ||
| const QString & | _password, | ||
| int | _maxPlayers, | ||
| const QList< int > & | _gameTypes, | ||
| bool | _onlyBuddies, | ||
| bool | _onlyRegistered, | ||
| bool | _spectatorsAllowed, | ||
| bool | _spectatorsNeedPassword, | ||
| bool | _spectatorsCanTalk, | ||
| bool | _spectatorsSeeEverything, | ||
| int | _startingLifeTotal, | ||
| bool | _shareDecklistsOnLoad, | ||
| Server_Room * | parent ) |
|
override |
| void Server_Game::addPlayer | ( | Server_AbstractUserInterface * | userInterface, |
| ResponseContainer & | rc, | ||
| bool | spectator, | ||
| bool | judge, | ||
| bool | broadcastUpdate = true ) |
| Response::ResponseCode Server_Game::checkJoin | ( | ServerInfo_User * | user, |
| const QString & | _password, | ||
| bool | spectator, | ||
| bool | overrideRestrictions, | ||
| bool | asJudge ) |
| bool Server_Game::containsUser | ( | const QString & | userName | ) | const |
| void Server_Game::createGameJoinedEvent | ( | Server_AbstractParticipant * | participant, |
| ResponseContainer & | rc, | ||
| bool | resuming ) |
|
private |
|
privateslot |
|
signal |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Server_Game::getInfo | ( | ServerInfo_Game & | result | ) | const |
|
inline |
|
inline |
|
inline |
| Server_AbstractPlayer * Server_Game::getPlayer | ( | int | id | ) | const |
| int Server_Game::getPlayerCount | ( | ) | const |
| QMap< int, Server_AbstractPlayer * > Server_Game::getPlayers | ( | ) | const |
|
inline |
|
inline |
|
inline |
| int Server_Game::getSpectatorCount | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool Server_Game::kickParticipant | ( | int | playerId | ) |
| void Server_Game::nextTurn | ( | ) |
|
privateslot |
| GameEventContainer * Server_Game::prepareGameEvent | ( | const ::google::protobuf::Message & | gameEvent, |
| int | playerId, | ||
| GameEventContext * | context = 0 ) |
| GameEventContext Server_Game::prepareGameEventContext | ( | const ::google::protobuf::Message & | gameEventContext | ) |
| void Server_Game::removeArrows | ( | int | newPhase, |
| bool | force = false ) |
| void Server_Game::removeArrowsRelatedToPlayer | ( | GameEventStorage & | ges, |
| Server_AbstractPlayer * | player ) |
| void Server_Game::removeParticipant | ( | Server_AbstractParticipant * | participant, |
| Event_Leave::LeaveReason | reason ) |
|
inline |
| void Server_Game::sendGameEventContainer | ( | GameEventContainer * | cont, |
| GameEventStorageItem::EventRecipients | recipients = GameEventStorageItem::SendToPrivate | GameEventStorageItem::SendToOthers, | ||
| int | privatePlayerId = -1 ) |
| void Server_Game::sendGameStateToPlayers | ( | ) |
| void Server_Game::setActivePhase | ( | int | newPhase | ) |
| void Server_Game::setActivePlayer | ( | int | newPlayer | ) |
|
signal |
| void Server_Game::startGameIfReady | ( | bool | forceStartGame | ) |
| void Server_Game::stopGameIfFinished | ( | ) |
|
private |
| void Server_Game::unattachCards | ( | GameEventStorage & | ges, |
| Server_AbstractPlayer * | player ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutable |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |