mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Fixed elevation of spectator rights; added some spectator options; closes bug 0000005
This commit is contained in:
parent
604d1ffa94
commit
befafa28ae
26 changed files with 430 additions and 220 deletions
|
|
@ -40,6 +40,9 @@ private:
|
|||
int maxPlayers;
|
||||
int activePlayer, activePhase;
|
||||
bool spectatorsAllowed;
|
||||
bool spectatorsNeedPassword;
|
||||
bool spectatorsCanTalk;
|
||||
bool spectatorsSeeEverything;
|
||||
int inactivityCounter;
|
||||
QTimer *pingClock;
|
||||
signals:
|
||||
|
|
@ -47,7 +50,7 @@ signals:
|
|||
private slots:
|
||||
void pingClockTimeout();
|
||||
public:
|
||||
Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, bool _spectatorsAllowed, QObject *parent = 0);
|
||||
Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, bool _spectatorsAllowed, bool _spectatorsNeedPassword, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, QObject *parent = 0);
|
||||
~Server_Game();
|
||||
Server_Player *getCreator() const { return creator; }
|
||||
QString getCreatorName() const { return creator ? creator->getPlayerName() : QString(); }
|
||||
|
|
@ -61,6 +64,9 @@ public:
|
|||
QString getPassword() const { return password; }
|
||||
int getMaxPlayers() const { return maxPlayers; }
|
||||
bool getSpectatorsAllowed() const { return spectatorsAllowed; }
|
||||
bool getSpectatorsNeedPassword() const { return spectatorsNeedPassword; }
|
||||
bool getSpectatorsCanTalk() const { return spectatorsCanTalk; }
|
||||
bool getSpectatorsSeeEverything() const { return spectatorsSeeEverything; }
|
||||
ResponseCode checkJoin(const QString &_password, bool spectator);
|
||||
Server_Player *addPlayer(Server_ProtocolHandler *handler, bool spectator, bool broadcastUpdate = true);
|
||||
void removePlayer(Server_Player *player);
|
||||
|
|
@ -73,7 +79,8 @@ public:
|
|||
|
||||
QList<ServerInfo_Player *> getGameState(Server_Player *playerWhosAsking) const;
|
||||
void sendGameEvent(GameEvent *event, GameEventContext *context = 0, Server_Player *exclude = 0);
|
||||
void sendGameEventContainer(GameEventContainer *cont, Server_Player *exclude = 0);
|
||||
void sendGameEventContainer(GameEventContainer *cont, Server_Player *exclude = 0, bool excludeOmniscient = false);
|
||||
void sendGameEventContainerOmniscient(GameEventContainer *cont, Server_Player *exclude = 0);
|
||||
void sendGameEventToPlayer(Server_Player *player, GameEvent *event);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue